| | |
| | | |
| | | <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> |