package com.jasamedika.medifirst2000.dao;

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

@Repository("StrukHistoriDao")
public interface StrukHistoriDao extends PagingAndSortingRepository<StrukHistori, String> {
	
	//getIndekskehadiran
		@Query("select strukHistory "
				+ "from StrukHistori strukHistory "
				+ "where to_char(strukHistory.tglAwal,'yyyy-MM-dd') = :tanggalAwal "
				+ "and to_char(strukHistory.tglAhir,'yyyy-MM-dd') = :tanggalAkhir ")
		StrukHistori getStrukHistori(@Param("tanggalAwal") String tanggalAwal ,
				@Param("tanggalAkhir") String tanggalAkhir);	


}
