| | |
| | | <result property="remark" column="remark" /> |
| | | <result property="roleType" column="roleType" /> |
| | | <result property="objectId" column="objectId" /> |
| | | <result property="userType" column="user_type"/> |
| | | <association property="dept" column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status ,u.roleType as roleType,u.objectId AS objectId |
| | | r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | r.data_scope, |
| | | r.status as role_status, |
| | | u.roleType as roleType, |
| | | u.objectId AS objectId, |
| | | u.user_type |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | </select> |
| | | |
| | | <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 |
| | | select user_id, phonenumber |
| | | from sys_user |
| | | where phonenumber = #{phonenumber} |
| | | and del_flag = '0' |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="getList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select *,nick_name nickName,login_date loginDate,create_time createTime,user_id userId from sys_user where 1=1 |
| | | select su.user_id userId,su.nick_name nickName,su.phonenumber,su.status,sr.role_name |
| | | roleName,sr.role_id roleId,case su.user_type when '01' then 2 |
| | | else 1 end as isAuctioneer |
| | | from |
| | | sys_user su left join sys_user_role sur on su.user_id = sur.user_id left join sys_role sr on |
| | | sr.role_id |
| | | = sur.role_id where 1=1 |
| | | <if test="nickName !=null and nickName !=''"> |
| | | and su.nick_name like concat("%", #{nickName},"%") |
| | | </if> |
| | | <if test="phonenumber !=null and phonenumber !=''"> |
| | | and phonenumber like concat("%", #{phonenumber},"%") |
| | | and su.phonenumber like concat("%", #{phonenumber},"%") |
| | | </if> |
| | | and del_flag = '0' and roleType =1 |
| | | order by create_time desc |
| | | <if test="status !=null and status !=''"> |
| | | and su.status = #{status} |
| | | </if> |
| | | and su.del_flag = '0' and su.user_type in('00','01') |
| | | order by su.create_time desc |
| | | </select> |
| | | <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where roleType=3 and user_id in |
| | |
| | | <if test="roleType != null and roleType != ''">roleType,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="objectId != null and objectId != ''">objectId,</if> |
| | | <if test="userType != null and userType != ''">user_type,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="roleType != null and roleType != ''">#{roleType},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="objectId != null and objectId != ''">#{objectId},</if> |
| | | <if test="userType != null and userType != ''">#{userType},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <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> |
| | | <if test="userType != null and userType != ''">user_type = #{userType},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |