燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-05-24 b8a02f8d72f56d0d18565e60133247187b7b4521
1
已修改3个文件
39 ■■■■ 文件已修改
src/main/java/com/yssh/controller/WarningAnalyseController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/QxshMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/WarningAnalyseController.java
@@ -79,15 +79,15 @@
        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);
    }
@@ -102,15 +102,15 @@
        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);
    }
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
@@ -374,7 +374,7 @@
    @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);
src/main/resources/mapping/QxshMapper.xml
@@ -9,9 +9,12 @@
    </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>