From 7be0d5b901b999d2347774df3cc1a64927838bb3 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期二, 15 四月 2025 10:10:35 +0800
Subject: [PATCH] 优化每年专项数据获取

---
 src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml |   74 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml b/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml
index 3140711..bb270a2 100644
--- a/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml
+++ b/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml
@@ -12,6 +12,9 @@
         <result column="update_report_data_time" property="updateReportDataTime"/>
         <result column="report_status" property="reportStatus"/>
         <result column="report_switch" property="reportSwitch"/>
+
+        <result column="mobile_code" property="mobileCode"/>
+<!--        <result column="danger_check_point_id" property="dangerCheckPointId"/>-->
     </resultMap>
 
 
@@ -19,7 +22,7 @@
 <!--    int insertDangerCheckLog(PreventRiskDangerCheckLog dangerCheck);-->
     <insert id="insertDangerCheckLog">
         insert into prevent_risk_danger_check_log values
-        (null, #{uuid}, #{jobId}, #{checkStatus}, #{checkId}, #{reportTime}, #{updateReportDataTime}, #{reportStatus}, #{reportSwitch})
+        (null, #{uuid}, #{jobId}, #{checkStatus}, #{checkId}, #{reportTime}, #{updateReportDataTime}, #{reportStatus}, #{reportSwitch}, #{mobileCode})
     </insert>
 
 <!--    int deleteDangerCheck(Long checkId);-->
@@ -27,5 +30,74 @@
         delete from prevent_risk_danger_check_log
         where check_id = #{checkId}
     </delete>
+
+
+<!--    List<PreventRiskDangerCheckLog> listReportTask();-->
+    <select id="listReportTask" resultMap="BaseResultMap">
+        select * from prevent_risk_danger_check_log
+        where report_switch = 0 and (update_report_data_time > report_time or report_time is null) and mobile_code is not null
+<!--        where report_switch = 0 and (update_report_data_time > report_time or report_time is null) and mobile_code is not null and job_id = 47-->
+        order by update_report_data_time
+        limit 3
+    </select>
+
+
+<!--    List<PreventRiskDangerCheckLog> listRectifyReportTask();-->
+    <select id="listRectifyReportTask" resultMap="BaseResultMap">
+        select * from prevent_risk_danger_check_log
+        where  job_id in(43,47) and report_time >='2040-05-01 01:01:01'  and mobile_code is not null
+    </select>
+<!--    return preventRiskDangerCheckLogRepository.listSearchRectifyReportTask();-->
+    <select id="listSearchRectifyReportTask" resultMap="BaseResultMap">
+        select * from prevent_risk_danger_check_log
+        where  job_id in(43,47) and report_time is null
+    </select>
+<!--    int updateSearchRectifyReportTask(PreventRiskDangerCheckLog dangerCheckLog);-->
+    <update id="updateSearchRectifyReportTask" >
+        update prevent_risk_danger_check_log set
+             report_time = #{reportTime}
+        where id = #{id}
+    </update>
+
+
+<!--    int updateEventReportStatus(HandlerReportParam handlerReportParam);-->
+    <update id="updateEventReportStatus" >
+        update prevent_risk_danger_check_log set
+            report_status =  #{reportStatus},
+            report_time = #{reportTime}
+        where id = #{id}
+    </update>
+
+<!--    PreventRiskDangerCheckLog getByDangerCheckByCheckId(Long checkId);-->
+    <select id="getByDangerCheckByCheckId" resultMap="BaseResultMap">
+        select * from prevent_risk_danger_check_log
+        where check_id = #{checkId}
+    </select>
+
+    <select id="getByDangerCheckByJobId" resultMap="BaseResultMap">
+        select * from prevent_risk_danger_check_log
+        where job_id = #{jobId}
+    </select>
+
+<!--    PreventRiskDangerCheckLog updateCheckLog(Long checkId, Long mobileCode);-->
+    <update id="updateCheckLog" >
+        update prevent_risk_danger_check_log set
+        mobile_code = #{mobileCode}
+        where check_id = #{checkId}
+    </update>
+
+<!--    int updateTaskReportStatusByList(List<Long> ids, Byte reportStatus, Date reportTime);-->
+    <update id="updateTaskReportStatusByList" >
+        update prevent_risk_danger_check_log set
+        report_status =  #{reportStatus},
+        report_time = #{reportTime}
+        WHERE 1=1 and id in
+        <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </update>
+
 </mapper>
 
+
+

--
Gitblit v1.9.2