From 34f99d106551b51bf2af3bbd40c64624a3af25eb Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 09 九月 2023 09:43:57 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/UserMapper.xml | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index 4265998..1b95192 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -38,4 +38,30 @@
ORDER BY su.create_time DESC
</select>
+ <select id="getUserByDept" resultMap="BaseResultMap">
+ SELECT
+ *
+ FROM sys_user
+ where 1=1
+ <if test="hostId != null and hostId != ''">
+ and host_id = #{hostId}
+ </if>
+ <if test="deptId != null and deptId != ''">
+ and dept_id = #{deptId}
+ </if>
+ </select>
+
+ <select id="getDeptManager" resultMap="BaseResultMap">
+ SELECT
+ su.*
+ FROM sys_user su
+ left join sys_role sr on su.role_id = sr.id
+ where 1=1
+ <if test="hostId != null and hostId != ''">
+ and su.host_id = #{hostId}
+ </if>
+ and su.dept_id = #{deptId}
+ and sr.code = 'manager'
+ </select>
+
</mapper>
--
Gitblit v1.9.1