From 3be9948bd0756e545d27f3b69456f1840fd9febb Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 16 九月 2022 09:08:30 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/UserMapper.xml |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index e5e092b..4265998 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -19,4 +19,23 @@
 
     </resultMap>
 
+    <select id="listByPage" resultMap="BaseResultMap">
+        SELECT
+        su.*
+        FROM sys_user su
+        LEFT JOIN sys_dept sd ON su.dept_id = sd.id
+        WHERE 1=1
+        AND (CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId})
+        <if test="hostId != null and hostId != ''">
+            and su.host_id = #{hostId}
+        </if>
+        <if test="username != null and username != ''">
+            and su.username like concat('%',#{username},'%')
+        </if>
+        <if test="mobile != null and mobile != ''">
+            and su.mobile like concat('%',#{mobile},'%')
+        </if>
+        ORDER BY su.create_time DESC
+    </select>
+
 </mapper>

--
Gitblit v1.9.1