package com.jasamedika.medifirst2000.dao;

import java.util.Date;
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.StrukHasilPemeriksaan;

/**
 * Repository class for PAPPernapasan
 * 
 * @author Askur
 */
@Repository("StrukHasilPemeriksaanDao")
public interface StrukHasilPemeriksaanDao extends PagingAndSortingRepository<StrukHasilPemeriksaan, String> {

	
	@Query("select Max(p.noHasilPeriksa) from  StrukHasilPemeriksaan p where year(p.tglHasil) = year(:tglOrder) ")
	Integer findOrderByNoOrder(@Param("tglOrder")Date tglOrder);
	@Query("select p from  StrukHasilPemeriksaan p where p.strukOrder.noOrder =:noOrder or p.strukOrder.noOrderIntern =:noOrder")
	List<StrukHasilPemeriksaan> findByNoOrder(@Param("noOrder") String noOrder);

}
