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

@Repository("pemantauanKinerjaPihakKetigaDao")
public interface PemantauanKinerjaPihakKetigaDao extends PagingAndSortingRepository<PemantauanKinerjaPihakKetiga, Integer>{

	@Query("select NEW Map ("
			+ "model as pemantauanKinerjaPihakKetiga) "
			+ "from PemantauanKinerjaPihakKetiga model")
	List<Map<String, Object>> getPemantauanKinerjaPihakKetiga();
	
	@Query("select NEW Map ("
			+ "a.file as file) "
			+ "from PemantauanKinerjaPihakKetiga a "
			+ "where a.id=:id")
	Map<String, Object> downloadHasilPemantauan(
			@Param("id") Integer id);
	
	
}
