huanghongfa
2021-06-30 a0cc3e3df8f9ed5bdb0d84f71f90879c27873af5
综治app-首页待处理,统计模块
2个文件已修改
190 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml
@@ -153,61 +153,128 @@
    <select id="getGridTodoData" resultType="com.panzhihua.common.model.vos.grid.UserEventGridDataVO"
        parameterType="com.panzhihua.common.model.dtos.grid.EventGridTodoDataDTO">
        SELECT IFNULL(SUM(t.todoNums), 0) todoNums, 1 event_type
        FROM (
        SELECT  IFNULL(count(e.id), 0) as todoNums
        FROM EVENT  e
        WHERE e.event_category = 1 AND event_status = 2
        AND (event_process_status = 1 OR event_process_status=3) AND process_type = 1
        AND grid_id = #{eventGridTodoDataDTO.gridId}
        AND e.event_type = 1
        GROUP BY e.event_type
        ) t
        UNION ALL
        SELECT IFNULL(SUM(t.todoNums), 0) todoNums, 2 event_type
        FROM (
        SELECT  IFNULL(count(e.id), 0) as todoNums
        FROM EVENT  e
        WHERE e.event_category = 1 AND event_status = 2
        AND (event_process_status = 1 OR event_process_status=3) AND process_type = 1
        AND grid_id = #{eventGridTodoDataDTO.gridId}
        AND e.event_type =2
        GROUP BY e.event_type
        ) t
        UNION ALL
        SELECT IFNULL(SUM(t.todoNums), 0) todoNums, 3 event_type
        FROM (
        SELECT  IFNULL(count(e.id), 0) as todoNums
        FROM EVENT  e
        WHERE e.event_category = 1 AND event_status = 2
        AND (event_process_status = 1 OR event_process_status=3) AND process_type = 1
        AND grid_id = #{eventGridTodoDataDTO.gridId}
        AND e.event_type =3
        GROUP BY e.event_type
        ) t
        UNION ALL
        SELECT IFNULL(SUM(t.todoNums), 0) todoNums, 4 event_type
        FROM (
        SELECT  IFNULL(count(e.id), 0) as todoNums
        FROM EVENT  e
        WHERE e.event_category = 1 AND event_status = 2
        AND (event_process_status = 1 OR event_process_status=3) AND process_type = 1
        AND grid_id = #{eventGridTodoDataDTO.gridId}
        AND e.event_type =4
        GROUP BY e.event_type
        ) t
        UNION ALL
        SELECT IFNULL(SUM(t.todoNums), 0) todoNums, 5 event_type
        FROM (
        SELECT  IFNULL(count(e.id), 0) as todoNums
        FROM EVENT  e
        WHERE e.event_category = 1 AND event_status = 2
        AND (event_process_status = 1 OR event_process_status=3) AND process_type = 1
        AND grid_id = #{eventGridTodoDataDTO.gridId}
        AND e.event_type =5
        GROUP BY e.event_type
        ) t
        SELECT
            IFNULL( SUM( t.todoNums ), 0 ) todoNums,
            1 event_type
        FROM
            (
            SELECT
                IFNULL( count( e.id ), 0 ) AS todoNums
            FROM
                EVENT e
            WHERE
                e.event_category = 1
                AND event_status = 2
                AND ( event_process_status = 1 OR event_process_status = 3 )
                AND process_type = 1
                AND grid_id = #{eventGridTodoDataDTO.gridId}
                AND e.event_type = 1
            GROUP BY
                e.event_type
            ) t UNION ALL
        SELECT
            IFNULL( SUM( t.todoNums ), 0 ) todoNums,
            2 event_type
        FROM
            (
            SELECT
                IFNULL( count( e.id ), 0 ) AS todoNums
            FROM
                EVENT e
            WHERE
                e.event_category = 1
                AND event_status = 2
                AND ( event_process_status = 1 OR event_process_status = 3 )
                AND process_type = 1
                AND grid_id = #{eventGridTodoDataDTO.gridId}
                AND e.event_type = 2
            GROUP BY
                e.event_type
            ) t UNION ALL
        SELECT
            IFNULL( SUM( t.todoNums ), 0 ) todoNums,
            3 event_type
        FROM
            (
            SELECT
                IFNULL( count( e.id ), 0 ) AS todoNums
            FROM
                EVENT e
            WHERE
                e.event_category = 1
                AND event_status = 2
                AND ( event_process_status = 1 OR event_process_status = 3 )
                AND process_type = 1
                AND grid_id = #{eventGridTodoDataDTO.gridId}
                AND e.event_type = 3
            GROUP BY
                e.event_type
            ) t UNION ALL
        SELECT
            IFNULL( SUM( t.todoNums ), 0 ) todoNums,
            4 event_type
        FROM
            (
            SELECT
                IFNULL( count( e.id ), 0 ) AS todoNums
            FROM
                EVENT e
            WHERE
                e.event_category = 1
                AND event_status = 2
                AND ( event_process_status = 1 OR event_process_status = 3 )
                AND process_type = 1
                AND grid_id = #{eventGridTodoDataDTO.gridId}
                AND e.event_type = 4
            GROUP BY
                e.event_type
            ) t UNION ALL
        SELECT
            IFNULL( SUM( t.todoNums ), 0 ) todoNums,
            5 event_type
        FROM
            (
            SELECT
                IFNULL( count( e.id ), 0 ) AS todoNums
            FROM
                EVENT e
            WHERE
                e.event_category = 1
                AND event_status = 2
                AND ( event_process_status = 1 OR event_process_status = 3 )
                AND process_type = 1
                AND grid_id = #{eventGridTodoDataDTO.gridId}
                AND e.event_type = 5
            GROUP BY
                e.event_type
            ) t UNION ALL
        SELECT
            IFNULL( count( e.id ), 0 ) AS todoNums
            6 AS event_type
        FROM
            `event` AS e
        WHERE
            e.event_category = 1
            AND e.event_type = 6
            AND event_status = 2
            AND ( event_process_status = 1 OR event_process_status = 3 )
            AND grid_id = #{eventGridTodoDataDTO.gridId} UNION ALL
        SELECT
            IFNULL( count( cmp.id ), 0 ) AS todoNums,
            8 AS event_type
        FROM
            com_mng_population AS cmp
            LEFT JOIN event_grid_data AS egd ON egd.grid_community_id = cmp.act_id
        WHERE
            egd.id = #{eventGridTodoDataDTO.gridId} UNION ALL
        SELECT
            IFNULL( count( id ), 0 ) AS todoNums,
            9 AS event_type
        FROM
            event_visiting_tasks
        WHERE
            event_status = 1
            OR event_status = 3
    </select>
    <select id="getComActByActId" resultType="com.panzhihua.common.model.vos.grid.ComGridActVO">
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml
@@ -614,7 +614,18 @@
                AND grid_id = #{gridId}
            </if>
            ) AS todaySpecialTotal,
            ( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_status = 2 AND event_process_status = 2 ) AS specialTotal
            ( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_status = 2 AND event_process_status = 2 ) AS specialTotal,
            (
            SELECT
                count( cmph.id )
            FROM
                com_mng_population_house AS cmph
            LEFT JOIN event_grid_data AS egd ON egd.grid_community_id = cmp.community_id
            WHERE
                <if test="gridId!=null">
                    egd.id = #{gridId}
                </if>
            ) AS houseTotal
        FROM
            `event`
        WHERE