Browse Source

住建事件统计

lyq 1 year ago
parent
commit
10908f592a

+ 11 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CenterEventViewController.java

@@ -139,6 +139,17 @@ public class CenterEventViewController extends BaseController {
     }
 
     /**
+     * 住建事件统计
+     *
+     * @param visuForestCloudMapVO
+     * @return
+     */
+    @PostMapping("/getHousingConstructionEventCount")
+    public R getHousingConstructionEventCount(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
+        return R.ok(centerEventViewService.getHousingConstructionEventCount(visuForestCloudMapVO));
+    }
+
+    /**
      * 住建事件列表
      *
      * @param visuForestCloudMapVO

+ 2 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CenterEventViewMapper.java

@@ -36,5 +36,7 @@ public interface CenterEventViewMapper {
 
     List<VisuForestCloudMapEventListBO> listAll(VisuForestCloudMapVO visuForestCloudMapVO);
 
+    Map<String, Object> getHousingConstructionEventCount(VisuForestCloudMapVO visuForestCloudMapVO);
+
     List<VisuForestCloudMapEventListBO> getHousingConstructionEventList(VisuForestCloudMapVO visuForestCloudMapVO);
 }

+ 2 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICenterEventViewService.java

@@ -36,5 +36,7 @@ public interface ICenterEventViewService {
 
     List<VisuForestCloudMapEventListBO> listAll(VisuForestCloudMapVO visuForestCloudMapVO);
 
+    Map<String, Object> getHousingConstructionEventCount(VisuForestCloudMapVO visuForestCloudMapVO);
+
     List<VisuForestCloudMapEventListBO> getHousingConstructionEventList(VisuForestCloudMapVO visuForestCloudMapVO);
 }

+ 5 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CenterEventViewServiceImpl.java

@@ -304,6 +304,11 @@ public class CenterEventViewServiceImpl extends BaseService implements ICenterEv
     }
 
     @Override
+    public Map<String, Object> getHousingConstructionEventCount(VisuForestCloudMapVO visuForestCloudMapVO) {
+        return centerEventViewMapper.getHousingConstructionEventCount(visuForestCloudMapVO);
+    }
+
+    @Override
     public List<VisuForestCloudMapEventListBO> getHousingConstructionEventList(VisuForestCloudMapVO visuForestCloudMapVO) {
         List<VisuForestCloudMapEventListBO> result = centerEventViewMapper.getHousingConstructionEventList(visuForestCloudMapVO);
         if (StringUtils.isEmpty(result)) {

+ 29 - 3
src/main/resources/mapper/centereventteventcatalogue/CenterEventViewMapper.xml

@@ -8,7 +8,8 @@
         select
         count( event_status_value in ('forest_event_status_1','forest_event_status_7') OR NULL ) newReport,
         count( event_status_value = 'forest_event_status_2' OR NULL) readySure,
-        count( event_status_value = 'forest_event_status_5' OR event_status_value = 'forest_event_status_6' OR NULL ) readyFinish,
+        count( event_status_value = 'forest_event_status_5' OR event_status_value = 'forest_event_status_6' OR NULL )
+        readyFinish,
         count( report_source in ('reporting_source_1','reporting_source_4') OR NULL ) aiTotal,
         count( report_source in ('reporting_source_2','reporting_source_3') OR NULL ) otherTotal
         from (select a.* from (
@@ -53,8 +54,10 @@
 
     <select id="selectDeptEventCount" parameterType="VisuForestCloudMapVO"
             resultType="VisuForestCloudMapDeptEventCountBO">
-        select t.deptId,replace( group_concat( dept_name order by find_in_set( d.dept_id, t.ancestors ) ), ',', '' ) deptName,t.eventCount from (
-        select a.dept_id deptId,count(*) eventCount,concat( replace( c.ancestors, '0,100', '' ), ',', c.dept_id ) ancestors from (
+        select t.deptId,replace( group_concat( dept_name order by find_in_set( d.dept_id, t.ancestors ) ), ',', '' )
+        deptName,t.eventCount from (
+        select a.dept_id deptId,count(*) eventCount,concat( replace( c.ancestors, '0,100', '' ), ',', c.dept_id )
+        ancestors from (
         <if test="isHgj != null and isHgj == 'false'">
             select distinct e.event_code,de.dept_id from centerevent_t_eventcatalogue e
             left join centerevent_t_dept_event de on de.event_code = e.event_code
@@ -427,6 +430,27 @@
         order by create_time desc
     </select>
 
+    <select id="getHousingConstructionEventCount" parameterType="VisuForestCloudMapVO" resultType="map">
+        select * from (
+        select count(*) label_1 from centerevent_t_eventcatalogue
+        where event_status_value in
+        ('forest_event_status_7','forest_event_status_2','forest_event_status_5','forest_event_status_6' )
+        and YEARWEEK( create_time ) = YEARWEEK( CURDATE() )
+        <if test="createBy != null and createBy != ''">
+            and create_by in ( ${createBy} )
+        </if>
+        and event_type = 1) a, (
+        select sum(event_type_xl in ( '1201','1202','1203','1204','1205' )) label_2, 0 label_3, sum(event_type_xl in (
+        '1206','1207' )) label_4
+        from (
+        select event_type_xl from centerevent_t_eventcatalogue
+        where YEARWEEK( create_time ) = YEARWEEK( CURDATE() )
+        <if test="deptId != null and deptId != ''">
+            and create_by = #{deptId}
+        </if>
+        and event_type = 12) t) b
+    </select>
+
     <select id="getHousingConstructionEventList" parameterType="VisuForestCloudMapVO"
             resultType="VisuForestCloudMapEventListBO">
         select event_code eventCode,event_name eventName,longitude,latitude,reportor,event_status
@@ -438,6 +462,8 @@
             and create_by in ( ${createBy} )
         </if>
         <if test="eventTypeIdDl != null and eventTypeIdDl.length > 0">
+            and event_status_value in (
+            'forest_event_status_7','forest_event_status_2','forest_event_status_5','forest_event_status_6' )
             and event_type in
             <foreach item="eventTypeIdDl" collection="eventTypeIdDl" open="(" separator="," close=")">
                 #{eventTypeIdDl}