liusheng
2024-05-16 2f13f59f023fba63aa993172d48c14bcaaafb233
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -27,6 +27,7 @@
        <result property="errorNums" column="error_nums"/>
        <result property="errorTimes" column="error_times"/>
        <result property="standardlevel" column="standardlevel"/>
        <result property="dingUserId" column="ding_user_id"/>
        <association property="dept" column="dept_id" javaType="com.ruoyi.common.core.domain.entity.SysDept"
                     resultMap="deptResult"/>
        <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
@@ -54,6 +55,7 @@
        select u.user_id,
               u.openid,
               u.dept_id,
               u.ding_user_id,
               u.error_nums,
               u.error_times,
               u.user_name,
@@ -90,7 +92,8 @@
    </sql>
    <select id="selectUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
        select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
        select u.user_id,u.ding_user_id, u.dept_id, u.nick_name, u.user_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.standardlevel,
        d.dept_name, d.leader from sys_user u
        left join sys_dept d on u.dept_id = d.dept_id
@@ -163,6 +166,10 @@
        <include refid="selectUserVo"/>
        where u.user_name = #{userName}
    </select>
    <select id="selectUserByDingUserId" parameterType="String" resultMap="SysUserResult">
        <include refid="selectUserVo"/>
        where u.ding_user_id = #{dingUserId}
    </select>
    <select id="selectUserByOpenID" parameterType="String" resultMap="SysUserResult">
        <include refid="selectUserVo"/>
@@ -211,6 +218,7 @@
        <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="dingUserId != null and dingUserId != ''">ding_user_id,</if>
        create_time
        )values(
        <if test="userId != null and userId != ''">#{userId},</if>
@@ -225,6 +233,7 @@
        <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="dingUserId != null and dingUserId != ''">#{dingUserId},</if>
        sysdate()
        )
    </insert>
@@ -247,9 +256,12 @@
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="errorNums != null">error_nums = #{errorNums},</if>
            <if test="dingUserId != null and dingUserId != ''">ding_user_id = #{dingUserId},</if>
            update_time = sysdate()
        </set>
        where user_id = #{userId}
        where del_flag=0
        <if test="userId != null and userId != ''">and user_id = #{userId}</if>
        <if test="phonenumber != null and phonenumber != ''">and phonenumber = #{phonenumber}</if>
    </update>
    <update id="updateUserStatus" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
@@ -264,7 +276,7 @@
        where user_name = #{userName}
    </update>
    <update id="resetUserPwd" parameterType="SysUser">
    <update id="resetUserPwd" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
        update sys_user
        set password = #{password}
        where user_name = #{userName}
@@ -297,4 +309,4 @@
        where user_name = #{userName}
    </update>
</mapper>
</mapper>