You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.8 KiB
91 lines
2.8 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.elink.esua.epdc.dao.SysUserDao">
|
|
|
|
<select id="getList" resultType="com.elink.esua.epdc.entity.SysUserEntity">
|
|
select t1.*, (select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1
|
|
where t1.del_flag = 0 and t1.super_admin = 0
|
|
<if test="username != null and username.trim() != ''">
|
|
and t1.username like #{username}
|
|
</if>
|
|
<if test="deptIdList != null">
|
|
and t1.dept_id in
|
|
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getById" resultType="com.elink.esua.epdc.entity.SysUserEntity">
|
|
select
|
|
t1.id,
|
|
t1.username,
|
|
t1.real_name,
|
|
t1.head_url,
|
|
t1.gender,
|
|
t1.email,
|
|
t1.mobile,
|
|
t1.dept_id,
|
|
t1.super_admin,
|
|
t1.status,
|
|
t1.remark,
|
|
t1.del_flag,
|
|
t1.creator,
|
|
t1.create_date,
|
|
t1.updater,
|
|
t1.update_date,
|
|
t1.user_tag_key,
|
|
(select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1
|
|
where t1.id = #{value} and t1.del_flag = 0
|
|
</select>
|
|
|
|
<select id="getByUsername" resultType="com.elink.esua.epdc.entity.SysUserEntity">
|
|
SELECT
|
|
d.`name` AS deptName,u.*
|
|
FROM
|
|
sys_user u
|
|
LEFT JOIN sys_dept d ON u.dept_id = d.id
|
|
WHERE
|
|
u.username = #{value} AND u.del_flag = 0
|
|
</select>
|
|
|
|
<update id="updatePassword">
|
|
update sys_user set password = #{newPassword} where id = #{id}
|
|
</update>
|
|
|
|
<select id="getCountByDeptId" resultType="int">
|
|
select count(*) from sys_user where dept_id = #{value} and del_flag = 0
|
|
</select>
|
|
|
|
|
|
<select id="selectListLeaderGridId" resultType="java.lang.String">
|
|
SELECT
|
|
d.id gridId
|
|
FROM
|
|
sys_user u
|
|
LEFT JOIN sys_role_user ru ON u.id = ru.user_id
|
|
LEFT JOIN sys_role r ON ru.role_id = r.id
|
|
LEFT JOIN sys_role_data_scope rds ON rds.role_id = r.id
|
|
LEFT JOIN sys_dept d ON d.id = rds.dept_id
|
|
WHERE
|
|
d.type_key = 'grid_party'
|
|
AND r.type_key = 'gridLeader'
|
|
AND u.mobile = #{mobile}
|
|
AND u.del_flag = 0
|
|
ORDER BY
|
|
d.create_date DESC
|
|
</select>
|
|
|
|
<select id="selectListOfUserIdsByDeptId" resultType="long">
|
|
SELECT
|
|
ID
|
|
FROM
|
|
sys_user
|
|
WHERE
|
|
del_flag = '0'
|
|
AND `status` = 1
|
|
AND dept_id = #{deptId}
|
|
</select>
|
|
|
|
</mapper>
|
|
|