| | |
| | | |
| | | <select id="selectUserList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,T2.dept_names from sys_user u |
| | | left join |
| | | inner join |
| | | ( SELECT T1.user_id,GROUP_CONCAT(T2.dept_name SEPARATOR ', ') AS dept_names |
| | | FROM |
| | | sys_user_dept T1 |
| | |
| | | <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="params.deptId != null"> |
| | | <if test="deptId != null"> |
| | | AND u.user_id IN |
| | | ( |
| | | SELECT user_id FROM sys_user_dept WHERE dept_id = #{deptId} |
| | |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectList" resultType="com.ruoyi.project.system.domain.SysUser"> |
| | | <select id="selectRegistrantIds" resultType="com.ruoyi.project.system.domain.SysUser"> |
| | | SELECT user_id, nick_name FROM sys_user |
| | | <where> |
| | | <if test="list != null and list.size() > 0"> |
| | |
| | | <insert id="insertUser" parameterType="com.ruoyi.project.system.domain.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> |
| | | <if test="userName != null and userName != ''">user_name,</if> |
| | | <if test="nickName != null and nickName != ''">nick_name,</if> |
| | | <if test="email != null and email != ''">email,</if> |
| | |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | | <if test="deptId != null and deptId != ''">#{deptId},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | <if test="nickName != null and nickName != ''">#{nickName},</if> |
| | | <if test="email != null and email != ''">#{email},</if> |