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.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.PlanningPelayananPetugas;

/**
 * @author Shakato
 */
@Repository("PlanningPelayananPetugasDao")
public interface PlanningPelayananPetugasDao extends PagingAndSortingRepository<PlanningPelayananPetugas, String> {

	@Query("select new Map(petugas.noRec as noRec,pegawai.namaLengkap as namaPegawai,pegawai.id as idPegawai) from PlanningPelayananPetugas petugas "
			+ "left join petugas.pegawai pegawai left join petugas.strukOrder strukOrder "
			+ "where strukOrder.noRec=:noRec ")
	List<Map<String,Object>> getTeknisi(@Param("noRec") String noRec);

	@Query("select model from PlanningPelayananPetugas model "
			+"left join model.strukPlaning strukPlanning "
			+"where strukPlanning.noRec=:noRecstrukPlanning")
	List<PlanningPelayananPetugas> getPlanningRekrutmenSeleksiByStrukPlanning(@Param("noRecstrukPlanning")String noRecstrukPlanning);

}
