|  |  | 
 |  |  |         <result property="idCard" column="id_card"/> | 
 |  |  |         <result property="createTime" column="create_time"/> | 
 |  |  |         <result property="updateBy" column="update_by"/> | 
 |  |  |         <result property="deptCode" column="dept_code"/> | 
 |  |  |         <result property="deptName" column="dept_name"/> | 
 |  |  |         <result property="title" column="title"/> | 
 |  |  |         <result property="birthday" column="birthday"/> | 
 |  |  |         <result property="jobPhone" column="job_phone"/> | 
 |  |  | 
 |  |  |                u.user_name, | 
 |  |  |                u.user_type, | 
 |  |  |                u.nick_name, | 
 |  |  |                u.dept_code, | 
 |  |  |                u.dept_name, | 
 |  |  |                u.title, | 
 |  |  |                u.his_user_id, | 
 |  |  |                u.job_phone, | 
 |  |  | 
 |  |  |         u.nick_name, u.user_name, | 
 |  |  |         u.email,u.id_card, | 
 |  |  |         u.avatar, | 
 |  |  |         u.dept_name, | 
 |  |  |         u.dept_code, | 
 |  |  |         u.birthday, | 
 |  |  |         u.job_phone, | 
 |  |  |         u.phonenumber, u.sex, u.status, | 
 |  |  |         u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user | 
 |  |  |         u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name from sys_user | 
 |  |  |         u | 
 |  |  |         left join sys_dept d on u.dept_id = d.dept_id | 
 |  |  |         left join sys_user_dept d on u.user_id = d.user_id | 
 |  |  |         where u.del_flag = '0' | 
 |  |  |         <if test="userId != null and userId != 0"> | 
 |  |  |         <if test="userId != null"> | 
 |  |  |             AND u.user_id = #{userId} | 
 |  |  |         </if> | 
 |  |  |         <if test="orgid != null and orgid != ''"> | 
 |  |  |             AND u.orgid = #{orgid} | 
 |  |  |         </if> | 
 |  |  |         <if test="userName != null and userName != ''"> | 
 |  |  |             AND u.user_name like concat('%', #{userName}, '%') | 
 |  |  | 
 |  |  |         <if test="birthday != null and birthday != ''"> | 
 |  |  |             AND u.birthday = #{birthday} | 
 |  |  |         </if> | 
 |  |  |         <if test="deptName != null and deptName != ''"> | 
 |  |  |             AND u.dept_name = #{deptName} | 
 |  |  |         </if> | 
 |  |  |         <if test="deptCode != null and deptCode != ''"> | 
 |  |  |             AND u.dept_code = #{deptCode} | 
 |  |  |         </if> | 
 |  |  |         <if test="hisUserId != null and hisUserId != ''"> | 
 |  |  |             AND u.his_user_id = #{hisUserId} | 
 |  |  |         </if> | 
 |  |  | 
 |  |  |         <!-- 数据范围过滤 --> | 
 |  |  |         ${params.dataScope} | 
 |  |  |     </select> | 
 |  |  |     <select id="getUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult"> | 
 |  |  |         select u.user_id,u.title,u.his_user_id,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_type, | 
 |  |  |         u.nick_name, u.user_name, | 
 |  |  |         u.email,u.id_card, | 
 |  |  |         u.avatar, | 
 |  |  |         u.dept_name, | 
 |  |  |         u.dept_code, | 
 |  |  |         u.birthday, | 
 |  |  |         u.job_phone, | 
 |  |  |         u.phonenumber, u.sex, u.status, | 
 |  |  |         u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u | 
 |  |  |         where u.del_flag = '0' | 
 |  |  |         <if test="userId != null"> | 
 |  |  |             AND u.user_id = #{userId} | 
 |  |  |         </if> | 
 |  |  |         <if test="orgid != null and orgid != ''"> | 
 |  |  |             AND u.orgid = #{orgid} | 
 |  |  |         </if> | 
 |  |  |         <if test="userName != null and userName != ''"> | 
 |  |  |             AND u.user_name like concat('%', #{userName}, '%') | 
 |  |  |         </if> | 
 |  |  |         <if test="nickName != null and nickName != ''"> | 
 |  |  |             AND u.nick_name like concat('%', #{nickName}, '%') | 
 |  |  |         </if> | 
 |  |  |         <if test="status != null and status != ''"> | 
 |  |  |             AND u.status = #{status} | 
 |  |  |         </if> | 
 |  |  |         <if test="idCard != null and idCard != ''"> | 
 |  |  |             AND u.id_card = #{idCard} | 
 |  |  |         </if> | 
 |  |  |         <if test="title != null and title != ''"> | 
 |  |  |             AND u.title = #{title} | 
 |  |  |         </if> | 
 |  |  |         <if test="jobPhone != null and jobPhone != ''"> | 
 |  |  |             AND u.job_phone = #{jobPhone} | 
 |  |  |         </if> | 
 |  |  |         <if test="birthday != null and birthday != ''"> | 
 |  |  |             AND u.birthday = #{birthday} | 
 |  |  |         </if> | 
 |  |  |         <if test="deptName != null and deptName != ''"> | 
 |  |  |             AND u.dept_name = #{deptName} | 
 |  |  |         </if> | 
 |  |  |         <if test="deptCode != null and deptCode != ''"> | 
 |  |  |             AND u.dept_code = #{deptCode} | 
 |  |  |         </if> | 
 |  |  |         <if test="hisUserId != null and hisUserId != ''"> | 
 |  |  |             AND u.his_user_id = #{hisUserId} | 
 |  |  |         </if> | 
 |  |  |         <if test="phonenumber != null and phonenumber != ''"> | 
 |  |  |             AND u.phonenumber like concat('%', #{phonenumber}, '%') | 
 |  |  |         </if> | 
 |  |  |         <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | 
 |  |  |             AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | 
 |  |  |         </if> | 
 |  |  |         <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | 
 |  |  |             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) )) | 
 |  |  |         </if> | 
 |  |  |         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" | 
 |  |  |             resultMap="SysUserResult"> | 
 |  |  | 
 |  |  |         u.user_type, | 
 |  |  |         u.nick_name, | 
 |  |  |         u.email, | 
 |  |  |         u.dept_code, | 
 |  |  |         u.dept_name, | 
 |  |  |         u.birthday, | 
 |  |  |         u.job_phone, | 
 |  |  |         u.phonenumber, u.status,u.id_card, | 
 |  |  | 
 |  |  |         u.email, | 
 |  |  |         u.his_user_id, | 
 |  |  |         u.title, | 
 |  |  |         u.dept_code, | 
 |  |  |         u.dept_name, | 
 |  |  |         u.job_phone, | 
 |  |  |         u.birthday, | 
 |  |  |         u.phonenumber, u.status,u.id_card, | 
 |  |  | 
 |  |  |         <if test="birthday != null ">birthday,</if> | 
 |  |  |         <if test="hisUserId != null and hisUserId != ''">his_user_id,</if> | 
 |  |  |         <if test="orgid != null and orgid != ''">orgid,</if> | 
 |  |  |         <if test="deptCode != null and deptCode != ''">dept_code,</if> | 
 |  |  |         <if test="deptName != null and deptName != ''">dept_name,</if> | 
 |  |  |         create_time | 
 |  |  |         )values( | 
 |  |  |         <if test="userId != null and userId != ''">#{userId},</if> | 
 |  |  | 
 |  |  |         <if test="birthday != null and birthday != ''">#{birthday},</if> | 
 |  |  |         <if test="hisUserId != null and hisUserId != ''">#{hisUserId},</if> | 
 |  |  |         <if test="orgid != null and orgid != ''">#{orgid},</if> | 
 |  |  |         <if test="deptCode != null and deptCode != ''">#{deptCode},</if> | 
 |  |  |         <if test="deptName != null and deptName != ''">#{deptName},</if> | 
 |  |  |         sysdate() | 
 |  |  |         ) | 
 |  |  |     </insert> | 
 |  |  | 
 |  |  |             <if test="hisUserId != null and hisUserId != ''"> | 
 |  |  |                 his_user_id = #{hisUserId}, | 
 |  |  |             </if> | 
 |  |  |             <if test="deptCode != null and deptCode != ''">dept_code=#{deptCode},</if> | 
 |  |  |             <if test="deptName != null and deptName != ''">dept_name=#{deptName},</if> | 
 |  |  |             update_time = sysdate() | 
 |  |  |         </set> | 
 |  |  |         where user_id = #{userId} | 
 |  |  | 
 |  |  |  | 
 |  |  |     <delete id="deleteUserById" parameterType="Long"> | 
 |  |  |         update sys_user | 
 |  |  |         set del_flag = '2' | 
 |  |  |         set del_flag = '1' | 
 |  |  |         where user_id = #{userId} | 
 |  |  |     </delete> | 
 |  |  |  | 
 |  |  |     <delete id="deleteUserByIds" parameterType="Long"> | 
 |  |  |         update sys_user set del_flag = '2' where user_id in | 
 |  |  |         update sys_user set del_flag = '1' where user_id in | 
 |  |  |         <foreach collection="array" item="userId" open="(" separator="," close=")"> | 
 |  |  |             #{userId} | 
 |  |  |         </foreach> |