From bb5bf872de5e67d7b406e3a305c9dfcbd0f218a6 Mon Sep 17 00:00:00 2001 From: liding <756868258@qq.com> Date: 星期四, 26 六月 2025 18:03:55 +0800 Subject: [PATCH] 采购,正式库优化 --- ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 5b2a7f2..8cbe2d3 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -79,7 +79,7 @@ AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') </if> <if test="deptId != null and deptId != 0"> - 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 (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE #{deptId} = ANY(string_to_array(t.ancestors, ',')::bigint[]) )) </if> <!-- 鏁版嵁鑼冨洿杩囨护 --> ${params.dataScope} @@ -141,8 +141,25 @@ <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 </select> - - <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> + <select id="selectUserListAll" resultType="com.ruoyi.common.core.domain.entity.SysUser"> + select user_id, nick_name from sys_user where del_flag = '0' + </select> + <select id="selectList" resultType="com.ruoyi.common.core.domain.entity.SysUser"> + SELECT user_id, nick_name FROM sys_user + <where> + <if test="list != null and list.size() > 0"> + user_id IN + <foreach item="id" collection="list" open="(" separator="," close=")"> + #{id} + </foreach> + </if> + <if test="list == null or list.size() == 0"> + 1=0 <!-- 绌哄垪琛ㄦ椂杩斿洖绌虹粨鏋� --> + </if> + </where> + </select> + + <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> insert into sys_user( <if test="userId != null and userId != 0">user_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if> @@ -170,7 +187,7 @@ <if test="status != null and status != ''">#{status},</if> <if test="createBy != null and createBy != ''">#{createBy},</if> <if test="remark != null and remark != ''">#{remark},</if> - sysdate() + now() ) </insert> @@ -189,7 +206,7 @@ <if test="loginDate != null">login_date = #{loginDate},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="remark != null">remark = #{remark},</if> - update_time = sysdate() + update_time = now() </set> where user_id = #{userId} </update> -- Gitblit v1.9.3