罗元桥
2021-12-14 ecde7a30a43e3d45be2f0f9e271d0abf02c7d58e
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml
@@ -1376,5 +1376,37 @@
           left join com_mng_population AS cmp on cmp.id = cmpct.population_id
      where cmtct.label is not null and cmp.village_id = #{villageId} and floor = #{floor}
   </select>
    <select id="selectComprehensiveGovernanceStatics"
            resultType="com.panzhihua.common.model.vos.community.screen.event.EventComprehensiveGovernanceStatisticsVO">
      SELECT
      (SELECT COUNT( e.id ) FROM `event` AS e
      LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
      LEFT JOIN com_act AS a ON egd.grid_community_id = a.community_id
      WHERE e.event_category = 1 AND e.event_type = 5 AND e.event_deal_status = 4 AND a.area_code = 510423) AS eventTFTotal,
      (SELECT COUNT( e1.id ) FROM `event` AS e1
      LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id
      LEFT JOIN com_act AS a1 ON egd1.grid_community_id = a1.community_id
      WHERE event_category = 1 AND event_type = 1 AND e1.event_deal_status = 4 AND a1.area_code = 510423) AS eventZATotal,
      (SELECT COUNT( e2.id ) FROM `event` AS e2
      LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id
      LEFT JOIN com_act AS a2 ON egd2.grid_community_id = a2.community_id
      WHERE event_category = 1 AND event_type = 3 AND e2.event_deal_status = 4 AND a2.area_code = 510423) AS eventMDTotal,
      (SELECT COUNT( e3.id ) FROM `event` AS e3
      LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id
      LEFT JOIN com_act AS a3 ON egd3.grid_community_id = a3.community_id
      WHERE event_category = 1 AND event_type = 6 AND e3.event_deal_status = 4 AND a3.area_code = 510423) AS eventTSTotal,
      (SELECT COUNT( e5.id ) FROM `event` AS e5
      LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id
      LEFT JOIN com_act AS a5 ON egd5.grid_community_id = a5.community_id
      WHERE event_category = 1 AND event_type = 2 AND e5.event_deal_status = 4 AND a5.area_code = 510423) AS eventMSTotal,
      (SELECT COUNT(p.id) FROM com_act_easy_photo p
      LEFT JOIN com_act AS a ON p.community_id = a.community_id
      WHERE p.`status` = 4 AND p.del_tag = 0 AND a.area_code = 510423) AS eventSSPTotal
   </select>
</mapper>