From bd5ab921857b0871f7b7f5b96408dae7239c13a0 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 02 十一月 2023 13:25:14 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/CstmrMapper.xml |   64 +++++++++++++++-----------------
 1 files changed, 30 insertions(+), 34 deletions(-)

diff --git a/src/main/resources/mapper/CstmrMapper.xml b/src/main/resources/mapper/CstmrMapper.xml
index 75c8584..605cc1f 100644
--- a/src/main/resources/mapper/CstmrMapper.xml
+++ b/src/main/resources/mapper/CstmrMapper.xml
@@ -170,14 +170,11 @@
                 and
                 (
                 <if test="userId != null and userId != ''">
-                    user_id = #{userId}
+                    mc.mp.user_id = #{userId}
+                    or
+                    mc.mp.director = #{userId}
+                    or
                 </if>
-                <if test="userId == null or userId == ''">
-                    user_id is not null
-                </if>
-                or
-                director = #{userId}
-                or
                 mc.id in
                 (
                 select
@@ -240,6 +237,9 @@
                 </if>
             </otherwise>
         </choose>
+        <if test="director != null and director != ''">
+            or mc.director = #{director}
+        </if>
         ORDER BY mc.create_time DESC
     </select>
 
@@ -256,7 +256,7 @@
                 (CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId})
                 or
                 (
-                user_id = #{userId}
+                mc.user_id = #{userId}
                 or
                 mc.id in
                 (
@@ -273,14 +273,11 @@
                 and
                 (
                 <if test="userId != null and userId != ''">
-                    user_id = #{userId}
+                    mc.mp.user_id = #{userId}
+                    or
+                    mc.mp.director = #{userId}
+                    or
                 </if>
-                <if test="userId == null or userId == ''">
-                    user_id is not null
-                </if>
-                or
-                director = #{userId}
-                or
                 mc.id in
                 (
                 select
@@ -343,6 +340,9 @@
                 </if>
             </otherwise>
         </choose>
+        <if test="director != null and director != ''">
+            or mc.director = #{director}
+        </if>
         ORDER BY mc.create_time DESC
     </select>
 
@@ -445,14 +445,11 @@
                 and
                 (
                 <if test="userId != null and userId != ''">
-                    user_id = #{userId}
+                    mc.mp.user_id = #{userId}
+                    or
+                    mc.mp.director = #{userId}
+                    or
                 </if>
-                <if test="userId == null or userId == ''">
-                    user_id is not null
-                </if>
-                or
-                director = #{userId}
-                or
                 mc.id in
                 (
                 select
@@ -521,12 +518,13 @@
                 </if>
             </otherwise>
         </choose>
-
-
+        <if test="director != null and director != ''">
+            or mc.director = #{director}
+        </if>
         ORDER BY mc.create_time DESC
     </select>
 
-    <select id="listByPage3" resultMap="BaseResultMap">
+    <select id="listByPage33" resultMap="BaseResultMap">
         SELECT
         mc.*
         FROM man_cstmr mc
@@ -556,14 +554,11 @@
                 and
                 (
                 <if test="userId != null and userId != ''">
-                    user_id = #{userId}
+                    mc.mp.user_id = #{userId}
+                    or
+                    mc.mp.director = #{userId}
+                    or
                 </if>
-                <if test="userId == null or userId == ''">
-                    user_id is not null
-                </if>
-                or
-                director = #{userId}
-                or
                 mc.id in
                 (
                 select
@@ -632,8 +627,9 @@
                 </if>
             </otherwise>
         </choose>
-
-
+        <if test="director != null and director != ''">
+            or mc.director = #{director}
+        </if>
         ORDER BY mc.create_time DESC
     </select>
 

--
Gitblit v1.9.1