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

/**
 * Repository class for Kedudukan
 * 
 * @author Generator
 */
@Repository("KedudukanDao")
public interface KedudukanDao extends PagingAndSortingRepository<Kedudukan, Integer> {
	
	@Query("select new map (model.id as id, model.name as name) from Kedudukan model where model.statusEnabled is true order by name")
	public List<Map<String, Object>> getAllByStatusEnabled();
	
	@Query("select new Map(model.id as id, model.name as name) from Kedudukan model where model.id = :kedudukanId and model.statusEnabled is true")
	public Map<String, Object> getKedudukanById(@Param("kedudukanId") Integer kedudukanId);

}
