package com.jasamedika.medifirst2000.dao;

import java.util.Map;

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

@Repository("k3LaporanKecelakaanKerjaDao")
public interface K3LaporanKecelakaanKerjaDao extends PagingAndSortingRepository<K3LaporanKecelakaanKerja, String>{
	@Query("select new map(count(a.noRec) as jmlKorban, b.noRec as noRec) " +
			" from LkkIdentifikasiKorban a left join " +
			" a.lkkIdentifikasiKejadian b where b.noRec =:noRec "+
			" group by b.noRec")
	Map<String, Object> getJumlahKorban(@Param("noRec") String noRec);
	
}
