|
|
|
@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
<result property="referrerId" column="referrer_id" /> |
|
|
|
|
<association property="referrerSysUser" javaType="SysUser"> |
|
|
|
|
<result property="nickName" column="referrer_nickName"/> |
|
|
|
|
<result property="phonenumber" column="referrer_phonenumber"/> |
|
|
|
|
</association> |
|
|
|
|
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> |
|
|
|
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
|
|
|
@ -53,14 +54,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
</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 |
|
|
|
|
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 |
|
|
|
|
left join sys_role r on r.role_id = ur.role_id |
|
|
|
|
</sql> |
|
|
|
|
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, |
|
|
|
|
u.referrer_id, |
|
|
|
|
u.wechat_nick_name, |
|
|
|
|
u.balance, |
|
|
|
|
referrer.nick_name as referrer_nickName, |
|
|
|
|
referrer.phonenumber as referrer_phonenumber, |
|
|
|
|
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 |
|
|
|
|
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 |
|
|
|
|
left join sys_role r on r.role_id = ur.role_id |
|
|
|
|
left join sys_user referrer on u.referrer_id = referrer.user_id |
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
|
|
|
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, |
|
|
|
@ -201,18 +234,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> |
|
|
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if> |
|
|
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> |
|
|
|
|
<if test="email != null ">email = #{email},</if> |
|
|
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if> |
|
|
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if> |
|
|
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
|
|
|
|
<if test="password != null and password != ''">password = #{password},</if> |
|
|
|
|
<if test="status != null and status != ''">status = #{status},</if> |
|
|
|
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> |
|
|
|
|
<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> |
|
|
|
|
update_time = sysdate() |
|
|
|
|
</set> |
|
|
|
|
<if test="email != null ">email = #{email},</if> |
|
|
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if> |
|
|
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if> |
|
|
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
|
|
|
|
<if test="password != null and password != ''">password = #{password},</if> |
|
|
|
|
<if test="status != null and status != ''">status = #{status},</if> |
|
|
|
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> |
|
|
|
|
<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="wechatNickName != null and wechatNickName != ''">wechat_nick_name=#{wechatNickName},</if> |
|
|
|
|
<if test="balance != null and balance != ''">balance=#{balance},</if> |
|
|
|
|
<if test="referrerId != null and referrerId != ''">referrer_id=#{referrerId},</if> |
|
|
|
|
update_time = sysdate() |
|
|
|
|
</set> |
|
|
|
|
where user_id = #{userId} |
|
|
|
|
</update> |
|
|
|
|
|
|
|
|
|