package com.jasamedika.medifirst2000.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.MapObjekModulToLoginUser;

/**
 * Repository class for MapObjekModulToLoginUser
 * 
 * @author Syamsu
 */

@Repository("MapObjekModulToLoginUserDao")
public interface MapObjekModulToLoginUserDao extends JpaRepository<MapObjekModulToLoginUser, Integer>  {

	@Query("select m from MapObjekModulToLoginUser m where m.loginUser.id=:loginUser ")
	List<MapObjekModulToLoginUser> findByLoginUser(@Param("loginUser")  Integer loginUser);
//	@Query("select model from PapAnamesis model where model.pasien.noCm=:noCm and model.tglInput=:tglInput")
//	public PapAnamesis findPapAnamesisByNoCmAndTglInput(@Param("noCm") String noCm,@Param("tglInput") Date tglInput);


	@Query("select m from MapObjekModulToLoginUser m WHERE"
			+ " m.objekModulAplikasiId = :objekModulAplikasiId AND "
			+ " m.loginUserId = :loginUserId")
	MapObjekModulToLoginUser findByObjekModulAplikasi(
			@Param("objekModulAplikasiId")  Integer objekModulAplikasiId, 
			@Param("loginUserId") Integer loginUserId);
	
}
