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

@Repository("pengkajianKebutuhanDasarDao")
public interface PengkajianKebutuhanDasarDao extends PagingAndSortingRepository<PengkajianKebutuhanDasar, String>{

	@Query("select NEW Map ("
			+ "b.name as name,"
			+ "b.status as status,"
			+ "b.keterangan as keterangan) "
			+ "from PengkajianKebutuhanDasar a "
			+ "left join a.kebutuhanDasar b "
			+ "left join a.pengkajianAwalBaru c "
			+ "where c.noRec=:noRec")
	List<Map<String, Object>> getMapPengkajianKebutuhanDasar(
			@Param("noRec") String noRec);
}
