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

@Repository("RekananSkKontrakDetailDao")
public interface RekananSkKontrakDetailDao extends PagingAndSortingRepository<RekananSkKontrakDetail, String> {

	@Query("select new Map(model.nilaiKontrak as nilaiKontrak,model.tanggalAwalKontrak as tanggalAwalKontrak,model.tanggalAhirKontrak as tanggalAhirKontrak,satuanStandar.satuanStandar as satuanStandar,model.qtyProduk as qtyProduk,model.selisihKontrak as selisihKontrak ) "
			+ "from RekananSkKontrakDetail model left join model.produk produk left join model.satuanStandar satuanStandar left join model.rekanan rekanan left join model.rekananSkKontrak rekananSkKontrak  where rekananSkKontrak.noRec=:noRec ")
	List<Map<String,Object>> findByParent(@Param("noRec") String noRec);
	
}
	
	
