| | |
| | | <mapper namespace="com.job.zsc.mapper.FugitiveDustMapper"> |
| | | |
| | | <select id="conditonQueryDustHistoryData" resultType="com.job.zsc.pojo.DustSiteData"> |
| | | select * |
| | | from monitor_site |
| | | select a.*,b.* |
| | | from ja_t_dust_site_data_info as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code |
| | | <where> |
| | | <if test="siteName !=null and siteName != ''"> |
| | | Name like concat('%',#{siteName},'%') |
| | | b.name like concat('%',#{siteName},'%') |
| | | </if> |
| | | <if test="mnCode !=null and mnCode != ''"> |
| | | and MN_Code = #{mnCode} |
| | | and a.mn_code = #{mnCode} |
| | | </if> |
| | | <if test="beginTime != null and endTime != null"> |
| | | and Lst between #{beginTime} and #{endTime} |
| | | and a.lst between #{beginTime} and #{endTime} |
| | | </if> |
| | | |
| | | <if test="scenarioType != null and scenarioType != '' "> |
| | | and Type_Name in |
| | | and b.typename in |
| | | <foreach item="item" collection="scenarioType" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | |
| | | |
| | | <!--分析数据--> |
| | | <select id="analysisdata" resultType="com.job.zsc.pojo.AnalysisDustData"> |
| | | select a.* from dust_statistics_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code |
| | | select a.*,b.name,b.duty_company from dust_statistics_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code |
| | | <where> |
| | | <if test="siteName !=null and siteName != ''"> |
| | | b.name = #{siteName} |
| | |
| | | min(a.dust_value) as min, |
| | | max(a.dust_value) as max, |
| | | CONCAT(ROUND(COUNT(*)/96*100, 2), '%') as day_online, |
| | | CONCAT(ROUND(SUM(CASE WHEN a.dust_value >0 THEN 1 ELSE 0 END)/COUNT(*) *100, 2), '%') as day_valid, |
| | | CONCAT(ROUND(SUM(CASE WHEN a.dust_value >0 THEN 1 ELSE 0 END)/96 *100, 2), '%') as day_valid, |
| | | CONCAT(ROUND(SUM(CASE WHEN a.dust_value >= 1 THEN 1 ELSE 0 END)/96*100,2),'%') as day_exceeding |
| | | from ja_t_dust_site_data_info as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code |
| | | <where> |