Map<String, List<MetaSensorItemKey>> readAllByDisplayItems(List<MetaSensorDisplayItem> displayItems)

This commit is contained in:
insanity 2018-03-22 18:42:35 +09:00
parent 04df627e7a
commit 2f520dead7

View File

@ -7,7 +7,9 @@ import com.loafle.overflow.module.sensor.model.SensorItemDependency;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created by insanity on 17. 9. 20. * Created by insanity on 17. 9. 20.
@ -26,4 +28,16 @@ public class SensorItemDependencyService {
public List<MetaSensorItemKey> readAllByDisplayItem(MetaSensorDisplayItem displayItem) { public List<MetaSensorItemKey> readAllByDisplayItem(MetaSensorDisplayItem displayItem) {
return this.sensorItemDependencyDAO.findAllByDisplayItem(displayItem); return this.sensorItemDependencyDAO.findAllByDisplayItem(displayItem);
} }
public Map<String, List<MetaSensorItemKey>> readAllByDisplayItems(List<MetaSensorDisplayItem> displayItems) {
Map<String, List<MetaSensorItemKey>> map = new HashMap<String, List<MetaSensorItemKey>>();
for (MetaSensorDisplayItem displayItem : displayItems) {
List<MetaSensorItemKey> itemKeys = this.sensorItemDependencyDAO.findAllByDisplayItem(displayItem);
map.put(displayItem.getKey(), itemKeys);
}
return map;
}
} }