From 2f520dead71530e21c844e7d2db8face0cfa1c35 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 22 Mar 2018 18:42:35 +0900 Subject: [PATCH] Map> readAllByDisplayItems(List displayItems) --- .../service/SensorItemDependencyService.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemDependencyService.java b/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemDependencyService.java index b6fcd83..30773b0 100644 --- a/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemDependencyService.java +++ b/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemDependencyService.java @@ -7,7 +7,9 @@ import com.loafle.overflow.module.sensor.model.SensorItemDependency; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Created by insanity on 17. 9. 20. @@ -26,4 +28,16 @@ public class SensorItemDependencyService { public List readAllByDisplayItem(MetaSensorDisplayItem displayItem) { return this.sensorItemDependencyDAO.findAllByDisplayItem(displayItem); } + + public Map> readAllByDisplayItems(List displayItems) { + + Map> map = new HashMap>(); + + for (MetaSensorDisplayItem displayItem : displayItems) { + List itemKeys = this.sensorItemDependencyDAO.findAllByDisplayItem(displayItem); + map.put(displayItem.getKey(), itemKeys); + } + + return map; + } }