智慧保安后台管理项目备份
tangzy
2021-11-05 60dddbf3d0182c8a5220b04d3ea207b0756bc0f3
1.统计
20 files modified
722 ■■■■ changed files
src/main/java/org/springblade/modules/information/controller/InformationController.java 53 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 550 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/entity/Permit.java 9 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/mapper/PermitMapper.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/service/IPermitService.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/service/impl/PermitServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/vo/PermitVO.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/controller/RecordController.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/mapper/RecordMapper.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/mapper/RecordMapper.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/service/IRecordService.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/service/impl/RecordServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/vo/RecordVO.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/controller/RevokeController.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/mapper/RevokeMapper.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/service/IRevokeService.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/service/impl/RevokeServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/vo/RevokeVO.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -332,18 +332,22 @@
        Integer lnum = 0;
        //这个月人数数量
        Integer tnum = 0;
        Integer znum = 0;
        //上个月派遣人数
        Integer tpznum = 0;
        //这个月人数数量
        Integer lpznum = 0;
        Integer pznum = 0;
        //上个月总人数
        Integer tznum = 0;
        //这个月总人数
        Integer lznum = 0;
        Integer sbnum = 0;
        //上个月金额
        Double lmount = 0.0;
        //这个月金额
        Double tmount = 0.0;
        Double tamountnum = 0.0;
        Map<String, Object> map = new HashMap<String, Object>();
        List<Map<String, Object>> lists = new ArrayList<>();
        List<Map<String, Object>> list = informationService.selectTo(jurisdiction, deptid);
@@ -354,33 +358,57 @@
            String thismouths = list.get(i).get("thismouth").toString();
            Integer thismouth = Integer.parseInt(thismouths);
            tnum += thismouth;
            //社保总数
            String nums = list.get(i).get("num").toString();
            Integer numss = Integer.parseInt(nums);
            znum += numss;
            String lastamounts = list.get(i).get("lastamount").toString();
            Double lastamount = Double.parseDouble(lastamounts);
            lmount += lastamount;
            String thisamounts = list.get(i).get("thisamount").toString();
            Double thisamount = Double.parseDouble(thisamounts);
            tmount += thisamount;
            //缴纳总数
            String amountnums = list.get(i).get("amountnum").toString();
            Double amountnumss = Double.parseDouble(amountnums);
            tamountnum += amountnumss;
            String userthismouth = list.get(i).get("userthismouth").toString();
            Integer userthismouths = Integer.parseInt(userthismouth);
            lpznum += userthismouths;
            String userlastmouth = list.get(i).get("userlastmouth").toString();
            Integer userlastmouths = Integer.parseInt(userlastmouth);
            tpznum += userlastmouths;
            //公司派遣总数
            String usernums = list.get(i).get("usernum").toString();
            Integer usernumss = Integer.parseInt(usernums);
            pznum += usernumss;
            String userpcthismouth = list.get(i).get("userpcthismouth").toString();
            Integer userpcthismouths = Integer.parseInt(userpcthismouth);
            lznum += userpcthismouths;
            String userpclastmouth = list.get(i).get("userpclastmouth").toString();
            Integer userpclastmouths = Integer.parseInt(userpclastmouth);
            tznum += userpclastmouths;
            //缴纳社保总数
            String userpcnums = list.get(i).get("userpcnum").toString();
            Integer userpcnumss = Integer.parseInt(userpcnums);
            sbnum += userpcnumss;
        }
        map.put("lastmonth", lnum);
        map.put("thismouth", tnum);
        map.put("znum", znum);
        map.put("lastamount", lmount);
        map.put("thisamount", tmount);
        map.put("tamountnum", tamountnum);
        map.put("userlastmouth", tpznum);
        map.put("userthismouth", lpznum);
        map.put("usernum", pznum);
        map.put("userpcthismouth", lznum);
        map.put("userpclastmouth", tznum);
        map.put("userpcnum", sbnum);
        lists.add(map);
        return R.data(lists);
    }
@@ -439,6 +467,12 @@
        List<Map<String, Object>> lists = new ArrayList<>();
        Integer a = 0;
        Integer b = 0;
        Integer num=0;
        Integer znum=0;
        Integer cznum=0;
        Integer sbnum=0;
        Integer khnum=0;
        Integer pqnum=0;
        Integer zca = 0;
        Integer zcb = 0;
        Integer cza = 0;
@@ -467,10 +501,12 @@
            //上个月数量
            String lastnum = maps.get(i).get("lastnum").toString();
            b += Integer.valueOf(lastnum);
            String nums = maps.get(i).get("num").toString();
            num += Integer.valueOf(nums);
        }
        map.put("thisnum", a);
        map.put("lastnum", b);
        map.put("num", num);
        map.put("List", maps);
        mapC.put("baoan", map);
        //正常保安员数量
@@ -482,9 +518,12 @@
            //上个月数量
            String lastnum = maps1.get(i).get("lastnum").toString();
            zcb += Integer.valueOf(lastnum);
            String nums = maps1.get(i).get("num").toString();
            znum += Integer.valueOf(nums);
        }
        mapzc.put("thisnum", zca);
        mapzc.put("lastnum", zcb);
        mapzc.put("num", znum);
        mapzc.put("List", maps1);
        mapC.put("zcbaoan", mapzc);
        //持证保安数量
@@ -496,9 +535,12 @@
            //上个月数量
            String lastnum = maps2.get(i).get("lastnum").toString();
            czb += Integer.valueOf(lastnum);
            String nums = maps2.get(i).get("num").toString();
            cznum += Integer.valueOf(nums);
        }
        mapcz.put("thisnum", cza);
        mapcz.put("lastnum", czb);
        mapcz.put("num", cznum);
        mapcz.put("List", maps2);
        mapC.put("czbaoan", mapcz);
        //缴纳社保数量
@@ -510,9 +552,12 @@
            //上个月数量
            String lastnum = maps3.get(i).get("lastnum").toString();
            sbb += Integer.valueOf(lastnum);
            String nums = maps3.get(i).get("num").toString();
            sbnum += Integer.valueOf(nums);
        }
        mapsb.put("thisnum", sba);
        mapsb.put("lastnum", sbb);
        mapsb.put("num", sbnum);
        mapsb.put("List", maps3);
        mapC.put("sheb", mapsb);
        //服务客户数量
@@ -524,9 +569,12 @@
            //上个月数量
            String lastnum = maps4.get(i).get("lastnum").toString();
            khb += Integer.valueOf(lastnum);
            String nums = maps4.get(i).get("num").toString();
            khnum += Integer.valueOf(nums);
        }
        mapkh.put("thisnum", kha);
        mapkh.put("lastnum", khb);
        mapkh.put("num", khnum);
        mapkh.put("List", maps4);
        mapC.put("kh", mapkh);
        //保安派遣数量
@@ -538,9 +586,12 @@
            //上个月数量
            String lastnum = maps5.get(i).get("lastnum").toString();
            pqb += Integer.valueOf(lastnum);
            String nums = maps5.get(i).get("num").toString();
            pqnum += Integer.valueOf(nums);
        }
        mappq.put("thisnum", pqa);
        mappq.put("lastnum", pqb);
        mappq.put("num", pqnum);
        mappq.put("List", maps5);
        mapC.put("paiq", mappq);
        lists.add(mapC);
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -347,81 +347,162 @@
    <!--    </select> -->
    <!--统计上个月和这个月交社保的人数以及缴纳金额-->
    <select id="selectTo" resultType="java.util.HashMap">
        SELECT IFNULL(A.lastmonth, 0) AS lastmonth,
        IFNULL(B.thismouth, 0) AS thismouth,
        IFNULL(C.thisamount, 0) AS thisamount,
        IFNULL(D.lastamount, 0) AS lastamount,
        IFNULL(E.userthismouth, 0) AS userthismouth,
        IFNULL(F.userlastmouth, 0) AS userlastmouth,
        IFNULL(G.userpcthismouth, 0) AS userpcthismouth,
        IFNULL(J.userpclastmouth, 0) AS userpclastmouth
        FROM (SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction) H
        SELECT
        IFNULL( A.lastmonth, 0 ) AS lastmonth,
        IFNULL( B.thismouth, 0 ) AS thismouth,
        IFNULL( Z.num, 0 ) AS num,
        IFNULL( C.thisamount, 0 ) AS thisamount,
        IFNULL( D.lastamount, 0 ) AS lastamount,
        IFNULL( R.amountnum, 0 ) AS amountnum,
        IFNULL( E.userthismouth, 0 ) AS userthismouth,
        IFNULL( F.userlastmouth, 0 ) AS userlastmouth,
        IFNULL( I.usernum, 0 ) AS usernum,
        IFNULL( G.userpcthismouth, 0 ) AS userpcthismouth,
        IFNULL( J.userpclastmouth, 0 ) AS userpclastmouth,
        IFNULL( P.userpcnum, 0 ) AS userpcnum
        FROM
        ( SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN (
        SELECT COUNT(*) AS lastmonth,
        SELECT
        COUNT( * ) AS lastmonth,
        deptid
        FROM sys_socil
        WHERE PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(insuredtime, '%Y%m')) = 1
        GROUP BY deptid
        FROM
        sys_socil
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( insuredtime, '%Y%m' ) ) = 1
        GROUP BY
        deptid
        ) A ON A.deptid = H.departmentid
        LEFT JOIN (
        SELECT COUNT(*) AS thismouth,
        SELECT
        COUNT( * ) AS thismouth,
        deptid
        FROM sys_socil
        WHERE DATE_FORMAT(insuredtime, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
        GROUP BY deptid
        FROM
        sys_socil
        WHERE
        DATE_FORMAT( insuredtime, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY
        deptid
        ) B ON B.deptid = H.departmentid
        LEFT JOIN (
        SELECT SUM(amount) AS thisamount,
        SELECT
        COUNT( * ) AS num,
        deptid
        FROM sys_socil
        WHERE DATE_FORMAT(insuredtime, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
        GROUP BY deptid
        FROM
        sys_socil
        GROUP BY
        deptid
        ) Z ON Z.deptid = H.departmentid
        LEFT JOIN (
        SELECT
        SUM( amount ) AS thisamount,
        deptid
        FROM
        sys_socil
        WHERE
        DATE_FORMAT( insuredtime, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY
        deptid
        ) C ON C.deptid = H.departmentid
        LEFT JOIN (
        SELECT SUM(amount) AS lastamount,
        SELECT
        SUM( amount ) AS lastamount,
        deptid
        FROM sys_socil
        WHERE PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(insuredtime, '%Y%m')) = 1
        GROUP BY deptid
        FROM
        sys_socil
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( insuredtime, '%Y%m' ) ) = 1
        GROUP BY
        deptid
        ) D ON D.deptid = H.departmentid
        LEFT JOIN (
        SELECT COUNT(*) AS userthismouth,
        SELECT
        SUM(amount) AS amountnum,
        deptid
        FROM
        sys_socil
        GROUP BY
        deptid
        ) R ON R.deptid = H.departmentid
        LEFT JOIN (
        SELECT
        COUNT( * ) AS userthismouth,
        dept_id
        FROM blade_user
        WHERE DATE_FORMAT(update_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
        FROM
        blade_user
        WHERE
        DATE_FORMAT( update_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        AND STATUS = 1
        AND is_deleted = 0
        GROUP BY dept_id
        GROUP BY
        dept_id
        ) E ON E.dept_id = H.departmentid
        LEFT JOIN (
        SELECT COUNT(*) AS userlastmouth,
        SELECT
        COUNT( * ) AS userlastmouth,
        dept_id
        FROM blade_user
        WHERE PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(update_time, '%Y%m')) = 1
        FROM
        blade_user
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( update_time, '%Y%m' ) ) = 1
        AND STATUS = 1
        AND is_deleted = 0
        GROUP BY dept_id
        GROUP BY
        dept_id
        ) F ON F.dept_id = H.departmentid
        LEFT JOIN (
        SELECT COUNT(*) AS userpcthismouth,
        SELECT
        COUNT(*) AS usernum,
        dept_id
        FROM blade_user
        WHERE DATE_FORMAT(update_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
        FROM
        blade_user
        WHERE
        STATUS = 1
        AND is_deleted = 0
        GROUP BY
        dept_id
        ) I ON I.dept_id = H.departmentid
        LEFT JOIN (
        SELECT
        COUNT( * ) AS userpcthismouth,
        dept_id
        FROM
        blade_user
        WHERE
        DATE_FORMAT( update_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        AND dispatch = 0
        AND STATUS = 1
        AND is_deleted = 0
        GROUP BY dept_id
        GROUP BY
        dept_id
        ) G ON G.dept_id = H.departmentid
        LEFT JOIN (
        SELECT COUNT(*) AS userpclastmouth,
        SELECT
        COUNT( * ) AS userpclastmouth,
        dept_id
        FROM blade_user
        WHERE PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(update_time, '%Y%m')) = 1
        FROM
        blade_user
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( update_time, '%Y%m' ) ) = 1
        AND dispatch = 0
        AND STATUS = 1
        AND is_deleted = 0
        GROUP BY dept_id
        ) J ON J.dept_id = H.departmentid where 1=1
        GROUP BY
        dept_id
        ) J ON J.dept_id = H.departmentid
        LEFT JOIN (
        SELECT
        COUNT(*) AS userpcnum,
        dept_id
        FROM
        blade_user
        WHERE dispatch = 0
        AND STATUS = 1
        AND is_deleted = 0
        GROUP BY
        dept_id
        ) P ON P.dept_id = H.departmentid
        WHERE 1 =1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and H.jurisdiction =#{jurisdiction}
        </if>
@@ -602,6 +683,7 @@
    <select id="queryCountB" resultType="java.util.HashMap">
        SELECT IFNULL(A.thisnum, 0) AS thisnum,
        IFNULL(B.lastnum, 0) AS lastnum,
        IFNULL( C.num, 0 ) AS num,
        H.departmentid,
        H.jurisdiction
        FROM (SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction) H
@@ -624,7 +706,20 @@
        AND is_deleted = 0
        AND PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(create_time, '%Y%m')) = 1
        GROUP BY dept_id
        ) B ON B.dept_id = H.departmentid where 1=1
        ) B ON B.dept_id = H.departmentid LEFT JOIN (
        SELECT
        COUNT( * ) AS num,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        GROUP BY
        dept_id
        ) C ON C.dept_id = H.departmentid
        where 1=1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and H.jurisdiction =#{jurisdiction}
        </if>
@@ -635,128 +730,184 @@
    <!--正常保安数量-->
    <select id="queryCountZc" resultType="java.util.HashMap">
        SELECT C.thisnum,
        C.lastnum,
        d.dept_name as deptname,
        j.dept_name as jurname
        FROM (
        SELECT IFNULL(A.thisnum, 0) AS thisnum,
        IFNULL(B.lastnum, 0) AS lastnum,
        A.dept_id,
        A.jurisdiction
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE role_id = '1412226235153731586' and status=1 and is_deleted=0
        SELECT
        IFNULL( A.thisnum, 0 ) AS thisnum,
        IFNULL( B.lastnum, 0 ) AS lastnum,
        IFNULL( D.num, 0 ) AS num,
        H.departmentid,
        H.jurisdiction,
        d.dept_name AS deptname,
        j.dept_name AS jurname
        FROM
        ( SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN (
        SELECT
        COUNT( * ) AS thisnum,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        AND examination_type = 0
        AND DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY dept_id,
        jurisdiction
        ) A
        left JOIN (
        SELECT COUNT
        (*) AS lastnum,
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE role_id = '1412226235153731586' and status=1 and is_deleted=0
        GROUP BY
        dept_id
        ) A ON H.departmentid = A.dept_id
        LEFT JOIN (
        SELECT
        COUNT( * ) AS lastnum,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        AND examination_type = 0
        AND PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( create_time, '%Y%m' ) ) = 1
        GROUP BY dept_id,
        jurisdiction
        ) B ON A.dept_id = B.dept_id) C
        LEFT JOIN blade_dept d ON C.dept_id = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1
        GROUP BY
        dept_id
        ) B ON H.departmentid = B.dept_id
        LEFT JOIN (
        SELECT
        COUNT( * ) AS num,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        AND examination_type = 0
        GROUP BY
        dept_id
        ) D ON H.departmentid = D.dept_id
        LEFT JOIN blade_dept d ON H.departmentid = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = H.jurisdiction
        WHERE 1 =1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and C.jurisdiction =#{jurisdiction}
            and H.jurisdiction =#{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            and C.dept_id =#{deptid}
            and H.departmentid =#{deptid}
        </if>
    </select>
    <!--持证保安数量-->
    <select id="queryCountCz" resultType="java.util.HashMap">
        SELECT C.thisnum,
        C.lastnum,
        d.dept_name as deptname,
        j.dept_name as jurname
        FROM (
        SELECT IFNULL(A.thisnum, 0) AS thisnum,
        IFNULL(B.lastnum, 0) AS lastnum,
        A.dept_id,
        A.jurisdiction
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE role_id = '1412226235153731586' and status=1 and is_deleted=0
        SELECT
        IFNULL( A.thisnum, 0 ) AS thisnum,
        IFNULL( B.lastnum, 0 ) AS lastnum,
        IFNULL( C.num, 0 ) AS num,
        H.departmentid,
        H.jurisdiction,
        d.dept_name AS deptname,
        j.dept_name AS jurname
        FROM
        ( SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN (
        SELECT
        COUNT(*) AS thisnum,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        AND hold = 1
        AND DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY dept_id,
        jurisdiction
        ) A
        left JOIN (
        SELECT COUNT
        (*) AS lastnum,
        dept_id,
        jurisdiction
        FROM blade_user
        WHERE role_id = '1412226235153731586' and status=1 and is_deleted=0
        GROUP BY
        dept_id
        ) A ON H.departmentid = A.dept_id
        LEFT JOIN (
        SELECT
        COUNT(*) AS lastnum,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        AND hold = 1
        AND PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( create_time, '%Y%m' ) ) = 1
        GROUP BY dept_id,
        jurisdiction
        ) B ON A.dept_id = B.dept_id) C
        LEFT JOIN blade_dept d ON C.dept_id = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1
        GROUP BY
        dept_id
        ) B ON H.departmentid = B.dept_id
        LEFT JOIN (
        SELECT
        COUNT(*) AS num,
        dept_id
        FROM
        blade_user
        WHERE
        role_id = '1412226235153731586'
        AND STATUS = 1
        AND is_deleted = 0
        AND hold = 1
        GROUP BY
        dept_id
        ) C ON H.departmentid = C.dept_id
        LEFT JOIN blade_dept d ON H.departmentid = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = H.jurisdiction
        WHERE 1 =1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and C.jurisdiction =#{jurisdiction}
            and H.jurisdiction =#{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            and C.dept_id =#{deptid}
            and H.departmentid =#{deptid}
        </if>
    </select>
    <!--缴纳社保数量-->
    <select id="queryCountSb" resultType="java.util.HashMap">
        SELECT C.thisnum,
        C.lastnum,
        SELECT
        IFNULL( A.thisnum, 0 ) AS thisnum,
        IFNULL( B.lastnum, 0 ) AS lastnum,
        IFNULL( C.num, 0 ) AS num,
        H.departmentid,
        H.jurisdiction,
        d.dept_name AS deptname,
        j.dept_name AS jurname
        FROM (
        SELECT IFNULL(A.thisnum, 0) AS thisnum,
        IFNULL(B.lastnum, 0) AS lastnum,
        A.deptid,
        A.jurisdiction
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        deptid,
        jurisdiction
        FROM sys_socil
        WHERE DATE_FORMAT(insuredtime, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY deptid,
        jurisdiction
        ) A
        left JOIN (
        SELECT COUNT
        (*) AS lastnum,
        deptid,
        jurisdiction
        FROM sys_socil
        WHERE PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( insuredtime, '%Y%m' ) ) = 1
        GROUP BY deptid,
        jurisdiction
        ) B ON A.deptid = B.deptid
        ) C
        LEFT JOIN blade_dept d ON C.deptid = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction where 1=1
        FROM
        ( SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN (
        SELECT
        COUNT( * ) AS thisnum,
        deptid
        FROM
        sys_socil
        WHERE
        DATE_FORMAT( insuredtime, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY
        deptid
        ) A ON H.departmentid = A.deptid
        LEFT JOIN (
        SELECT
        COUNT( * ) AS lastnum,
        deptid
        FROM
        sys_socil
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( insuredtime, '%Y%m' ) ) = 1
        GROUP BY
        deptid
        ) B ON H.departmentid = B.deptid
        LEFT JOIN (
        SELECT
        COUNT( * ) AS num,
        deptid
        FROM
        sys_socil
        GROUP BY
        deptid
        ) C ON H.departmentid = C.deptid
        LEFT JOIN blade_dept d ON H.departmentid = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = H.jurisdiction
        WHERE 1 =1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and C.jurisdiction =#{jurisdiction}
        </if>
@@ -767,66 +918,95 @@
    <!--服务客户数量-->
    <select id="queryCountKh" resultType="java.util.HashMap">
        SELECT C.thisnum,
        C.lastnum,
        C.dept_id,
        d.dept_name AS deptname,
        j.dept_name AS jurname
        FROM (
        SELECT IFNULL(A.thisnum, 0) AS thisnum,
        IFNULL(B.lastnum, 0) AS lastnum,
        A.dept_id,
        A.jurisdiction
        FROM (
        SELECT COUNT
        (*) AS thisnum,
        dept_id,
        jurisdiction
        FROM sys_dispatcher_unit
        WHERE DATE_FORMAT( start_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY dept_id,
        jurisdiction
        ) A
        left JOIN (
        SELECT COUNT
        (*) AS lastnum,
        dept_id,
        jurisdiction
        FROM sys_dispatcher_unit
        WHERE PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( start_time, '%Y%m' ) ) = 1
        GROUP BY dept_id,
        jurisdiction
        ) B ON A.dept_id = B.dept_id
        ) C
        LEFT JOIN blade_dept d ON C.dept_id = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = C.jurisdiction WHERE 1=1
        SELECT
        IFNULL( A.thisnum, 0 ) AS thisnum,
        IFNULL( B.lastnum, 0 ) AS lastnum,
        IFNULL( C.num, 0 ) AS num,
        H.departmentid,
        H.jurisdiction
        FROM
        ( SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN (
        SELECT
        COUNT(*) AS thisnum,
        dept_id
        FROM
        sys_dispatcher_unit
        WHERE
        DATE_FORMAT( start_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY
        dept_id
        ) A ON H.departmentid = A.dept_id
        LEFT JOIN (
        SELECT
        COUNT(*) AS lastnum,
        dept_id
        FROM
        sys_dispatcher_unit
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( start_time, '%Y%m' ) ) = 1
        GROUP BY
        dept_id
        ) B ON H.departmentid = B.dept_id
        LEFT JOIN (
        SELECT
        COUNT(*) AS num,
        dept_id
        FROM
        sys_dispatcher_unit
        GROUP BY
        dept_id
        ) C ON H.departmentid = C.dept_id
        LEFT JOIN blade_dept d ON H.departmentid = d.id
        LEFT JOIN sys_jurisdiction j ON j.id = H.jurisdiction
        WHERE 1 =1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and C.jurisdiction =#{jurisdiction}
            and H.jurisdiction =#{jurisdiction}
        </if>
        <if test="deptid!=null and deptid!=''">
            and C.dept_id =#{deptid}
            and H.departmentid =#{deptid}
        </if>
    </select>
    <!--保安派遣数量-->
    <select id="queryCountPq" resultType="java.util.HashMap">
        SELECT IFNULL(G.thisnum, 0) AS thisnum,
        IFNULL(J.lastnum, 0) AS lastnum
        FROM (SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction) H
        SELECT
        IFNULL( G.thisnum, 0 ) AS thisnum,
        IFNULL( J.lastnum, 0 ) AS lastnum,
        IFNULL( C.num, 0 ) AS num
        FROM
        ( SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN (
        SELECT SUM(num) AS thisnum,
        SELECT
        SUM(num) AS thisnum,
        dept_id
        FROM sys_dispatcher
        WHERE DATE_FORMAT(dispatcherTime, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
        GROUP BY dept_id
        FROM
        sys_dispatcher
        WHERE
        DATE_FORMAT( dispatcherTime, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
        GROUP BY
        dept_id
        ) G ON G.dept_id = H.departmentid
        LEFT JOIN (
        SELECT SUM(num) AS lastnum,
        SELECT
        SUM(num) AS lastnum,
        dept_id
        FROM sys_dispatcher
        WHERE PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(dispatcherTime, '%Y%m')) = 1
        GROUP BY dept_id
        FROM
        sys_dispatcher
        WHERE
        PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( dispatcherTime, '%Y%m' ) ) = 1
        GROUP BY
        dept_id
        ) J ON J.dept_id = H.departmentid
        LEFT JOIN (
        SELECT
        SUM(num) AS num,
        dept_id
        FROM
        sys_dispatcher
        GROUP BY
        dept_id
        ) C ON C.dept_id = H.departmentid
        WHERE 1 = 1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
            and H.jurisdiction =#{jurisdiction}
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -102,7 +102,21 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入permit")
    public R<IPage<PermitVO>> page(PermitVO permit, Query query) {
        IPage<PermitVO> pages = permitService.selectPermitPage(Condition.getPage(query), permit);
        IPage<PermitVO> pages;
        if (permit.getUsetype().equals("0")) {
            pages = permitService.selectPermitPage(Condition.getPage(query), permit, null);
        } else if (permit.getUsetype().equals("1")) {
            String childer = informationService.selJurchilder(permit.getJurisdiction());
            String[] split = childer.split(",");
            String strArrays = "";
            for (int j = 0; j < split.length; j++) {
                strArrays += "'" + split[j] + "',";
            }
            String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
            pages = permitService.selectPermitPage(Condition.getPage(query), permit, jurisdiction);
        } else {
            pages = permitService.selectPermitPage(Condition.getPage(query), permit, null);
        }
        return R.data(pages);
    }
src/main/java/org/springblade/modules/permit/entity/Permit.java
@@ -64,12 +64,12 @@
     */
    @ApiModelProperty(value = "成立日期")
    @TableField("establishTime")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date establishtime;
    @ApiModelProperty(value = "提交时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date permitime;
    /**
@@ -143,4 +143,9 @@
    private String approve;
    private String jurisdiction;
    @ApiModelProperty(value = "审批时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date overtime;
}
src/main/java/org/springblade/modules/permit/mapper/PermitMapper.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.permit.entity.Permit;
import org.springblade.modules.permit.vo.PermitVO;
@@ -38,6 +39,6 @@
     * @param permit
     * @return
     */
    List<PermitVO> selectPermitPage(IPage page, PermitVO permit);
    List<PermitVO> selectPermitPage(IPage page, @Param("permit") PermitVO permit, String jurisdiction);
}
src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml
@@ -34,7 +34,16 @@
    <select id="selectPermitPage" resultMap="permitResultMap">
        select * from sys_permit
        select * from sys_permit where 1=1
        <if test="permit.ptype!=null and permit.ptype!=''">
            and  ptype=#{permit.ptype}
        </if>
        <if test="permit.usetype=='1'.toString()">
            and jurisdiction in(${jurisdiction})
        </if>
        <if test="permit.usetype=='2'.toString()">
            and  jurisdiction=#{permit.jurisdiction}
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/permit/service/IPermitService.java
@@ -36,6 +36,6 @@
     * @param permit
     * @return
     */
    IPage<PermitVO> selectPermitPage(IPage<PermitVO> page, PermitVO permit);
    IPage<PermitVO> selectPermitPage(IPage<PermitVO> page, PermitVO permit, String jurisdiction);
}
src/main/java/org/springblade/modules/permit/service/impl/PermitServiceImpl.java
@@ -34,8 +34,8 @@
public class PermitServiceImpl extends ServiceImpl<PermitMapper, Permit> implements IPermitService {
    @Override
    public IPage<PermitVO> selectPermitPage(IPage<PermitVO> page, PermitVO permit) {
        return page.setRecords(baseMapper.selectPermitPage(page, permit));
    public IPage<PermitVO> selectPermitPage(IPage<PermitVO> page, PermitVO permit, String jurisdiction) {
        return page.setRecords(baseMapper.selectPermitPage(page, permit,jurisdiction));
    }
}
src/main/java/org/springblade/modules/permit/vo/PermitVO.java
@@ -32,5 +32,5 @@
@ApiModel(value = "PermitVO对象", description = "PermitVO对象")
public class PermitVO extends Permit {
    private static final long serialVersionUID = 1L;
    private String usetype;
}
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -99,7 +99,22 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入record")
    public R<IPage<RecordVO>> page(RecordVO record, Query query) {
        IPage<RecordVO> pages = recordService.selectRecordPage(Condition.getPage(query), record);
        IPage<RecordVO> pages;
        if (record.getUsetype().equals("0")) {
            pages = recordService.selectRecordPage(Condition.getPage(query), record, null);
        } else if (record.getUsetype().equals("1")) {
            String childer = informationService.selJurchilder(record.getJurisdiction());
            String[] split = childer.split(",");
            String strArrays = "";
            for (int j = 0; j < split.length; j++) {
                strArrays += "'" + split[j] + "',";
            }
            String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
            pages = recordService.selectRecordPage(Condition.getPage(query), record, jurisdiction);
        } else {
            pages = recordService.selectRecordPage(Condition.getPage(query), record, null);
        }
        return R.data(pages);
    }
src/main/java/org/springblade/modules/record/mapper/RecordMapper.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.record.entity.Record;
import org.springblade.modules.record.vo.RecordVO;
@@ -38,6 +39,6 @@
     * @param record
     * @return
     */
    List<RecordVO> selectRecordPage(IPage page, RecordVO record);
    List<RecordVO> selectRecordPage(IPage page, @Param("record") RecordVO record, String jurisdiction);
}
src/main/java/org/springblade/modules/record/mapper/RecordMapper.xml
@@ -41,7 +41,16 @@
    <select id="selectRecordPage" resultMap="recordResultMap">
        select * from sys_record
        select * from sys_record where 1=1
        <if test="record.ptype!=null and record.ptype!=''">
            and  ptype=#{permit.ptype}
        </if>
        <if test="record.usetype=='1'.toString()">
            and jurisdiction in(${jurisdiction})
        </if>
        <if test="record.usetype=='2'.toString()">
            and  jurisdiction=#{permit.jurisdiction}
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/record/service/IRecordService.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.record.entity.Record;
import org.springblade.modules.record.vo.RecordVO;
@@ -36,6 +37,6 @@
     * @param record
     * @return
     */
    IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, RecordVO record);
    IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, @Param("record") RecordVO record, String jurisdiction);
}
src/main/java/org/springblade/modules/record/service/impl/RecordServiceImpl.java
@@ -34,8 +34,8 @@
public class RecordServiceImpl extends ServiceImpl<RecordMapper, Record> implements IRecordService {
    @Override
    public IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, RecordVO record) {
        return page.setRecords(baseMapper.selectRecordPage(page, record));
    public IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, RecordVO record,String jurisdiction) {
        return page.setRecords(baseMapper.selectRecordPage(page, record,jurisdiction));
    }
}
src/main/java/org/springblade/modules/record/vo/RecordVO.java
@@ -32,5 +32,5 @@
@ApiModel(value = "RecordVO对象", description = "RecordVO对象")
public class RecordVO extends Record {
    private static final long serialVersionUID = 1L;
private  String usetype;
}
src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
@@ -27,6 +27,7 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.recordk.entity.Recordk;
import org.springblade.modules.revoke.entity.Revoke;
import org.springblade.modules.revoke.service.IRevokeService;
@@ -51,7 +52,7 @@
public class RevokeController extends BladeController {
    private final IRevokeService revokeService;
    private final IInformationService informationService;
    /**
     * 详情
     */
@@ -81,7 +82,22 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入revoke")
    public R<IPage<RevokeVO>> page(RevokeVO revoke, Query query) {
        IPage<RevokeVO> pages = revokeService.selectRevokePage(Condition.getPage(query), revoke);
        IPage<RevokeVO> pages;
        if (revoke.getUsetype().equals("0")) {
            pages = revokeService.selectRevokePage(Condition.getPage(query), revoke,null);
        } else if (revoke.getUsetype().equals("1")) {
            String childer = informationService.selJurchilder(revoke.getJurisdiction());
            String[] split = childer.split(",");
            String strArrays = "";
            for (int j = 0; j < split.length; j++) {
                strArrays += "'" + split[j] + "',";
            }
            String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
            pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,jurisdiction);
        } else {
            pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,null);
        }
        return R.data(pages);
    }
src/main/java/org/springblade/modules/revoke/mapper/RevokeMapper.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.revoke.entity.Revoke;
import org.springblade.modules.revoke.vo.RevokeVO;
@@ -38,6 +39,6 @@
     * @param revoke
     * @return
     */
    List<RevokeVO> selectRevokePage(IPage page, RevokeVO revoke);
    List<RevokeVO> selectRevokePage(IPage page, @Param("revoke") RevokeVO revoke, String jurisdiction);
}
src/main/java/org/springblade/modules/revoke/service/IRevokeService.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.revoke.entity.Revoke;
import org.springblade.modules.revoke.vo.RevokeVO;
@@ -36,6 +37,6 @@
     * @param revoke
     * @return
     */
    IPage<RevokeVO> selectRevokePage(IPage<RevokeVO> page, RevokeVO revoke);
    IPage<RevokeVO> selectRevokePage(IPage<RevokeVO> page, @Param("revoke") RevokeVO revoke, String jurisdiction);
}
src/main/java/org/springblade/modules/revoke/service/impl/RevokeServiceImpl.java
@@ -34,8 +34,8 @@
public class RevokeServiceImpl extends ServiceImpl<RevokeMapper, Revoke> implements IRevokeService {
    @Override
    public IPage<RevokeVO> selectRevokePage(IPage<RevokeVO> page, RevokeVO revoke) {
        return page.setRecords(baseMapper.selectRevokePage(page, revoke));
    public IPage<RevokeVO> selectRevokePage(IPage<RevokeVO> page, RevokeVO revoke,String jurisdiction) {
        return page.setRecords(baseMapper.selectRevokePage(page, revoke,jurisdiction));
    }
}
src/main/java/org/springblade/modules/revoke/vo/RevokeVO.java
@@ -32,5 +32,5 @@
@ApiModel(value = "RevokeVO对象", description = "RevokeVO对象")
public class RevokeVO extends Revoke {
    private static final long serialVersionUID = 1L;
private  String usetype;
}