陈昶聿
10 天以前 86e70dc8aabaaa4d17fdd25a580577731e619bf9
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -35,6 +35,8 @@
        <result property="userType" column="user_type"/>
        <result property="searchscope" column="searchscope"/>
        <result property="guid" column="guid"/>
        <result property="orgid" column="orgid"/>
        <result property="campusid" column="campusid"/>
        <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"/>
@@ -88,6 +90,8 @@
               u.create_time,
               u.remark,
               u.guid,
               u.orgid,
               u.campusid,
               d.dept_id,
               d.parent_id,
               d.ancestors,
@@ -117,8 +121,10 @@
        u.birthday,
        u.job_phone,
        u.phonenumber, u.sex, u.status,
        u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name from sys_user
        u
        u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        u.orgid,u.campusid,
        d.dept_name
        from sys_user u
        left join sys_user_dept d on u.user_id = d.user_id
        where u.del_flag = '0'
        <if test="userId != null">
@@ -180,7 +186,9 @@
        u.birthday,
        u.job_phone,
        u.phonenumber, u.sex, u.status,
        u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u
        u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        u.orgid, u.campusid
        from sys_user u
        where u.del_flag = '0'
        <if test="orgid != null">
            AND u.orgid = #{orgid}
@@ -322,11 +330,18 @@
        where u.user_id = #{userId}
    </select>
    <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
    <select id="checkUserNameUnique" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
        select user_id, user_name
        from sys_user
        where user_name = #{userName}
          and del_flag = '0' limit 1
        and del_flag = '0'
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        limit 1
    </select>
    <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
@@ -370,6 +385,8 @@
        <if test="hisUserId != null and hisUserId != ''">his_user_id,</if>
        <if test="deptCode != null and deptCode != ''">dept_code,</if>
        <if test="deptName != null and deptName != ''">dept_name,</if>
        <if test="orgid != null and orgid != ''">orgid,</if>
        <if test="campusid != null and campusid != ''">campusid,</if>
        create_time
        )values(
        <if test="userId != null and userId != ''">#{userId},</if>
@@ -395,6 +412,8 @@
        <if test="hisUserId != null and hisUserId != ''">#{hisUserId},</if>
        <if test="deptCode != null and deptCode != ''">#{deptCode},</if>
        <if test="deptName != null and deptName != ''">#{deptName},</if>
        <if test="orgid != null and orgid != ''">#{orgid},</if>
        <if test="campusid != null and campusid != ''">#{campusid},</if>
        sysdate()
        )
    </insert>
@@ -430,6 +449,8 @@
            </if>
            <if test="deptCode != null and deptCode != ''">dept_code=#{deptCode},</if>
            <if test="deptName != null and deptName != ''">dept_name=#{deptName},</if>
            <if test="orgid != null and orgid != ''">orgid=#{orgid},</if>
            <if test="campusid != null and campusid != ''">campusid=#{campusid},</if>
            update_time = sysdate()
        </set>
        where user_id = #{userId}