| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.flightfeather.monitor.domain.ds1.mapper.DustStatisticsValueMapper"> |
| | | <resultMap id="BaseResultMap" type="com.flightfeather.monitor.domain.ds1.entity.DustStatisticsValue"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <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="type" jdbcType="VARCHAR" property="type"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | id, mn_code, lst, day_avg, min, max, day_online, day_valid, day_exceeding, type |
| | | </sql> |
| | | <resultMap id="BaseResultMap" type="com.flightfeather.monitor.domain.ds1.entity.DustStatisticsValue"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <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="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"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | id, mn_code, lst, day_avg, min, max, day_online, day_valid, day_exceeding, type |
| | | </sql> |
| | | |
| | | <insert id="dailyStatics"> |
| | | insert into dust_statistics_value(mn_code,lst,day_avg,min,max,day_online,day_valid,day_exceeding,type) |
| | |
| | | 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 >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, |
| | | 'day' as type |
| | | from ja_t_dust_site_data_info |
| | | where lst between #{beginTime} and #{endTime} |
| | |
| | | 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 >= 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} |