package com.jasamedika.medifirst2000.dao;

import java.util.List;

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

/**
 * Repository class for PelayananPasien
 * 
 * @author Generator
 */
@Repository("PelayananPasienDetailDao")
public interface PelayananPasienDetailDao extends PagingAndSortingRepository<PelayananPasienDetail, String> {

	@Query("select model from PelayananPasienDetail model left join model.pelayananPasien a where a.noRec=:noRec")
	List<PelayananPasienDetail> getPelayananPasienDetail(@Param("noRec") String noRec);

	@Query("select sum(ppd.hargaDiscount) " + "from PelayananPasienDetail ppd "
			+ "where ppd.pelayananPasienId = :noRec " + "and ppd.komponenHargaId = 35")
	Double totalDiskonJasamedis(@Param("noRec") String noRec);

}
