| | |
| | | |
| | | <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 |
| | |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectList" resultType="com.ruoyi.project.system.domain.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> |
| | | <select id="selectUsersByIds" resultType="com.ruoyi.project.system.domain.SysUser"> |
| | | SELECT user_id, nick_name |
| | | FROM sys_user |
| | | WHERE user_id IN |
| | | <foreach collection="userIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="com.ruoyi.project.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |