|  |  | 
 |  |  |  | 
 |  |  |         QueryWrapper<Device> queryWrapper = new QueryWrapper<>(); | 
 |  |  |         queryWrapper.select("mac", "name").in("mac", macs); | 
 |  |  |         queryWrapper.orderByAsc("dev_num","name","id"); | 
 |  |  |         List<Device> devices = deviceMapper.selectList(queryWrapper); | 
 |  |  |         Map<String,Object> devicesInfo = new HashMap<>(); | 
 |  |  |         for (Device device:devices) { | 
 |  |  | 
 |  |  |                 for (HistoryHourly historyHourly:distinctHistoryHourlies) { | 
 |  |  |                     Map<String,Object> historyHourlyMap = new HashMap<>(); | 
 |  |  |                     historyHourlyMap.put("mac",mac); | 
 |  |  |                     JSONObject value = JSONObject.parseObject(historyHourly.getValue()); | 
 |  |  |                     Double sensorValue = Double.parseDouble(value.get(sensorCode).toString()); | 
 |  |  |                     JSONObject  value= JSONObject.parseObject(historyHourly.getValue()); | 
 |  |  |                     Double sensorValue = Objects.nonNull(value)&&Objects.nonNull(value.get(sensorCode))?Double.parseDouble(value.get(sensorCode).toString()):0d; | 
 |  |  |                     historyHourlyMap.put(sensorCode,sensorValue); | 
 |  |  |                     Date time = historyHourly.getTime(); | 
 |  |  |                     String timeStr = DateUtils.dateToDateString(time, DateUtils.yyyy_MM_dd_HH_EN); |