package com.jasamedika.medifirst2000.dao;

import java.util.Date;

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

@Repository("PapPengambilanSpesimenDao")
public interface PapPengambilanSpesimenDao extends PagingAndSortingRepository<PapPengambilanSpesimen, String> {
	
	@Query("select p from PapPengambilanSpesimen p where p.strukOrder.noOrder=:noOrder and p.strukOrder.tglOrder=:tglOrder ")
	public PapPengambilanSpesimen finByNoOrderAndTglOrder(@Param("noOrder") String noOrder,@Param("tglOrder") Date tglOrder);	
	
	@Query("select NEW com.jasamedika.medifirst2000.entities.PapPengambilanSpesimen(model.jumlah,model.noRec,  model.tglAmbilSpesimen)  from PapPengambilanSpesimen model where model.noRec=:noRec")
	public PapPengambilanSpesimen findPapPengambilanSpesimenByNoRec(@Param("noRec") String noRec);
	
}
