package com.jasamedika.medifirst2000.dao;

import java.util.Date;

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.LembarKonsultasi;

@Repository("LembarKonsultasiDao")
public interface LembarKonsultasiDao extends PagingAndSortingRepository<LembarKonsultasi, String> {
	
	// custom query WITH pagination
		@Query("select model from LembarKonsultasi model where model.pasien.noCm=:noCm")
		public LembarKonsultasi findLembarKonsultasiByNocm(@Param("noCm") String noCm);
		
		@Query("select model from LembarKonsultasi model where model.pasien.noCm=:noCm and model.tanggal=:tanggal")
		public LembarKonsultasi findLembarKonsultasiByNoCmAndTglInput(@Param("noCm") String noCm,@Param("tanggal") Date tanggal);

}
