燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-06-20 67a2ff11fc1ead7798d47ba12535ddc53c45fe1f
格式化小数位数
已修改11个文件
86 ■■■■ 文件已修改
src/main/resources/mapping/CommonMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/DictRecordMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/EmissionMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/ExpPointMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/FeedbackMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/LocationMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/QxshMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/SuYuanMapper.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/VocValsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/WarningDetailMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/WeatherMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapping/CommonMapper.xml
@@ -3,7 +3,6 @@
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yssh.dao.CommonMapper">
    <select id="checkTableExistsWithSchema" resultType="java.lang.Integer">
        SELECT COUNT(1) FROM information_schema.tables WHERE
        table_schema=#{tableSchema} AND table_name = #{tableName}
@@ -12,5 +11,4 @@
    <select id="checkTableExistsWithShow" parameterType="String"  resultType="java.util.Map">
        show tables like #{tableName}
    </select>
</mapper>
src/main/resources/mapping/DictRecordMapper.xml
@@ -81,5 +81,4 @@
          PRIMARY KEY (`id`) USING BTREE
        ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
    </update>
</mapper>
src/main/resources/mapping/EmissionMapper.xml
@@ -11,9 +11,8 @@
        <result column="property" property="property" />
    </resultMap>
    <select id="query" resultMap="EmissionResult">
        select
         *
        from emission
        select id, name, lon, lat, format(value, 2) "value", time, property
        from emission
        <where>
             <if test="name != null and name != ''">
                   and name = #{name}
@@ -23,7 +22,8 @@
    </select>
    <select id="getAll" resultMap="EmissionResult">
        select * from emission
        select id, name, lon, lat, format(value, 2) "value", time, property
        from emission
    </select>
    <insert id="insert" parameterType="com.yssh.entity.Emission">
src/main/resources/mapping/ExpPointMapper.xml
@@ -21,11 +21,11 @@
    
    <select id="selectList" resultMap="ExpPointResult">
        SELECT * FROM exp_point
    </select>
    
    <select id="selectByExpSiteNumbers" parameterType="java.util.List" resultMap="ExpPointResult">
        SELECT * FROM exp_point
        SELECT *
        FROM exp_point
        WHERE exp_site_number IN
        <foreach collection="expSiteNumbers" item="expSiteNumber" open="(" separator="," close=")">
            #{expSiteNumber}
src/main/resources/mapping/FeedbackMapper.xml
@@ -3,7 +3,6 @@
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yssh.dao.FeedbackMapper">
    <resultMap id="FeedbackDetailResult" type="com.yssh.entity.FeedbackDetail">
        <id property="id"    column="id"    />
        <result property="tableName"    column="table_name"    />
@@ -18,9 +17,9 @@
    </resultMap>
    
    <sql id="feedbackDetailSql">
        SELECT id, table_name, location_name, detection_id, detection_vocs_name,
        detection_value, practical_id, practical_vocs_name, practical_value, create_time
        FROM feedback
        SELECT id, table_name, location_name, detection_id, detection_vocs_name, format(detection_value, 2) detection_value,
             practical_id, practical_vocs_name, format(practical_value, 2) practical_value, create_time
        FROM feedback
    </sql>
    
    <select id="selectById" parameterType="java.lang.Long" resultMap="FeedbackDetailResult">
@@ -45,12 +44,10 @@
            #{detectionVocsName}, #{detectionValue}, #{practicalId}, 
            #{practicalVocsName}, #{practicalValue}, #{createTime})
    </insert>
    <update id="update" parameterType="com.yssh.entity.FeedbackDetail">
        UPDATE feedback SET 
        practical_id = #{practicalId}, practical_vocs_name = #{practicalVocsName}, practical_value = #{practicalValue}
        WHERE id = #{id}
    </update>
</mapper>
src/main/resources/mapping/LocationMapper.xml
@@ -10,7 +10,7 @@
    </resultMap>
    
    <sql id="locationSql">
        SELECT id, name, type, lon, lat FROM location
        SELECT id, name, type, format(lon, 6) lon, format(lat, 6) lat FROM location
    </sql>
    
    <select id="query" resultMap="locationResult">
src/main/resources/mapping/QxshMapper.xml
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yssh.dao.QxshMapper">
    <select id="selectByTime" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, value, time
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        where time = #{time}
        order by name;
@@ -10,7 +10,7 @@
    <select id="selectMonthTop10" resultType="com.yssh.entity.Qxsh">
        with rs as (
            select id, name, cast(value as decimal(12, 3)) "value", time
            select id, name, format(value, 2) "value", time
            from yssh_qxsh
            where time like #{time} and name like 'AI-%'
        )
@@ -20,7 +20,7 @@
    </select>
    <select id="select3Hours" resultType="com.yssh.entity.Qxsh">
        select id, name, format(value, 3) "value", time
        select id, name, format(value, 2) "value", time
        from yssh_qxsh
        where name like 'AI-%' and time in
            <foreach collection="times" item="time" open="(" separator="," close=")">
src/main/resources/mapping/SuYuanMapper.xml
@@ -53,7 +53,7 @@
    </resultMap>
    <select id="get2d" resultMap="SuYuan2dResult">
        SELECT id, x, y, c
        SELECT id, x, y, format(c, 2) "c"
        FROM ${tableName} 
        WHERE id IN 
        <foreach collection="ids" item="item" open="(" separator="," close=")">
@@ -64,25 +64,25 @@
    
    <select id="get3d" resultMap="SuYuan3dResult">
        SELECT sy.id, sy.x, sy.y,  sy.id, sy.x, sy.y, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  0)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  0)
        ) AS height0, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  1)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  1)
        ) AS height10, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  2)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  2)
        ) AS height20, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  3)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  3)
        ) AS height30, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  4)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  4)
        ) AS height40, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  5)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  5)
        ) AS height50, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  6)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  6)
        ) AS height60, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  7)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  7)
        ) AS height70, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  8)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  8)
        ) AS height80, (
            SELECT c FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  9)
            SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2),  9)
        ) AS height90
        FROM ${tableName} AS sy
        WHERE id IN 
@@ -93,7 +93,7 @@
    </select>
    
    <select id="getDistanceSuYuan" resultMap="DistanceSuYuanResult">
        SELECT id, x, y, c, u, v
        SELECT id, x, y, format(c, 2) "c", u, v
        FROM ${tableName} 
        WHERE id IN 
        <foreach collection="ids" item="item" open="(" separator="," close=")">
@@ -120,7 +120,7 @@
    </select>
    
    <select id="getAlarmsAnalyse" resultMap="SuYuan2dResult">
        SELECT id, x, y, c
        SELECT id, x, y, format(c, 2) "c"
        FROM ${tableName} 
        WHERE id IN 
        <foreach collection="ids" item="item" open="(" separator="," close=")">
@@ -130,7 +130,7 @@
    </select>
    <select id="getWarningAnalyse" resultMap="SuYuan2dResult">
        SELECT id, x, y, c
        SELECT id, x, y, format(c, 2) "c"
        FROM ${tableName}
        WHERE id IN
        <foreach collection="ids" item="item" open="(" separator="," close=")">
@@ -141,14 +141,14 @@
    
    <select id="getMonitorData" resultMap="SuYuanMonitorDataResult">
        <foreach collection="tableNames" item="tableName" separator=" UNION ">
            SELECT id, c, SUBSTRING_INDEX(#{tableName},'_',-1) AS time
            SELECT id, format(c, 2) "c", SUBSTRING_INDEX(#{tableName}, '_', -1) AS time
            FROM ${tableName} 
            WHERE id = #{id}
        </foreach>
    </select>
    <select id="getNewMonitorData" resultType="com.yssh.entity.SuYuanMonitorData">
        select id, value, time
        select id, format(value, 2) "value", time
        from yssh_qxsh
        where name = #{name} and Cast(time as signed) between ${start} and ${end}
        order by time desc;
@@ -156,7 +156,7 @@
    
    <select id="getMonthValueDataMax" resultType="java.util.Map">
        <foreach collection="tableNames" item="tableName" separator=" UNION ">
            SELECT TRUNCATE(c, 2) AS value, SUBSTRING_INDEX(#{tableName}, '_', -1) AS time
            SELECT format(c, 2) AS value, SUBSTRING_INDEX(#{tableName}, '_', -1) AS time
            FROM ${tableName}
            WHERE id = #{id}
        </foreach>
@@ -165,7 +165,7 @@
    </select>
    
    <select id="getTemporary" resultMap="TemporaryResult">
        SELECT  x, y, z, c, u, v, w, c
        SELECT  x, y, z, u, v, w, format(c, 2) "c"
        FROM ${tableName}
        WHERE id IN 
        <foreach collection="ids" item="item" open="(" separator="," close=")">
src/main/resources/mapping/VocValsMapper.xml
@@ -14,7 +14,8 @@
        select a.x, a.y, format(a.val, 2) "val", b.addr
        from voc_vals a inner join voc_addr b
        on a.x = b.x and a.y = b.y
        where date_format(a.create_time, '%Y%m%d%H') = ${time} and a.val > 0.5;
        where date_format(a.create_time, '%Y%m%d%H') = ${time}
            and a.val > (select jcyj from alert_config);
    </select>
    <select id="countByTime" resultType="java.lang.Integer">
src/main/resources/mapping/WarningDetailMapper.xml
@@ -20,14 +20,14 @@
    </resultMap>
    
    <select id="selectWarningDetailByType" resultMap="WarningVoResult">
        SELECT location_name, su_yuan_id, value
        SELECT location_name, su_yuan_id, format(value, 2) "value"
        FROM warning_detail
        WHERE date_format(create_time, '%Y%m%d%H%I') &gt;= date_format(NOW(), '%Y%m%d%H%I')
        AND type = #{type}
    </select>
    
    <select id="selectWarningDetailByMap_old" parameterType="java.util.Map" resultMap="WarningVoResult">
        SELECT location_name, su_yuan_id, value
        SELECT location_name, su_yuan_id, format(value, 2) "value"
        FROM warning_detail
        WHERE date_format(create_time, '%Y%m%d%H%I%S') &gt;= date_format(#{startTime}, '%Y%m%d%H%I%S')
        AND date_format(create_time, '%Y%m%d%H%I%S') &lt;= date_format(#{endTime}, '%Y%m%d%H%I%S')
@@ -35,7 +35,7 @@
    </select>
    <select id="selectWarningDetailByMap" parameterType="java.util.Map" resultMap="WarningVoResult">
        select location_name, su_yuan_id, value
        select location_name, su_yuan_id, format(value, 2) "value"
        from warning_detail
        where create_time between #{startTime} and #{endTime} and type = #{type};
    </select>
@@ -79,7 +79,8 @@
    </select>
    <select id="selectByTime" resultMap="WarningDetailResult">
        select * from warning_detail
        select id, table_name, su_yuan_id, location_name, type, create_time, format(value, 2) "value"
        from warning_detail
        where create_time between #{startTime} and #{endTime}
        order by create_time;
    </select>
src/main/resources/mapping/WeatherMapper.xml
@@ -11,7 +11,8 @@
    </resultMap>
    
    <select id="query" resultMap="WeatherResult">
        select * from yssh_weather
        select id, time, format(wind_speed, 2) "wind_speed", wind_direction, weather_condition, format(temperature, 2) "temperature"
        from yssh_weather
        <where>
            1 = 1
            <if test="begin != null">
@@ -24,7 +25,8 @@
    </select>
    
    <select id="getAll" resultMap="WeatherResult">
        select * from yssh_weather
        select id, time, format(wind_speed, 2) "wind_speed", wind_direction, weather_condition, format(temperature, 2) "temperature"
        from yssh_weather
    </select>
    <insert id="insert" parameterType="com.yssh.entity.Weather">