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

@Repository("CekListGedungBangunanDao")
public interface CekListGedungBangunanDao extends PagingAndSortingRepository<CekListGedungBangunan, Integer>{
	@Query("select new map(a.id as id, a.namaExternal as namaExternal) " +
			" from CekListGedungBangunan a where a.idParent is null")
	List<Map<String, Object>> getCekListGedungBangunanParent();
	
	@Query("select new map(a.id as id, a.namaExternal as namaExternal) " +
			" from CekListGedungBangunan a where a.idParent=:id")
	List<Map<String, Object>> getCekListGedungBangunanChild(@Param("id")Integer id);

}
