From 3e11f3d28421cf9401bb42e68ed49e118e0ce5dc Mon Sep 17 00:00:00 2001 From: ZQN <364596817@qq.com> Date: 星期一, 24 六月 2024 16:40:08 +0800 Subject: [PATCH] 用户导入 --- project-system/src/main/resources/mapper/system/SysUserMapper.xml | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/project-system/src/main/resources/mapper/system/SysUserMapper.xml b/project-system/src/main/resources/mapper/system/SysUserMapper.xml index 7280b60..42e47cc 100644 --- a/project-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/project-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -92,7 +92,9 @@ AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) </if> <!-- 鏁版嵁鑼冨洿杩囨护 --> - ${params.dataScope} + <if test="params != null and params.dataScope != null and params.dataScope != ''"> + AND ${params.dataScope} + </if> </select> <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> @@ -109,7 +111,9 @@ AND u.phonenumber like concat('%', #{phonenumber}, '%') </if> <!-- 鏁版嵁鑼冨洿杩囨护 --> - ${params.dataScope} + <if test="params != null and params.dataScope != null and params.dataScope != ''"> + AND ${params.dataScope} + </if> </select> <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> @@ -127,7 +131,9 @@ AND u.phonenumber like concat('%', #{phonenumber}, '%') </if> <!-- 鏁版嵁鑼冨洿杩囨护 --> - ${params.dataScope} + <if test="params != null and params.dataScope != null and params.dataScope != ''"> + AND ${params.dataScope} + </if> </select> <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> @@ -223,6 +229,10 @@ update sys_user set password = #{password}, recommend_user = #{recommendUser} where user_name = #{userName} </update> + <update id="resetPhone" parameterType="SysUser"> + update sys_user set phonenumber = #{phone}, user_name = #{phone} where user_id = #{userId} + </update> + <delete id="deleteUserById" parameterType="Long"> update sys_user set del_flag = '1' where user_id = #{userId} </delete> @@ -239,11 +249,13 @@ select u.phonenumber from sys_user u join sys_user_role ur on u.user_id = ur.user_id - join sys_role r on r.role_id=ur.role_id + join sys_role r on r.role_id = ur.role_id + join sys_user_dept ud on u.user_id = ud.user_id where - u.user_type = '01' + u.user_type != '02' + and u.status='0' and r.role_key = #{roleKey} - and (u.dept_id = #{deptId} or u.dept_id in (SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors))) + and ud.dept_id = #{deptId} </select> </mapper> -- Gitblit v1.9.1