CeDo
2021-06-03 302d51ec3c223fd32c746d6bc163a840225b6f46
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml
@@ -172,10 +172,61 @@
    <select id="getGridTodoData" resultType="com.panzhihua.common.model.vos.grid.UserEventGridDataVO"
      parameterType="com.panzhihua.common.model.dtos.grid.EventGridTodoDataDTO">
      SELECT e.event_category , COUNT(*) as todoNums
      SELECT IFNULL(SUM(t.todoNums), 0), 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 and process_type = 1  AND grid_id = #{eventGridTodoDataDTO.gridId}
      GROUP BY e.event_category
      WHERE e.event_category = 1 AND event_status = 2
      AND event_process_status = 1 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), 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 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), 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 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), 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 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), 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 AND process_type = 1
      AND grid_id = #{eventGridTodoDataDTO.gridId}
      AND e.event_type =5
      GROUP BY e.event_type
      ) t
   </select>
</mapper>