From 3543b001e3da2cb801d7dfa27b396db4edbfb740 Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期三, 27 九月 2023 17:27:46 +0800 Subject: [PATCH] 添加了风险排名接口 --- src/main/resources/com/job/zsc/mapper/FugitiveDustMapper.xml | 108 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 98 insertions(+), 10 deletions(-) diff --git a/src/main/resources/com/job/zsc/mapper/FugitiveDustMapper.xml b/src/main/resources/com/job/zsc/mapper/FugitiveDustMapper.xml index 97d37c9..0938dff 100644 --- a/src/main/resources/com/job/zsc/mapper/FugitiveDustMapper.xml +++ b/src/main/resources/com/job/zsc/mapper/FugitiveDustMapper.xml @@ -3,23 +3,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.job.zsc.mapper.FugitiveDustMapper"> + <update id="update"> + update audit_info + <set> + <if test="exceptionId != null and exceptionId!=''" > + exception_id = #{exceptionId}, + </if> + <if test="checker != null and checker!=''" > + checker = #{checker}, + </if> + + <if test="checkerContent != null and checkerContent!=''" > + checker_content = #{checkerContent} , + </if> + <if test="enterpriseContent != null and enterpriseContent!=''" > + enterprise_content = #{enterpriseContent}, + </if> + <if test="auditStatus != null and auditStatus!=''" > + audit_status = #{auditStatus}, + </if> + <if test="updateTime != null" > + update_time = #{updateTime} + </if> + + </set> + where exception_id = #{exceptionId} + </update> <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> @@ -30,7 +56,7 @@ <!--鍒嗘瀽鏁版嵁--> <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} @@ -54,7 +80,7 @@ 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> @@ -70,9 +96,10 @@ order by lst asc ) as d on c.mn_code = d.mn_code </select> - <!--鏉′欢鏌ヨ寮傚父鏁版嵁--> + <!--鏉′欢鏌ヨ寮傚父鏁版嵁 鍔犱笂浜嗗璁′俊鎭�--> <select id="getExceptionData" resultType="com.job.zsc.pojo.DustExceptionData"> - select b.name,b.typename,b.address,b.duty_company,a.* + select * + from (select a.* ,b.name,b.typename,b.address,b.duty_company from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code <where> <if test="siteName !=null and siteName != ''"> @@ -86,17 +113,22 @@ </foreach> </if> + <if test="beginTime != null and endTime != null"> and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) </if> </where> + ) + as c left join audit_info as d on c.id = d.exception_id </select> + <!-- 鏍规嵁鏌愭鏃堕棿鍐呮煇涓紓甯哥被鍨嬫煡璇㈠搴旂殑搴楅摵鍚嶇О鍜岃澶囩紪鍙�--> <select id="getExceptionSitenameAndCode" resultType="com.job.zsc.pojo.DustExceptionData"> select DISTINCT b.name,a.mn_code from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code + <where> <if test="exceptionType !=null and exceptionType != ''"> a.exception_type = #{exceptionType} @@ -123,4 +155,60 @@ </where> order by a.lst asc </select> + + <select id="getHasAuditedData" resultType="com.job.zsc.pojo.DustExceptionData"> + select * + from dust_exception_data as a left join audit_info as b on a.id = b.exception_id + <where> + <if test="beginTime != null and endTime != null"> + (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) and b.audit_status != 0 + + </if> + </where> + + </select> + <select id="getSiteNameByTimeAndExceptionType" resultType="com.job.zsc.pojo.DustExceptionData"> + select DISTINCT b.name + from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code + <where> + <if test="exceptionType != null and exceptionType != '' "> + a.exception_type in + <foreach item="item" collection="exceptionType" separator="," open="(" close=")"> + #{item} + </foreach> + </if> + + <if test="beginTime != null and endTime != null"> + and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) + </if> + </where> + + </select> + <select id="analysisdataByType" resultType="com.job.zsc.pojo.AnalysisDustData"> + 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="month != null and month != null"> + a.lst = #{month} + </if> + + <if test="type != null and type != ''"> + and a.type = #{type} + </if> + </where> + + </select> + <select id="analysisdataByTimeAndType" resultType="com.job.zsc.pojo.AnalysisDustData"> + 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="beginTime != null and endTime != null"> + a.Lst between #{beginTime} and #{endTime} + </if> + + <if test="type != null and type != ''"> + and a.type = #{type} + </if> + </where> + + + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3