| | |
| | | Object obj = CacheUtils.get(key); |
| | | Map<String, List<Double>> map; |
| | | |
| | | if (null != obj) { |
| | | map = (Map<String, List<Double>>) obj; |
| | | } else { |
| | | //if (null != obj) { |
| | | // map = (Map<String, List<Double>>) obj; |
| | | //} else { |
| | | //map = warningService.selectEachLocationDataChange(); |
| | | map = warningService.select3Hours(); |
| | | if (null != map && map.size() > 0) { |
| | | CacheUtils.put(key, map); |
| | | } |
| | | } |
| | | // if (null != map && map.size() > 0) { |
| | | // CacheUtils.put(key, map); |
| | | // } |
| | | //} |
| | | |
| | | return Result.ok(map); |
| | | } |
| | |
| | | Object obj = CacheUtils.get(key); |
| | | List<Qxsh> list; |
| | | |
| | | if (null != obj) { |
| | | list = (List<Qxsh>) obj; |
| | | } else { |
| | | //if (null != obj) { |
| | | // list = (List<Qxsh>) obj; |
| | | //} else { |
| | | //list = warningService.selectThisMonthLocationValueDataTop10(); |
| | | list = warningService.selectMonthTop10(); |
| | | if (null != list && list.size() > 0) { |
| | | CacheUtils.put(key, list); |
| | | } |
| | | } |
| | | // if (null != list && list.size() > 0) { |
| | | // CacheUtils.put(key, list); |
| | | // } |
| | | //} |
| | | |
| | | return Result.ok(list); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Map<String, List<Double>> select3Hours() { |
| | | Map<String, List<Double>> map = new HashMap<>(); |
| | | Map<String, List<Double>> map = new LinkedHashMap<>(); |
| | | |
| | | List<String> times = DateUtils.get3Hours(); |
| | | List<Qxsh> list = qxshMapper.select3Hours(times); |
| | |
| | | </select> |
| | | |
| | | <select id="selectMonthTop10" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, format(value, 3) "value", time |
| | | from yssh_qxsh |
| | | where time like #{time} and name like 'AI-%' |
| | | with rs as ( |
| | | select id, name, cast(value as decimal(12, 3)) "value", time |
| | | from yssh_qxsh |
| | | where time like #{time} and name like 'AI-%' |
| | | ) |
| | | select id, name, value, time from rs |
| | | order by value desc |
| | | limit 10; |
| | | </select> |