From a77bf9fb4718d1b657f8ef8c6edfaffa1a53683f Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 06 二月 2026 17:01:20 +0800
Subject: [PATCH] 处理数据查询慢的问题

---
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml |   89 +++++++++++++++++++++++++++++---------------
 1 files changed, 58 insertions(+), 31 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
index 26e3ff8..05b062e 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
@@ -19,6 +19,7 @@
         <result property="updateBy" column="update_by"/>
         <result property="sort" column="sort"/>
         <result property="compensateTime" column="compensate_time"/>
+        <result property="currentSendTime" column="current_send_time"/>
     </resultMap>
 
     <sql id="selectServiceSubtaskPreachformVo">
@@ -27,6 +28,7 @@
                taskid,
                preachform,
                sendstate,
+               current_send_time,
                remark,
                orgid,
                del_flag,
@@ -42,30 +44,32 @@
     <select id="selectServiceSubtaskPreachformList" parameterType="com.smartor.domain.ServiceSubtaskPreachform"
             resultMap="ServiceSubtaskPreachformResult">
         <include refid="selectServiceSubtaskPreachformVo"/>
-        <where>
-            del_flag=0
-            <if test="subid != null ">
-                and subid = #{subid}
-            </if>
-            <if test="taskid != null ">
-                and taskid = #{taskid}
-            </if>
-            <if test="preachform != null  and preachform != ''">
-                and preachform = #{preachform}
-            </if>
-            <if test="sendstate != null  and sendstate != ''">
-                and sendstate = #{sendstate}
-            </if>
-            <if test="orgid != null  and orgid != ''">
-                and orgid = #{orgid}
-            </if>
-            <if test="sort != null ">
-                and sort = #{sort}
-            </if>
-            <if test="compensateTime != null ">
-                and compensate_time = #{compensateTime}
-            </if>
-        </where>
+        where 1=1
+        and del_flag = 0
+        <if test="subid != null ">
+            and subid = #{subid}
+        </if>
+        <if test="taskid != null ">
+            and taskid = #{taskid}
+        </if>
+        <if test="currentSendTime != null ">
+            and current_send_time = #{currentSendTime}
+        </if>
+        <if test="preachform != null  and preachform != ''">
+            and preachform = #{preachform}
+        </if>
+        <if test="sendstate != null  and sendstate != ''">
+            and sendstate = #{sendstate}
+        </if>
+        <if test="orgid != null  and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="sort != null ">
+            and sort = #{sort}
+        </if>
+        <if test="compensateTime != null ">
+            and compensate_time = #{compensateTime}
+        </if>
     </select>
 
     <select id="selectServiceSubtaskPreachformById" parameterType="Long"
@@ -107,6 +111,9 @@
             </if>
             <if test="compensateTime != null">compensate_time,
             </if>
+            <if test="currentSendTime != null ">
+                current_send_time,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},
@@ -136,6 +143,9 @@
             <if test="sort != null">#{sort},
             </if>
             <if test="compensateTime != null">#{compensateTime},
+            </if>
+            <if test="currentSendTime != null ">
+                #{currentSendTime},
             </if>
         </trim>
     </insert>
@@ -181,6 +191,9 @@
             </if>
             <if test="compensateTime != null">compensate_time =
                 #{compensateTime},
+            </if>
+            <if test="currentSendTime != null ">
+                current_send_time = #{currentSendTime},
             </if>
         </trim>
         where id = #{id}
@@ -228,24 +241,26 @@
             <if test="compensateTime != null">compensate_time =
                 #{compensateTime},
             </if>
+            <if test="currentSendTime != null ">
+                current_send_time = #{currentSendTime},
+            </if>
         </trim>
-        <where>
-            <if test="subid != null">subid =
+        where 1=1
+            <if test="subid != null">and subid =
                 #{subid},
             </if>
-            <if test="taskid != null">taskid =
+            <if test="taskid != null">and taskid =
                 #{taskid},
             </if>
-            <if test="preachform != null">preachform =
+            <if test="preachform != null">and preachform =
                 #{preachform},
             </if>
-            <if test="remark != null">remark =
+            <if test="remark != null">and remark =
                 #{remark},
             </if>
-            <if test="orgid != null">orgid =
+            <if test="orgid != null">and orgid =
                 #{orgid},
             </if>
-        </where>
     </update>
 
 
@@ -276,5 +291,17 @@
         </foreach>
     </update>
 
+    <select id="selectBySubtask" parameterType="com.smartor.domain.ServiceSubtask"
+            resultMap="ServiceSubtaskPreachformResult">
+        <include refid="selectServiceSubtaskPreachformVo"/>
+        WHERE del_flag = 0
+        <!-- 鍏朵粬鏉′欢 -->
+        <if test="taskid != null">
+            AND taskid = #{taskid}
+        </if>
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
+    </select>
 
 </mapper>

--
Gitblit v1.9.3