package com.jasamedika.medifirst2000.dao;

import java.util.List;
import java.util.Map;

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

import com.jasamedika.medifirst2000.entities.MonitoringMesinAutoClaveBowidick;

@Repository("MonitoringTestMesinAutoClaveBowidickDao")
public interface MonitoringMesinAutoClaveBowidickDao extends CrudRepository<MonitoringMesinAutoClaveBowidick, String>{
	@Query("select new map(a.noRec as noRec, " +
		" a.tanggal as tanggal, a.program as program, " +
		" a.hasil as hasil, a.keterangan as keterangan, " +
		" b.id as idPegawai, b.namaExternal as namaPegawai, " +
		" c.id as idMesin, c.namaExternal as namaMesin) "+ 
		" from MonitoringMesinAutoClaveBowidick a " +
		" left join a.operator b " + 
		" left join a.mesin c " +
		" where date(a.tanggal) between date(:startDate) and date(:endDate) and a.statusEnabled in('true')")	
	List<Map<String, Object>> getMonitoringMesinAutoClaveBowidick(@Param("startDate")String startDate, @Param("endDate")String endDate);


}
