智慧保安后台管理-验收版本
Administrator
2021-12-02 8a8d6702c91f10ff75110c28fddf7228b8e07b12
分局预警修改
2 files modified
208 ■■■■■ changed files
src/main/java/org/springblade/modules/information/controller/InformationsController.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 196 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationsController.java
@@ -188,7 +188,7 @@
            for (ResponseVo responseVo : performanceGroupCountList) {
                //辖区id相同则数量相加
                if (responseVo.getId().equals(id)){
                    count += performanceGroupCountList.get(i).getNum();
                    count += responseVo.getNum();
                }
            }
@@ -198,7 +198,7 @@
            for (ResponseVo responseVo : examinationGroupCountList) {
                //辖区id相同则数量相加
                if (responseVo.getId().equals(id)){
                    count += examinationGroupCountList.get(i).getNum();
                    count += responseVo.getNum();
                }
            }
@@ -207,7 +207,7 @@
            for (ResponseVo responseVo : examPassingGroupCountList) {
                //辖区id相同则数量相加
                if (responseVo.getId().equals(id)){
                    count += examPassingGroupCountList.get(i).getNum();
                    count += responseVo.getNum();
                }
            }
@@ -216,7 +216,7 @@
            for (ResponseVo responseVo : holdGroupCountList) {
                //辖区id相同则数量相加
                if (responseVo.getId().equals(id)){
                    count += holdGroupCountList.get(i).getNum();
                    count += responseVo.getNum();
                }
            }
@@ -225,7 +225,7 @@
            for (ResponseVo responseVo : soidGroupCountList) {
                //辖区id相同则数量相加
                if (responseVo.getId().equals(id)){
                    count += soidGroupCountList.get(i).getNum();
                    count += responseVo.getNum();
                }
            }
@@ -234,7 +234,7 @@
            for (ResponseVo responseVo : dispatchGroupCountList) {
                //辖区id相同则数量相加
                if (responseVo.getId().equals(id)){
                    count += dispatchGroupCountList.get(i).getNum();
                    count += responseVo.getNum();
                }
            }
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -2513,7 +2513,7 @@
            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
        </if>
        <if test="information.departmentid!=null and information.departmentid!=''">
            and c.departmentid = #{information.departmentid}
            and c.dept_id = #{information.departmentid}
        </if>
    </select>
@@ -3051,6 +3051,42 @@
             ) b
             on
                 a.id = b.parent_id
        union all
        (
        select a.id,
               a.dept_name        name,
               ifnull(b.count, 0) num
        from (select id, dept_name from sys_jurisdiction where parent_id = 1372091709474910209) a
                 left join
             (
                 select sj.id,
                        sj.parent_id,
                        count(*) count
                 from sys_performance sp
                     left join
                     blade_user bu
                 on
                     bu.id = sp.securityId
                     left join
                     sys_information si
                     on
                     bu.dept_id = si.departmentid
                     left join
                     sys_jurisdiction sj
                     on
                     sj.id = si.jurisdiction
                 where
                     1=1
                   and (si.stats = 2
                    or si.stats =4)
                   and bu.is_deleted = 0
                   and bu.`status` = 1
                   and sp.score = 3
                 group by si.jurisdiction
             ) b
             on
                 a.id = b.id
        )
    </select>
@@ -3084,6 +3120,37 @@
             ) b
             on
                 a.id = b.parent_id
        union all
        (
        select a.id, a.dept_name name, ifnull(b.count, 0) num
        from (select id, dept_name from sys_jurisdiction where parent_id = 1372091709474910209) a
                 left join
             (
                 select sj.id,
                        sj.parent_id,
                        count(*) count
                 from
                     blade_user bu
                     left join
                     sys_information si
                 on
                     bu.dept_id = si.departmentid
                     left join
                     sys_jurisdiction sj
                     on
                     sj.id = si.jurisdiction
                 where
                     1=1
                   and (si.stats = 2
                    or si.stats =4)
                   and bu.is_deleted = 0
                   and bu.`status` = 1
                   and bu.examination_type = 1
                 group by si.jurisdiction
             ) b
             on
                 a.id = b.id
        )
    </select>
@@ -3149,6 +3216,69 @@
             ) f
             on
                 g.id = f.parent_id
        union all
        (
        select g.id, g.dept_name name, ifnull(f.count, 0) num
        from (select id, dept_name from sys_jurisdiction where parent_id = 1372091709474910209) g
                 left join
             (
                 select e.id, e.parent_id, count(*) count
                 from (
                     select d.*, ifnull(FORMAT((num2/num1)*100, 2), 0) num3, sj.* from (
                     select a.dept_id, ifnull(b.count, 0) num1, ifnull(c.count, 0) num2 from
                     (
                     select
                     bu.dept_id, ifnull(count (*), 0) count
                     from blade_user bu
                     left join blade_role br
                     on bu.role_id = br.id
                     where
                     role_alias = "安保人员"
                     and bu.is_deleted = 0
                     and bu.`status` = 1
                     group by dept_id
                     ) a
                     left join
                     (
                     select count (*) count, bu.dept_id from
                     exam_score es
                     left join
                     blade_user bu
                     on
                     bu.id = es.user_id
                     where 1=1 group by bu.dept_id
                     ) b
                     on
                     a.dept_id = b.dept_id
                     left join
                     (
                     select count (*) count, bu.dept_id from
                     exam_score es
                     left join
                     blade_user bu
                     on
                     bu.id = es.user_id
                     where qualified = 0 group by bu.dept_id
                     ) c
                     on a.dept_id = c.dept_id
                     ) d
                     left join
                     sys_information si
                     on
                     si.departmentid = d.dept_id
                     left join
                     sys_jurisdiction sj
                     on
                     sj.id = si.jurisdiction
                     where d.num1!=0
                     and (stats = 2 or stats=4)
                     ) e
                 where e.num3 &lt; 50
                 group by e.id
             ) f
             on
                 g.id = f.id
        )
    </select>
    <!--持证率低于50%,社保缴纳率低于50%,派遣率低于50%-->
@@ -3280,6 +3410,70 @@
        ) f
        on
        g.id = f.parent_id
        union all
        (
        select g.id,g.dept_name name,ifnull(f.count,0) num
        from
        (select id,dept_name from sys_jurisdiction where parent_id = 1372091709474910209) g
        left join
        (
        select c.id,c.parent_id,count(*) count from (
        select si.enterpriseName,sj.id,sj.parent_id,a.dept_id,ifnull(a.count,0) num1,ifnull(b.count,0)
        num2,ifnull(FORMAT((b.count/a.count)*100,2),0) num3 from
        (
        select
        bu.dept_id,ifnull(count(*),0) count
        from blade_user bu
        left join blade_role br
        on bu.role_id = br.id
        where
        role_alias = "安保人员"
        and bu.is_deleted = 0
        and bu.`status` = 1
        group by dept_id
        ) a
        left join
        (
        select
        bu.dept_id,ifnull(count(*),0) count
        from blade_user bu
        left join blade_role br
        on bu.role_id = br.id
        where
        role_alias = "安保人员"
        and bu.is_deleted = 0
        and bu.`status` = 1
        <if test="type==1">
            and bu.hold = 1
        </if>
        <if test="type==2">
            and bu.dispatch = 0
        </if>
        <if test="type==3">
            and bu.soil = 0
        </if>
        group by dept_id
        ) b
        on
        a.dept_id = b.dept_id
        left join
        sys_information si
        on
        a.dept_id = si.departmentid
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        where 1=1
        and (stats = 2 or stats=4)
        )c
        where c.num3 &lt; 50
        group by c.id
        ) f
        on
        g.id = f.id
        )
    </select>
</mapper>