用户完善,缺查询用户列表

This commit is contained in:
lhx
2025-11-24 18:07:53 +08:00
parent db1c07d4ac
commit 0f4bd88dc8
14 changed files with 252 additions and 36 deletions

View File

@@ -26,4 +26,41 @@
email,org_id,status,last_login_time,remark,
created_at,updated_at,is_deleted
</sql>
<select id="getUserListBySelf" resultType="com.dc.dc_project.model.vo.UserVo">
SELECT
u.id,
u.username,
p.name as real_name,
p.sex,
u.phone,
p.email,
o.id as org_id,
u.status,
u.last_login_time,
u.remark,
p.id AS personnel_id,
o.name AS org_name
FROM sys_user u
LEFT JOIN sys_personnel_org spo ON u.id = spo.user_id
LEFT JOIN sys_org o ON spo.org_id = o.id
LEFT JOIN sys_personnel p ON u.id = p.user_id
<where>
<if test="userReqDto.name != null">
AND (p.name LIKE CONCAT('%',#{userReqDto.name},'%') OR u.username LIKE CONCAT('%',#{userReqDto.name},'%'))
</if>
<if test="userReqDto.phone != null">
AND u.phone LIKE CONCAT('%',#{userReqDto.phone},'%')
</if>
<if test="userReqDto.email != null">
AND p.email LIKE CONCAT('%',#{userReqDto.email},'%')
</if>
<if test="userReqDto.status != null">
AND u.status = #{userReqDto.status}
</if>
<if test="pOrgId != null">
AND o.id = #{pOrgId}
</if>
and u.is_deleted = 0
</where>
</select>
</mapper>