From 51a551a7f8eae7654f973d45cd2fa2952774673d Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Fri, 07 Aug 2026 10:56:55 +0800
Subject: [PATCH] perf(task): 优化巡查任务审核性能并添加详细日志记录

---
 drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdDeviceCallMapper.xml |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdDeviceCallMapper.xml b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdDeviceCallMapper.xml
index 45784e3..adafa74 100644
--- a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdDeviceCallMapper.xml
+++ b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdDeviceCallMapper.xml
@@ -6,7 +6,9 @@
     <resultMap id="gdDeviceCallResultMap" type="org.sxkj.gd.workorder.entity.GdDeviceCallEntity">
         <result column="id" property="id"/>
         <result column="patrol_task_name" property="patrolTaskName"/>
+        <result column="task_department_id" property="taskDepartmentId"/>
         <result column="task_department" property="taskDepartment"/>
+        <result column="task_initiator_id" property="taskInitiatorId"/>
         <result column="task_initiator" property="taskInitiator"/>
         <result column="flight_duration" property="flightDuration"/>
         <result column="flight_distance" property="flightDistance"/>
@@ -25,7 +27,20 @@
 
 
     <select id="selectGdDeviceCallPage" resultMap="gdDeviceCallResultMap">
-        select * from ja_gd_device_call where is_deleted = 0
+        select * from ja_gd_device_call
+        <where>
+            is_deleted = 0
+            <if test="param2.patrolTaskName != null and param2.patrolTaskName != ''">
+                and patrol_task_name like concat('%',#{param2.patrolTaskName},'%')
+            </if>
+            <if test="param2.deviceId != null">
+                and device_id = #{param2.deviceId}
+            </if>
+            <if test="param2.taskInitiatorId != null and param2.taskInitiatorId != ''">
+                and task_initiator_id = #{param2.taskInitiatorId}
+            </if>
+            order by create_time desc
+        </where>
     </select>
 
 

--
Gitblit v1.9.3