| | |
| | | } |
| | | HistoryAqi historyAqi = new HistoryAqi(); |
| | | historyAqi.setGuid(guid); |
| | | historyAqi.setTime(time); |
| | | historyAqi.setTime(DateUtils.addHours(time, -1)); |
| | | //存入数据库 |
| | | historyAqi.setValue(JSONObject.toJSONString(map)); |
| | | historyAqiMapper.insert(historyAqi); |
| | |
| | | @Override |
| | | public HistoryAqi getHistoryApiByTimeAndGuid(String guid, String time) { |
| | | QueryWrapper<HistoryAqi> wrapper_historyAqi = new QueryWrapper<>(); |
| | | wrapper_historyAqi.eq("guid",guid).eq("time",time); |
| | | wrapper_historyAqi.eq("guid", guid).eq("time", time); |
| | | HistoryAqi historyAqi = new HistoryAqi(); |
| | | if (historyAqiMapper.selectCount(wrapper_historyAqi)==1){ |
| | | if (historyAqiMapper.selectCount(wrapper_historyAqi) == 1) { |
| | | historyAqi = historyAqiMapper.selectOne(wrapper_historyAqi); |
| | | } |
| | | return historyAqi; |