|
@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="sex" column="sex" />
|
|
|
<result property="avatar" column="avatar" />
|
|
|
<result property="password" column="password" />
|
|
|
+ <result property="clearTextPasswords" column="clear_text_passwords" />
|
|
|
<result property="status" column="status" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
<result property="loginIp" column="login_ip" />
|
|
@@ -46,7 +47,7 @@ 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,
|
|
|
+ select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber,u.clear_text_passwords, 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.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
|
|
@@ -83,24 +84,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.user_name = #{userName}
|
|
|
+ where u.user_name = #{userName} and u.del_flag = '0'
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.user_id = #{userId}
|
|
|
+ where u.user_id = #{userId} and u.del_flag = '0'
|
|
|
</select>
|
|
|
|
|
|
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
|
|
- select count(1) from sys_user where user_name = #{userName} limit 1
|
|
|
+ select count(1) from sys_user where user_name = #{userName} and del_flag = '0' limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
|
|
- select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} 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} limit 1
|
|
|
+ select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
|
@@ -114,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
|
|
<if test="sex != null and sex != ''">sex,</if>
|
|
|
<if test="password != null and password != ''">password,</if>
|
|
|
+ <if test="clearTextPasswords != null and clearTextPasswords != ''">clear_text_passwords,</if>
|
|
|
<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>
|
|
@@ -128,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
|
|
<if test="sex != null and sex != ''">#{sex},</if>
|
|
|
<if test="password != null and password != ''">#{password},</if>
|
|
|
+ <if test="clearTextPasswords != null and clearTextPasswords != ''">#{clearTextPasswords},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
@@ -146,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="clearTextPasswords != null and clearTextPasswords != ''">clear_text_passwords = #{clearTextPasswords},</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>
|
|
@@ -165,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<update id="resetUserPwd" parameterType="SysUser">
|
|
|
- update sys_user set password = #{password} where user_name = #{userName}
|
|
|
+ update sys_user set password = #{password}, clear_text_passwords = #{clearTextPasswords} where user_name = #{userName}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteUserById" parameterType="Long">
|