feiyu02
2023-12-01 c6842e8498c2d9b469890b38cd9f0d714392c445
src/main/resources/mapper/ds1/DustStatisticsValueMapper.xml
@@ -8,12 +8,12 @@
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="mn_code" jdbcType="VARCHAR" property="mnCode"/>
        <result column="lst" jdbcType="DATE" property="lst"/>
        <result column="day_avg" jdbcType="VARCHAR" property="dayAvg"/>
        <result column="min" jdbcType="VARCHAR" property="min"/>
        <result column="max" jdbcType="VARCHAR" property="max"/>
        <result column="day_online" jdbcType="VARCHAR" property="dayOnline"/>
        <result column="day_valid" jdbcType="VARCHAR" property="dayValid"/>
        <result column="day_exceeding" jdbcType="VARCHAR" property="dayExceeding"/>
    <result column="day_avg" jdbcType="DOUBLE" property="dayAvg" />
    <result column="min" jdbcType="DOUBLE" property="min" />
    <result column="max" jdbcType="DOUBLE" property="max" />
    <result column="day_online" jdbcType="DOUBLE" property="dayOnline" />
    <result column="day_valid" jdbcType="DOUBLE" property="dayValid" />
    <result column="day_exceeding" jdbcType="DOUBLE" property="dayExceeding" />
        <result column="type" jdbcType="VARCHAR" property="type"/>
    </resultMap>
    <sql id="Base_Column_List">
@@ -33,8 +33,8 @@
        min(dust_value) as min,
        max(dust_value) as max,
        ROUND(COUNT(*)/96, 4) as day_online,
        ROUND(SUM(CASE WHEN dust_value >0 THEN 1 ELSE 0 END)/96, 4) as day_valid,
        ROUND(SUM(CASE WHEN dust_value >= 1 THEN 1 ELSE 0 END)/96, 4) as day_exceeding,
        ROUND(SUM(CASE WHEN dust_value &gt;0 THEN 1 ELSE 0 END)/96, 4) as day_valid,
        ROUND(SUM(CASE WHEN dust_value &gt;= 1 THEN 1 ELSE 0 END)/96, 4) as day_exceeding,
        'day' as type
        from ja_t_dust_site_data_info
        where lst between #{beginTime} and #{endTime}
@@ -53,7 +53,7 @@
        MAX(dust_value) AS max,
        ROUND(COUNT(*) / #{count}, 4) AS month_online,
        ROUND(SUM(CASE WHEN flag = 'N' OR flag = 'A' THEN 1 ELSE 0 END) / #{count}, 4) AS month_valid,
        ROUND(SUM(CASE WHEN dust_value >= 1 THEN 1 ELSE 0 END) / #{count}, 4) AS month_exceeding,
        ROUND(SUM(CASE WHEN dust_value &gt;= 1 THEN 1 ELSE 0 END) / #{count}, 4) AS month_exceeding,
        'month' as type
        FROM ja_t_dust_site_data_info
        WHERE lst BETWEEN #{beginTime} and #{endTime}