智慧保安后台管理-外网项目备份
zhongrj
2023-11-06 07794736f879adb9cf02a69e5c6ada6a94b7bbde
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -127,8 +127,11 @@
        <if test="user.roleAlias!=null and user.roleAlias != ''">
            and br.role_alias = '保安'
        </if>
        <if test="user.status!=null and user.status != '' and user.status != 6">
        <if test="user.status!=null and user.status != 6">
            and bu.status = #{user.status}
        </if>
        <if test="user.isFreeze!=null">
            and bu.is_freeze = #{user.isFreeze}
        </if>
        <if test="user.education!=null  and user.education != ''">
            and bu.education = #{user.education}
@@ -244,6 +247,9 @@
            <if test="user.account!=null and user.account != ''">
                and bu.account like concat('%', #{user.account},'%')
            </if>
            <if test="user.isFreeze!=null">
                and bu.is_freeze = #{user.isFreeze}
            </if>
            <if test="user.hold!=null and user.hold != ''">
                and bu.hold = #{user.hold}
            </if>
@@ -356,6 +362,9 @@
        </if>
        <if test="user.account!=null and user.account != ''">
            and account like concat('%', #{user.account},'%')
        </if>
        <if test="user.isFreeze!=null">
            and bu.is_freeze = #{user.isFreeze}
        </if>
        <if test="user.roleId!=null and user.roleId != ''">
            and (br.role_alias = '公安管理员' or br.role_alias = '民警')
@@ -483,6 +492,9 @@
        <if test="user.sex!=null and user.sex != ''">
            and bu.sex = #{user.sex}
        </if>
        <if test="user.isFreeze!=null">
            and bu.is_freeze = #{user.isFreeze}
        </if>
        <if test="user.dispatch!=null and user.dispatch != ''">
            <if test="user.dispatch==1">
                and (bu.dispatch = #{user.dispatch} or bu.dispatch is null)
@@ -537,6 +549,9 @@
        <if test="user.roleId!=null and user.roleId != ''">
            and bu.role_id = #{user.roleId}
        </if>
        <if test="user.isFreeze!=null">
            and bu.is_freeze = #{user.isFreeze}
        </if>
        <if test="user.status!=null and user.status != ''">
            and bu.status = #{user.status}
        </if>
@@ -558,19 +573,10 @@
    <!--保安员列表树 安员列表树,帅选无保安证,下拉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
            a.id,
            a.name,
        a.type,
            a.parentId
            from (
                select
@@ -580,20 +586,15 @@
                    bu.is_apply isApply,
                    bu.is_train isTrain,
                    bu.real_name as name,
                if(es.user_id is not null,1,2) as type,
                    #{user.deptId} parentId
                from
                    blade_user bu
                left join
                blade_dept bd
                on
                bu.dept_id = bd.id
                left join
                blade_role br
                on
                br.id = bu.role_id
            from blade_user bu
            left join blade_dept bd on bu.dept_id = bd.id
            left join blade_role br on br.id = bu.role_id
            left join (select user_id,max(id) from exam_score where (qualified =1 or qualified =3) GROUP BY user_id) es
            on es.user_id = bu.id
                where
                bu.is_deleted = 0
                and bu.status = 1
            bu.is_deleted = 0 and bu.status = 1 and bu.is_freeze = 0
                and (bu.examination_type != 1 or bu.examination_type is null)
                and (hold = 2 or hold = 3)
                and bd.id = #{user.deptId}
@@ -606,7 +607,6 @@
            <if test="user.examType==2">
                and a.isTrain != 1
            </if>
        )
    </select>
@@ -673,6 +673,7 @@
        </if>
        and bu.status = 1
        and bu.is_deleted = 0
        and bu.is_freeze = 0
    </select>
@@ -918,6 +919,9 @@
        <if test="user.isAvatar==2">
            and (bu.avatar is null or bu.avatar="")
        </if>
        <if test="user.isFreeze!=null">
            and bu.is_freeze = #{user.isFreeze}
        </if>
        <if test="user.unitName!=null and user.unitName != ''">
            and bu.unit_name like concat('%', #{user.unitName},'%')
        </if>
@@ -1149,7 +1153,7 @@
    <!--用户冻结操作-->
    <update id="updateFreeze">
        update blade_user set is_deleted = 1
        update blade_user set is_freeze = 1
        <choose>
            <when test="list!=null and list.size()>0">
                where id in