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

@Repository("NotifikasiModulMessageDao")
public interface NotifikasiMessageObjekModulDao extends JpaRepository<NotifikasiMessageObjekModul, Integer> {

	List<NotifikasiMessageObjekModul> findByNotifMessagingId(Integer notifMessagingId);
	
	@Query("SELECT n FROM NotifikasiMessageObjekModul n WHERE n.notifMessagingId = :notifMessagingId AND n.ruanganId IN (:ruanganIds)")
	List<NotifikasiMessageObjekModul> findByNotifMessagingIdAndRuanganId(@Param("notifMessagingId")Integer notifMessagingId, @Param("ruanganIds") List<Integer> ruanganIds);

}

