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

@Repository("ViewGajiPegawaiDao")
public interface ViewGajiPegawaiDao extends PagingAndSortingRepository<ViewGajiPegawai, Integer> {
	
	@Query("select new Map "
			+ "(v.id as id, "
			+ "v.nipPns as nip, "
			+ "v.kategoriPegawai as idKategoriPegawai, "
			+ "v.namaLengkap as namaLengkap, "
			+ "v.golongan as golongan, "
			+ "v.pendidikan as pendidikan, "
			+ "v.masaKerja as masaKerja, "
			+ "v.idKomponenHarga as idKomponenGaji, "
			+ "v.komponenHarga as komponenGaji, "
			+ "v.hargaSatuan as hargaSatuan) "
			+ "from ViewGajiPegawai v "
			+ "where v.kategoriPegawai=:kategoriPegawai "
			+ "order by v.nipPns, v.namaLengkap")
	List<Map<String, Object>> findGajiPegawai(@Param("kategoriPegawai") Integer kategoriPegawai);

}
