燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-05-05 c13a4fb3d732d124ea3104838e989d16bd6983e1
1
已修改2个文件
19 ■■■■■ 文件已修改
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/SuYuanMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
@@ -341,12 +341,19 @@
            return result;
        }
        /*List<String> idList = new ArrayList<>();
        for (MonitorPointPosition c : checkPoints) {
            idList.add("'" + c.getId() + "'");
        }
        String ids = String.join(",", idList);*/
        for (MonitorPointPosition c : checkPoints) {
            Map<String, Object> map = suYuanMapper.getMonthValueDataMax(tableNames, c.getId());
            if (null != map && map.size() > 0) {
                String suYuanId = map.get("id").toString();
                map.put("name", commonService.select3dCheckPointById(suYuanId).getName());
                map.remove("id");
                //String suYuanId = map.get("id").toString();
                //map.put("name", commonService.select3dCheckPointById(suYuanId).getName());
                //map.remove("id");
                map.put("name", c.getName());
            }
            result.add(map);
        }
src/main/resources/mapping/SuYuanMapper.xml
@@ -134,12 +134,12 @@
    
    <select id="getMonthValueDataMax" resultType="java.util.Map">
        <foreach collection="tableNames" item="tableName" separator=" UNION ">
            SELECT id, TRUNCATE(c, 2) AS value, SUBSTRING_INDEX(#{tableName},'_',-1) AS time
            FROM ${tableName}
            SELECT TRUNCATE(c, 2) AS value, SUBSTRING_INDEX(#{tableName}, '_', -1) AS time
            FROM ${tableName}
            WHERE id = #{id}
        </foreach>
        ORDER BY value DESC
        LIMIT 0, 1
        LIMIT 1
    </select>
    
    <select id="getTemporary" resultMap="TemporaryResult">