| | |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="selectUserByIds" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select user_id AS userId, dept_id AS deptId, user_name AS userName, nick_name AS nickName, email AS email, avatar AS avatar, phonenumber AS phonenumber |
| | | select user_id AS userId, dept_id AS deptId, user_name AS userName, nick_name AS nickName, |
| | | email AS email, avatar AS avatar, phonenumber AS phonenumber,create_time AS createTime |
| | | from sys_user where user_id in |
| | | <foreach collection="userIds" separator="," item="userId" open="(" close=")"> |
| | | #{userId} |
| | |
| | | AND u.nick_name LIKE concat('%',#{nickName},'%') |
| | | </if> |
| | | </select> |
| | | <select id="selectOldList" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark |
| | | from sys_user u where user_id < 0 and u.status = 0 and u.del_flag = 0 order by user_id desc |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | |
| | | <if test="ifBlack != null">ifBlack,</if> |
| | | <if test="districtId != null">districtId,</if> |
| | | <if test="roleType != null">role_type,</if> |
| | | <if test="userIdentification != null and userIdentification != ''">userIdentification,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="ifBlack != null">#{ifBlack},</if> |
| | | <if test="districtId != null">#{districtId},</if> |
| | | <if test="roleType != null">#{roleType},</if> |
| | | <if test="userIdentification != null and userIdentification != ''">#{userIdentification},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <update id="editSignPicture" parameterType="SysUser"> |
| | | update sys_user set sign_picture = #{signPicture} where user_id = #{userId} |
| | | </update> |
| | | <update id="updateUserInherit"> |
| | | update sys_user |
| | | <set> |
| | | <if test="parentId != null">parentId = #{parentId},</if> |
| | | <if test="parentAccount != null and parentAccount != ''">parentAccount = #{parentAccount},</if> |
| | | <if test="userId != null">user_id = #{userId},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where userIdentification = #{userIdentification} |
| | | </update> |
| | | |
| | | <delete id="deleteUserById" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id = #{userId} |
| | |
| | | #{userId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteUserByOldUserId"> |
| | | delete from sys_user where user_id = #{oldUserId} |
| | | </delete> |
| | | |
| | | </mapper> |