智慧保安后台管理-外网项目备份
tangzy
2021-09-24 efafaeb3ba1b38273fdcd7009beaaa41afa5a0a0
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -122,7 +122,12 @@
    </select>
    <select id="selectUserPage" resultMap="userResultMap">
        select * from blade_user where is_deleted = 0
        select bu.* from blade_user bu
        left join
        blade_dept bd
        on
        bd.id = bu.dept_id
        where bu.is_deleted = 0
        <if test="user.tenantId!=null and user.tenantId != ''">
            and tenant_id = #{user.tenantId}
        </if>
@@ -133,7 +138,7 @@
            and real_name like concat(concat('%', #{user.realName}),'%')
        </if>
        <if test="user.deptId!=null and user.deptId != ''">
            and dept_id like concat(concat('%', #{user.deptId}),'%')
            and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId})
        </if>
        <if test="user.userType!=null and user.userType != ''">
            and user_type = #{user.userType}
@@ -149,16 +154,17 @@
        </if>
        <if test="user.hold!=null and user.hold != ''">
            and hold = #{user.hold}
        </if> <if test="user.jurisdiction!=null and user.jurisdiction != ''">
        and jurisdiction = #{user.jurisdiction}
    </if>
        </if>
        <if test="user.jurisdiction!=null and user.jurisdiction != ''">
            and jurisdiction = #{user.jurisdiction}
        </if>
        <if test="user.securitynumber!=null and user.securitynumber != ''">
            and securitynumber = #{user.securitynumber}
        </if>
        <if test="user.examinationType!=null and user.examinationType != ''">
            and examination_type = #{user.examinationType}
        </if>
        ORDER BY id
        ORDER BY bu.id
    </select>
    <select id="getUser" resultMap="userResultMap">
@@ -489,4 +495,13 @@
    <select id="selectCountAccount" resultType="java.lang.Integer">
        select count(*) from blade_user where account = #{account}
    </select>
    <!--查询当前部门名称及父级部门名称-->
    <select id="getDeptName" resultType="java.lang.String">
        (select dept_name from blade_dept where id = #{deptId} and 1=1)
        union
        (
            select dept_name from blade_dept where id =  (select parent_id from blade_dept where id= #{deptId} and 1=1)
        )
    </select>
</mapper>