package com.jasamedika.medifirst2000.dao;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.ProduksiNonSteril;

@Repository("ProduksiNonSterilDao")
public interface ProduksiNonSterilDao extends PagingAndSortingRepository<ProduksiNonSteril, Integer> {
	@Query("select count(p.id) from ProduksiNonSteril p where :dateNow=:dateNow  ")
	Integer getCountByMonthAndYear(@Param("dateNow") Date dateNow);
	
//	@Query("select model from JenisProduk p where p.kelompokProduk.id=5")
//	public List<ProduksiNonSteril> getJenisBarangMedis();
	
	@Query("select id, namaProduk from Produk")
	public List<Object> findBarangMedis();
}
