智慧保安后台管理-验收版本
Administrator
2021-09-18 dae145fda8a0102c8cb396acce37d6219cf6be88
统计接口修改
2 files modified
97 ■■■■ changed files
src/main/java/org/springblade/modules/information/controller/InformationsController.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 91 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationsController.java
@@ -158,6 +158,7 @@
            String jurname = list.get(i).get("dept_name").toString();
            //1.保安员表现差预警数量
            List<ResponseVo> performanceGroupCountList = informationService.getSecurityPerformanceGroupCountList();
            System.out.println("保安员表现差预警数量 = " + performanceGroupCountList);
            //遍历计算总数
            for (ResponseVo responseVo : performanceGroupCountList) {
                //辖区id相同则数量相加
@@ -169,6 +170,7 @@
            //2.保安员资格异常的数量
            List<ResponseVo> examinationGroupCountList = informationService.getSecurityExaminationGroupCountList();
            System.out.println("保安员资格异常的数量 = " + examinationGroupCountList);
            //遍历计算总数
            for (ResponseVo responseVo : examinationGroupCountList) {
                //辖区id相同则数量相加
@@ -179,6 +181,7 @@
            //3.考试通过率低于50%
            List<ResponseVo> examPassingGroupCountList = informationService.getSecurityExamPassingGroupCountList();
            System.out.println("考试通过率低于50% = " + examPassingGroupCountList);
            //遍历计算总数
            for (ResponseVo responseVo : examPassingGroupCountList) {
                //辖区id相同则数量相加
@@ -189,6 +192,7 @@
            //4.持证率低于50%
            List<ResponseVo> holdGroupCountList = informationService.getSecurityHoldAndSoidAndDispatchGroupCountList(1);
            System.out.println("持证率低于50% = " + holdGroupCountList);
            //遍历计算总数
            for (ResponseVo responseVo : holdGroupCountList) {
                //辖区id相同则数量相加
@@ -199,6 +203,7 @@
            //5.社保缴纳率低于50%
            List<ResponseVo> soidGroupCountList = informationService.getSecurityHoldAndSoidAndDispatchGroupCountList(2);
            System.out.println("社保缴纳率低于50% = " + soidGroupCountList);
            //遍历计算总数
            for (ResponseVo responseVo : soidGroupCountList) {
                //辖区id相同则数量相加
@@ -209,6 +214,7 @@
            //6.派遣率低于50%
            List<ResponseVo> dispatchGroupCountList = informationService.getSecurityHoldAndSoidAndDispatchGroupCountList(3);
            System.out.println("派遣率低于50% = " + dispatchGroupCountList);
            //遍历计算总数
            for (ResponseVo responseVo : dispatchGroupCountList) {
                //辖区id相同则数量相加
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -2438,16 +2438,81 @@
    </select>
    <!--持证率低于50%,社保缴纳率低于50%,派遣率低于50%-->
    <select id="getSecurityHoldAndSoidAndDispatchGroupCountList"
            resultType="org.springblade.modules.information.vo.ResponseVo">
    <!--    <select id="getSecurityHoldAndSoidAndDispatchGroupCountList" resultType="org.springblade.modules.information.vo.ResponseVo">-->
    <!--        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(a.count,0) num1,ifnull(b.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-->
    <!--                    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-->
    <!--                )d-->
    <!--                left join-->
    <!--                sys_information si-->
    <!--                on-->
    <!--                si.departmentid = d.dept_id-->
    <!--                left join-->
    <!--                sys_jurisdiction sj-->
    <!--                on-->
    <!--                sj.id = si.jurisdiction-->
    <!--                and (stats = 2 or stats=4)-->
    <!--            )e-->
    <!--            where e.num3 &lt; 50-->
    <!--            group by e.id-->
    <!--        ) f-->
    <!--            on-->
    <!--        g.id = f.parent_id-->
    <!--    </select>-->
    <!--持证率低于50%,社保缴纳率低于50%,派遣率低于50%-->
    <select id="getSecurityHoldAndSoidAndDispatchGroupCountList" resultType="org.springblade.modules.information.vo.ResponseVo">
        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(a.count,0) num1,ifnull(b.count,0) num2 from
        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 sys_information si
        left join
        (
        select
        bu.dept_id,ifnull(count(*),0) count
@@ -2460,6 +2525,8 @@
        and bu.`status` = 1
        group by dept_id
        ) a
        on
        si.departmentid = a.dept_id
        left join
        (
@@ -2484,20 +2551,16 @@
        group by dept_id
        ) b
        on
        a.dept_id = b.dept_id
        )d
        left join
        sys_information si
        on
        si.departmentid = d.dept_id
        si.departmentid = b.dept_id
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        where 1=1
        and (stats = 2 or stats=4)
        )e
        where e.num3 &lt; 50
        group by e.id
        )c
        where c.num3 &lt; 50
        group by c.id
        ) f
        on
        g.id = f.parent_id