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

@Repository("StatusPegawaiDao")
public interface StatusPegawaiDao extends PagingAndSortingRepository<StatusPegawai, Integer> {
	
	@Query("select model from StatusPegawai model where model.id=:id")
	StatusPegawai getAll(@Param("id") Integer id);
	
	@Query("select new Map(model.id as id, model.statusPegawai as statusPegawai) from StatusPegawai model where model.id = :statusPegawaiId and model.statusEnabled is true")
	public Map<String, Object> getStatusPegawaiById(@Param("statusPegawaiId") Integer statusPegawaiId);
	
}
