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.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.RemunerasiOperasional;

@Repository("remunerasiOperasionalDao")
public interface RemunerasiOperasionalDao extends PagingAndSortingRepository<RemunerasiOperasional, String> {

	@Query("select distinct new Map(ro.anggaranRemunTahun as anggaranTahun,ro.anggaranRemunBulan as anggaranBulan,"
			+ "ro.poinIndeksRupiah as pir,ro.totalNilaiJabatan as totNilaiJabatan,"
			+ "ro.tanggalPembaharuanData as tglPembaharuanData) " + "from RemunerasiOperasional ro "
			+ "where ro.statusEnabled is true " + "and to_char(ro.tahun,'yyyy') = to_char(now(),'yyyy') "
			+ "order by ro.tanggalPembaharuanData desc")
	List<Map<String, Object>> findTahunIni();

}
