From 1b09f886a2c8dc47c4945dace5bd649a7b4ef0ad Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 09 七月 2025 17:15:01 +0800
Subject: [PATCH] bug修改

---
 ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
index 8778255..8bb2557 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
@@ -159,7 +159,7 @@
         left join sys_user t2 on t1.user_id = t2.user_id
         left join t_template t3 on t1.template_id = t3.id
         where 1=1
-        and t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
+        and t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} and t3.id is not null
         <if test="query.templateIds != null and query.templateIds.size()>0">
             AND t1.template_id IN
             <foreach collection="query.templateIds" separator="," item="id" open="(" close=")">
@@ -171,6 +171,12 @@
             <foreach collection="query.patrolInspectorIds" separator="," item="id" open="(" close=")">
                 #{id}
             </foreach>
+        </if>
+        <if test="query.templateName != null and query.templateName != ''">
+            AND t3.template_name like concat('%',#{query.templateName},'%')
+        </if>
+        <if test="query.nickName != null and query.nickName != ''">
+            AND t2.nick_name like concat('%',#{query.nickName},'%')
         </if>
 
         group by t1.user_id,t1.template_id
@@ -183,7 +189,7 @@
         left join sys_user t2 on t1.user_id = t2.user_id
         left join t_template t3 on t1.template_id = t3.id
         where 1=1
-        and t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
+        and t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} and t3.id is not null
         <if test="query.templateIds != null and query.templateIds.size()>0">
             AND t1.template_id IN
             <foreach collection="query.templateIds" separator="," item="id" open="(" close=")">
@@ -196,6 +202,12 @@
                 #{id}
             </foreach>
         </if>
+        <if test="query.templateName != null and query.templateName != ''">
+            AND t3.template_name like concat('%',#{query.templateName},'%')
+        </if>
+        <if test="query.nickName != null and query.nickName != ''">
+            AND t2.nick_name like concat('%',#{query.nickName},'%')
+        </if>
 
         group by t1.user_id,t1.template_id
     </select>

--
Gitblit v1.7.1