2020-02-13 10:48:51 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper
|
2021-04-12 17:02:55 +08:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2023-03-31 18:39:10 +08:00
|
|
|
<mapper namespace="org.dromara.system.mapper.SysUserMapper">
|
2020-02-13 10:48:51 +08:00
|
|
|
|
2023-03-31 18:39:10 +08:00
|
|
|
<resultMap type="org.dromara.system.domain.vo.SysUserVo" id="SysUserResult">
|
2021-04-12 17:02:55 +08:00
|
|
|
<id property="userId" column="user_id"/>
|
|
|
|
</resultMap>
|
2024-01-06 20:47:05 +08:00
|
|
|
<resultMap type="org.dromara.system.domain.vo.SysUserExportVo" id="SysUserExportResult">
|
|
|
|
<id property="userId" column="user_id"/>
|
2021-04-12 17:02:55 +08:00
|
|
|
</resultMap>
|
|
|
|
|
2022-03-04 13:42:08 +08:00
|
|
|
<select id="selectPageUserList" resultMap="SysUserResult">
|
2024-02-01 12:20:00 +08:00
|
|
|
select
|
|
|
|
<if test="ew.getSqlSelect != null">
|
|
|
|
${ew.getSqlSelect}
|
|
|
|
</if>
|
|
|
|
<if test="ew.getSqlSelect == null">
|
|
|
|
u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
|
|
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
|
|
|
|
</if>
|
2023-01-30 18:08:53 +08:00
|
|
|
from sys_user u
|
2022-03-04 11:45:38 +08:00
|
|
|
${ew.getCustomSqlSegment}
|
2021-05-13 21:25:51 +08:00
|
|
|
</select>
|
|
|
|
|
2024-01-31 23:24:51 +08:00
|
|
|
<select id="selectUserList" resultMap="SysUserResult">
|
2024-02-01 12:20:00 +08:00
|
|
|
select
|
|
|
|
<if test="ew.getSqlSelect != null">
|
|
|
|
${ew.getSqlSelect}
|
|
|
|
</if>
|
|
|
|
<if test="ew.getSqlSelect == null">
|
|
|
|
u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
|
|
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
|
|
|
|
</if>
|
|
|
|
from sys_user u
|
2024-01-31 23:24:51 +08:00
|
|
|
${ew.getCustomSqlSegment}
|
|
|
|
</select>
|
|
|
|
|
2024-01-06 20:47:05 +08:00
|
|
|
<select id="selectUserExportList" resultMap="SysUserExportResult">
|
2022-05-28 22:30:06 +08:00
|
|
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
2023-08-09 12:06:05 +08:00
|
|
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
|
|
|
d.dept_name, d.leader, u1.user_name as leaderName
|
2023-01-30 18:08:53 +08:00
|
|
|
from sys_user u
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
2023-08-09 12:06:05 +08:00
|
|
|
left join sys_user u1 on u1.user_id = d.leader
|
2022-03-04 11:45:38 +08:00
|
|
|
${ew.getCustomSqlSegment}
|
2021-04-12 17:02:55 +08:00
|
|
|
</select>
|
|
|
|
|
2022-03-04 13:42:08 +08:00
|
|
|
<select id="selectAllocatedList" resultMap="SysUserResult">
|
2021-07-06 12:01:05 +08:00
|
|
|
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
|
|
|
from sys_user u
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
2022-06-01 13:06:42 +08:00
|
|
|
left join sys_user_role sur on u.user_id = sur.user_id
|
|
|
|
left join sys_role r on r.role_id = sur.role_id
|
2022-03-04 11:45:38 +08:00
|
|
|
${ew.getCustomSqlSegment}
|
2021-07-06 12:01:05 +08:00
|
|
|
</select>
|
|
|
|
|
2022-03-04 13:42:08 +08:00
|
|
|
<select id="selectUnallocatedList" resultMap="SysUserResult">
|
2021-07-06 12:01:05 +08:00
|
|
|
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
|
|
|
from sys_user u
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
2022-06-01 13:06:42 +08:00
|
|
|
left join sys_user_role sur on u.user_id = sur.user_id
|
|
|
|
left join sys_role r on r.role_id = sur.role_id
|
2022-03-04 11:45:38 +08:00
|
|
|
${ew.getCustomSqlSegment}
|
2021-07-06 12:01:05 +08:00
|
|
|
</select>
|
|
|
|
|
2023-12-26 00:46:34 +08:00
|
|
|
<select id="countUserById" resultType="Long">
|
|
|
|
select count(*) from sys_user where del_flag = '0' and user_id = #{userId}
|
2021-04-12 17:02:55 +08:00
|
|
|
</select>
|
|
|
|
|
2025-06-19 09:30:09 +08:00
|
|
|
<select id="selectUserIdsByType" resultType="java.lang.Long">
|
|
|
|
select user_id
|
|
|
|
from sys_user
|
|
|
|
where user_type = #{userType}
|
|
|
|
and del_flag = '0'
|
|
|
|
and status = '0'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectAllUserIds" resultType="java.lang.Long">
|
|
|
|
select user_id
|
|
|
|
from sys_user
|
|
|
|
where del_flag = '0'
|
|
|
|
and status = '0'
|
|
|
|
</select>
|
2021-04-12 17:02:55 +08:00
|
|
|
|
2021-05-29 18:41:32 +08:00
|
|
|
</mapper>
|