浏览代码

事件中心, 按照18中算法统计事件数量

Memory_LG 1 月之前
父节点
当前提交
4f68345c72

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

@@ -206,4 +206,12 @@ public class CenterEventViewController extends BaseController {
     public AjaxResult deleteCollect(@RequestBody CentereventTEventCollect centereventTEventCollect){
         return toAjax(centereventTEventCollectService.deleteCentereventTEventCollectById(centereventTEventCollect.getId()));
     }
+
+    /**
+     * 算法统计
+     */
+    @GetMapping("/getCountByAlgorithm")
+    public AjaxResult getCountByAlgorithm(){
+        return centerEventViewService.getCountByAlgorithm();
+    }
 }

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

@@ -1,5 +1,6 @@
 package com.sooka.sponest.event.centereventteventcatalogue.mapper;
 
+import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudExposureStageBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudMapEventListBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudTodayEventsBO;
@@ -42,4 +43,6 @@ public interface CenterEventViewMapper {
     Map<String, Object> getHousingConstructionEventCount(VisuForestCloudMapVO visuForestCloudMapVO);
 
     List<VisuForestCloudMapEventListBO> getHousingConstructionEventList(VisuForestCloudMapVO visuForestCloudMapVO);
+
+    List<Map<String, Object>> getCountByAlgorithm();
 }

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

@@ -1,5 +1,6 @@
 package com.sooka.sponest.event.centereventteventcatalogue.service;
 
+import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudExposureStageBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudMapEventListBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudTodayEventsBO;
@@ -42,4 +43,6 @@ public interface ICenterEventViewService {
     Map<String, Object> getHousingConstructionEventCount(VisuForestCloudMapVO visuForestCloudMapVO);
 
     List<VisuForestCloudMapEventListBO> getHousingConstructionEventList(VisuForestCloudMapVO visuForestCloudMapVO);
+
+    AjaxResult getCountByAlgorithm();
 }

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

@@ -3,6 +3,7 @@ package com.sooka.sponest.event.centereventteventcatalogue.service.impl;
 import com.ruoyi.common.core.utils.SpringUtils;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.file.FilePrefixUtils;
+import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.datascope.base.service.BaseService;
 import com.ruoyi.common.security.utils.SecurityUtils;
@@ -329,4 +330,9 @@ public class CenterEventViewServiceImpl extends BaseService implements ICenterEv
         });
         return result;
     }
+
+    @Override
+    public AjaxResult getCountByAlgorithm() {
+        return centerEventViewMapper.getCountByAlgorithm();
+    }
 }

+ 35 - 0
src/main/resources/mapper/centereventteventcatalogue/CenterEventViewMapper.xml

@@ -511,4 +511,39 @@
             </if>
         </where>
     </select>
+
+    <select id="getCountByAlgorithm" resultType="map">
+        SELECT
+            CASE
+                WHEN original.id IN (505, 506) THEN '水位尺水位检测算法'
+                ELSE original.event_type_name
+                END AS eventTypeName,
+            SUM(original.countSum) AS countSum
+        FROM (
+                 SELECT
+                     a.id,
+                     a.event_type_name,
+                     IFNULL(COUNT(1), 0) AS countSum
+                 FROM
+                     (
+                         SELECT *
+                         FROM centerevent_t_eventtype
+                         WHERE id IN (221, 222, 223, 507, 505, 506, 227, 286, 218, 1002, 224, 201, 202, 212, 243, 246, 503, 204, 203)
+                     ) a
+                         LEFT JOIN
+                     (
+                         SELECT *
+                         FROM centerevent_t_eventcatalogue
+                         WHERE event_type_xl IN (221, 222, 223, 507, 505, 506, 227, 286, 218, 1002, 224, 201, 202, 212, 243, 246, 503, 204, 203)
+                         AND event_status_value not in ('forest_event_status_3', 'forest_event_status_4')
+                     ) b
+                     ON a.id = b.event_type_xl
+                 GROUP BY a.id
+             ) AS original
+        GROUP BY
+            CASE
+                WHEN original.id IN (505, 506) THEN '水位尺水位检测算法'
+                ELSE original.event_type_name
+                END
+    </select>
 </mapper>