| | |
| | | Integer start = Integer.parseInt(DateUtils.getYyyyMmDdHh(startDate)); |
| | | Integer end = Integer.parseInt(DateUtils.getYyyyMmDdHh(endDate)); |
| | | |
| | | String key = "WAS.monthCount." + start + "." + end; |
| | | Object obj = CacheUtils.get(key); |
| | | if (obj instanceof Map<?, ?>) { |
| | | return (Map<String, Integer>) obj; |
| | | } |
| | | |
| | | Map<String, Integer> result = new HashMap<>(); |
| | | Integer warnNum = qxshMapper.countMonthForWarn(start, end); |
| | | result.put("warningNumber", null == warnNum ? 0 : warnNum); |
| | | |
| | | Integer alarmNum = qxshMapper.countMonthForAlarm(start, end); |
| | | result.put("alarmNumber", null == alarmNum ? 0 : alarmNum); |
| | | |
| | | CacheUtils.put(key, result); |
| | | |
| | | return result; |
| | | } |
| | |
| | | Integer start = Integer.parseInt(DateUtils.getYyyyMmDdHh(startDate)); |
| | | |
| | | Map<String, List<Map<String, Object>>> result = new HashMap<>(); |
| | | List<Map<String, Object>> warnList = qxshMapper.count7DayForWarn(start, end); |
| | | //List<Map<String, Object>> warnList = qxshMapper.count7DayForWarn(start, end); |
| | | String key = "qxshMapper.count7DayForWarn." + start + "." + end; |
| | | List<Map<String, Object>> warnList = CacheUtils.getListByKey(key); |
| | | if (null == warnList) { |
| | | warnList = qxshMapper.count7DayForWarn(start, end); |
| | | CacheUtils.putListByKey(key, warnList); |
| | | } |
| | | result.put("warningDayCount", warnList); |
| | | |
| | | List<Map<String, Object>> alarmList = qxshMapper.count7DayForAlarm(start, end); |
| | | //List<Map<String, Object>> alarmList = qxshMapper.count7DayForAlarm(start, end); |
| | | String key2 = "qxshMapper.count7DayForAlarm." + start + "." + end; |
| | | List<Map<String, Object>> alarmList = CacheUtils.getListByKey(key2); |
| | | if (null == alarmList) { |
| | | alarmList = qxshMapper.count7DayForAlarm(start, end); |
| | | CacheUtils.putListByKey(key2, alarmList); |
| | | } |
| | | result.put("alarmDayCount", alarmList); |
| | | |
| | | return result; |