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

/**
 * Repository class for AsesmenGiziAwal
 * 
 * @author Adik
 */
@Repository("AsesmenGiziAwalDao")
public interface AsesmenGiziAwalDao extends PagingAndSortingRepository<AsesmenGiziAwal, String> {
	// custom query
	
	@Query("select b.jenisDiet.jenisDiet, c.value, a.risiko.name from AsesmenGiziAwal a, PreskripsiDiet b, TindakLanjutGizi c where b.asesmenGiziAwalId = a.noRec and c.asesmenGiziAwalId = a.noRec and a.pasienDaftar.pasienDaftar.pasien.noCm =:noCm")
	public List<Object[]> findByNoCm(@Param("noCm") String noCm);
	
	
}
