diff --git a/src/main/java/com/loafle/overflow/module/sensor/dao/SensorDAO.java b/src/main/java/com/loafle/overflow/module/sensor/dao/SensorDAO.java index ad20dba..fea4c54 100644 --- a/src/main/java/com/loafle/overflow/module/sensor/dao/SensorDAO.java +++ b/src/main/java/com/loafle/overflow/module/sensor/dao/SensorDAO.java @@ -5,6 +5,8 @@ import com.loafle.overflow.module.probe.model.Probe; import com.loafle.overflow.module.sensor.model.Sensor; import com.loafle.overflow.module.target.model.Target; 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 java.util.List; @@ -16,6 +18,7 @@ import java.util.List; public interface SensorDAO extends JpaRepository { List findAllByTarget(Target target); - List findAllByTarget(List targetList); + @Query("SELECT s from Sensor s WHERE s.target in (:targetList)") + List findAllByTarget(@Param("targetList") List targetList); // List findAllByTargetList(List targets); }