| | |
| | | String monitor_point_id = (String) parameters.get("monitor_point_id");
|
| | | List<Map<String, Object>> list = sensorService.getSensorByMonitorPointId(monitor_point_id);
|
| | | List<Map<String, Object>> sensorUnitList = sensorUnitService.getSensorsByMonitPointId2(monitor_point_id);
|
| | | System.out.println(sensorUnitList);
|
| | | System.out.println("list:"+list);
|
| | | System.out.println("sensorUnitList:"+sensorUnitList);
|
| | | for (Map<String, Object> sensorMap : list) {
|
| | | for (Map<String, Object> sensorUnitMap : sensorUnitList) {
|
| | | if (sensorUnitMap.get("sensor_key").equals(sensorMap.get("sensor_key"))) {
|
| | | if (sensorUnitMap.get("sensor_key").equals(sensorMap.get("sensorKey"))) {
|
| | | sensorMap.put("unit", sensorUnitMap.get("name"));
|
| | | }
|
| | | }
|
| | |
| | | </select> |
| | | |
| | | <select id="getSensorByMonitorPointId" resultType="java.util.Map"> |
| | | SELECT DISTINCT s.* |
| | | SELECT DISTINCT s.sensor_key sensorKey,s.unit,s.name,s.description,s.id |
| | | FROM device d,device_version dv,device_version_sensor dvs,sensor s |
| | | WHERE d.device_version_id = dvs.device_version_id |
| | | AND dvs.sensor_id = s.id |