Administrator
2021-08-10 c8ebf3038d2a7f69d9eb40f5a276dc3fa826fa9b
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -41,6 +41,7 @@
        <result column="securitynumber" property="securitynumber"/>
        <result column="dispatch" property="dispatch"/>
        <result column="my_picture" property="myPicture"/>
        <result column="is_apply" property="isApply"/>
        <result column="deptname" property="deptname"/>
    </resultMap>
@@ -207,7 +208,6 @@
    <select id="selectUserPageSecurityApply" resultMap="userResultMap">
        select
        bu.*,
        sa.id applyId,sa.apply_status applyStatus,
        bd.dept_name
        from
        blade_user bu
@@ -215,10 +215,6 @@
        blade_dept bd
        on
        bu.dept_id = bd.id
        left join
        sys_apply sa
        on
        sa.user_id = bu.id
        where
        bu.is_deleted = 0
        and
@@ -234,8 +230,8 @@
        <if test="user.deptId!=null and user.deptId != ''">
            and bu.dept_id = #{user.deptId}
        </if>
        <if test="user.applyStatus!=null">
            and sa.apply_status = #{user.applyStatus}
        <if test="user.isApply!=null">
            and sa.is_apply = #{user.isApply}
        </if>
        <if test="user.roleId!=null and user.roleId != ''">
            and bu.role_id = #{user.roleId}
@@ -268,4 +264,34 @@
        ORDER BY bu.id
    </select>
    <!--保安员列表树 安员列表树,帅选无保安证,下拉tree-->
    <select id="getSecurityApplyTree" resultType="org.springblade.modules.system.node.TreeNode">
        (select #{user.deptId} as id,
            '全部' as name,
            0 as parentId
            from blade_user)
        union all
        (select
            bu.id,
            bu.real_name as name,
            #{user.deptId} parentId
        from
            blade_user bu
        left join
        blade_dept bd
        on
        bu.dept_id = bd.id
        where
        bu.is_deleted = 0
        and
        bd.dept_category = 1
        and
        (hold = 2 or hold = 3)
        and bd.id = #{user.deptId}
        )
    </select>
</mapper>