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

/**
 * Repository class for KebutuhanDasarDao
 * 
 * @author Askur
 */
@Repository("KebutuhanDasarDao")
public interface KebutuhanDasarDao extends PagingAndSortingRepository<KebutuhanDasar, String> {
	@Query("select model from KebutuhanDasar model where model.antrianPasienDiPeriksa.noRec=:noRec")
	public List<KebutuhanDasar> findKebutuhanDasarByNoRec(@Param("noRec") String noRec);
	
	@Query("select a.polaNafas.name, a.nadi.name, a.komponen.name, a.mukosa.name, a.anus.name,a.bak.name, a.kelainanKulit.name,a.aktif.name, a.penglihatan.name, a.lamaTidur.name,a.gambaran.name, a.masalah.name, a.koping.name, a.pertolongan.name, a.sehat.name 	from KebutuhanDasar a where a.antrianPasienDiPeriksa.pasienDaftar.pasien.noCm=:noCm")
	public List<Object[]> findByNoCm(@Param("noCm") String noCm);	
	
	

}
