From 3041a7d6dba13e237c4f21d3e46b88c35d376bf3 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 08 九月 2023 10:14:47 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/UserMapper.xml | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index e5e092b..e002837 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -16,7 +16,53 @@
<result column="sex" property="sex" />
<result column="create_time" property="createTime" />
<result column="status" property="status" />
+ <result column="target" property="target" />
</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>
+
+ <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