|
@@ -9,9 +9,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="deptId" column="dept_id" />
|
|
|
<result property="userName" column="user_name" />
|
|
|
<result property="nickName" column="nick_name" />
|
|
|
+ <result property="userType" column="user_type" />
|
|
|
<result property="email" column="email" />
|
|
|
<result property="phonenumber" column="phonenumber" />
|
|
|
<result property="sex" column="sex" />
|
|
|
+ <result property="fullName" column="full_name" />
|
|
|
<result property="avatar" column="avatar" />
|
|
|
<result property="password" column="password" />
|
|
|
<result property="status" column="status" />
|
|
@@ -25,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="centerUserId" column="center_user_id" />
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
+ <result property="address" column="address" />
|
|
|
<association property="dept" column="dept_id" javaType="com.usky.system.domain.SysDeptVO" resultMap="deptResult" />
|
|
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
|
|
</resultMap>
|
|
@@ -150,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="userType != null and userType != ''">user_type,</if>
|
|
|
<if test="email != null and email != ''">email,</if>
|
|
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
|
|
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
|
@@ -158,12 +162,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">tenant_id,</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="userType != null and userType != ''">#{userType},</if>
|
|
|
<if test="email != null and email != ''">#{email},</if>
|
|
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
|
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
|
@@ -172,29 +178,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
|
sysdate()
|
|
|
)
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateUser" parameterType="com.usky.system.domain.SysUser">
|
|
|
- update sys_user
|
|
|
- <set>
|
|
|
- <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>
|
|
|
- where user_id = #{userId}
|
|
|
+ update sys_user
|
|
|
+ <set>
|
|
|
+ <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="delFlag != null and delFlag != ''">del_flag = #{delFlag},</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="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
+ <if test="address != null and address != ''">address = #{address},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where user_id = #{userId}
|
|
|
</update>
|
|
|
|
|
|
|
|
@@ -216,5 +226,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{userId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <update id="resetUserPwdOne" parameterType="com.usky.system.domain.SysUser">
|
|
|
+ update sys_user set password = #{password} where user_id = #{userId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="getUserData" parameterType="com.usky.system.domain.SysUser"
|
|
|
+ resultType="com.usky.system.domain.SysUser">
|
|
|
+ SELECT * FROM sys_user
|
|
|
+ where
|
|
|
+ del_flag=0 and user_type='01'
|
|
|
+ <if test="tenantId != null and tenantId != 0">
|
|
|
+ and tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId != 0">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ order by user_id
|
|
|
+ <if test="current != null and size != null and size != 0">
|
|
|
+ limit #{current},#{size}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|