Explorar o código

消防 应急 林业 中台sql变化

朴弘宇 hai 1 ano
pai
achega
f4b651bef9

+ 17 - 0
src/main/java/com/sooka/sponest/data/digitalfirecontrol/controller/FireControlBigDataController.java

@@ -23,6 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.util.List;
+
 /**
  * @Auther: mjq
  * @Date: 2023/5/12 - 05 - 12 - 9:25
@@ -164,4 +166,19 @@ public class FireControlBigDataController extends BaseController {
     public R selectKeyLocations(@RequestBody DataVisuFireCloudMapVO dataVisuFireCloudMapVO){
         return R.ok(iFireControlBigDataService.selectKeyLocations(dataVisuFireCloudMapVO));
     }
+
+    /**
+     * 消防资源统计
+     *
+     * @author phy
+     * @date  2024-01-16
+     */
+    @ApiOperation(value = "消防资源统计", notes = "消防资源统计")
+    @PostMapping("/selectAllResource")
+    public R selectAllResource(@RequestBody DataVisuFireCloudMapVO dataVisuFireCloudMapVO){
+        VisuForestCloudMapVO visuForestCloudMapVO = new VisuForestCloudMapVO();
+        List list = iFireControlBigDataService.selectAllResource(dataVisuFireCloudMapVO);
+        list.addAll(iFireControlBigDataService.geFireControltTotal(visuForestCloudMapVO));
+        return R.ok(list);
+    }
 }

+ 7 - 0
src/main/java/com/sooka/sponest/data/digitalfirecontrol/mapper/FireControlBigDataMapper.java

@@ -90,4 +90,11 @@ public interface FireControlBigDataMapper {
      */
     List<Map<String, Object>> selectKeyLocations(DataVisuFireCloudMapVO dataVisuFireCloudMapVO);
 
+    /**
+     * 消防资源统计
+     *
+     * @author phy
+     * @date  2024-01-16
+     */
+    List<Map<String, Object>> selectAllResource(DataVisuFireCloudMapVO dataVisuFireCloudMapVO);
 }

+ 8 - 0
src/main/java/com/sooka/sponest/data/digitalfirecontrol/service/IFireControlBigDataService.java

@@ -90,4 +90,12 @@ public interface IFireControlBigDataService {
     */
     List<Map<String,Object>> selectKeyLocations(DataVisuFireCloudMapVO dataVisuFireCloudMapVO);
 
+    /**
+     * 消防资源统计
+     *
+     * @author phy
+     * @date  2024-01-16
+     */
+    List<Map<String,Object>> selectAllResource(DataVisuFireCloudMapVO dataVisuFireCloudMapVO);
+
 }

+ 13 - 0
src/main/java/com/sooka/sponest/data/digitalfirecontrol/service/impl/FireControlBigDataServiceImpl.java

@@ -183,4 +183,17 @@ public class FireControlBigDataServiceImpl extends BaseServiceImpl implements IF
         List<Map<String,Object>> list = fireControlBigDataMapper.selectKeyLocations(dataVisuFireCloudMapVO);
         return deptLevelUtil.getDeptLevel(list,String.valueOf(dataVisuFireCloudMapVO.getDeptId()));
     }
+
+    /**
+     * 消防资源统计
+     *
+     * @author phy
+     * @date  2024-01-16
+     */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> selectAllResource(DataVisuFireCloudMapVO dataVisuFireCloudMapVO) {
+        setSookaDataBase(dataVisuFireCloudMapVO);
+        return fireControlBigDataMapper.selectAllResource(dataVisuFireCloudMapVO);
+    }
 }

+ 18 - 0
src/main/java/com/sooka/sponest/data/digitalforest/controller/ForestBigDataController.java

@@ -5,6 +5,8 @@ import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
+import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyEnterprises;
+import com.sooka.sponest.data.digitalemergency.domain.bo.VisuEmergencyCenterDataCountBO;
 import com.sooka.sponest.data.digitalforest.domain.*;
 import com.sooka.sponest.data.digitalforest.domain.vo.CenterdataTForestGridLevelVo;
 import com.sooka.sponest.data.digitalforest.service.IForestBigDataService;
@@ -55,6 +57,22 @@ public class ForestBigDataController extends BaseController {
         return R.ok(forestBigDataService.getTotal(visuForestCloudMapVO));
     }
 
+    /**
+     * 查询数据中台所有资源
+     *
+     * @param
+     * @return
+     * @Version 1.0
+     * @author phy
+     */
+    @ApiOperation(value = "查询所有资源",notes = "查询所有资源")
+    @PostMapping("/getForestResourceCount")
+    public R<List<VisuForestCloudMapVO>>getForestResourceCount(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
+        List list = forestBigDataService.getForestResourceCount(visuForestCloudMapVO);
+        list.addAll(forestBigDataService.getTotal(visuForestCloudMapVO));
+        return R.ok(list);
+    }
+
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "areaType", value = "区域类型", dataType = "String", required = true, paramType = "body")
     })

+ 3 - 0
src/main/java/com/sooka/sponest/data/digitalforest/mapper/ForestBigDataMapper.java

@@ -2,6 +2,7 @@ package com.sooka.sponest.data.digitalforest.mapper;
 
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
+import com.sooka.sponest.data.digitalfirecontrol.domain.vo.DataVisuFireCloudMapVO;
 import com.sooka.sponest.data.digitalforest.domain.*;
 import com.sooka.sponest.data.digitalforest.domain.bo.CenterdataTForestPlanTj;
 import com.sooka.sponest.data.digitalforest.domain.bo.GridUserGwCount;
@@ -26,6 +27,8 @@ public interface ForestBigDataMapper {
 
     List<Map<String, Object>> getTotal(VisuForestCloudMapVO visuForestCloudMapVO);
 
+    List<Map<String, Object>> getForestResourceCount(VisuForestCloudMapVO visuForestCloudMapVO);
+
     List<VisuForestCloudEventTypeBO> selectBigDataImportareaDeptCount(CenterdataTForestImportarea centerdataTForestImportarea);
 
     List<VisuForestCloudEventTypeBO> selectBigDataTreesDeptCount(CenterdataTForestTrees centerdataTForestTrees);

+ 3 - 0
src/main/java/com/sooka/sponest/data/digitalforest/service/IForestBigDataService.java

@@ -3,6 +3,7 @@ package com.sooka.sponest.data.digitalforest.service;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
+import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyEnterprises;
 import com.sooka.sponest.data.digitalforest.domain.*;
 import com.sooka.sponest.data.digitalforest.domain.bo.VisuForestCloudEventTypeBO;
 import com.sooka.sponest.data.digitalforest.domain.vo.CenterdataTForestGridLevelVo;
@@ -25,6 +26,8 @@ public interface IForestBigDataService {
 
     List<Map<String, Object>> getTotal(VisuForestCloudMapVO visuForestCloudMapVO);
 
+    List getForestResourceCount(VisuForestCloudMapVO visuForestCloudMapVO);
+
     List<VisuForestCloudEventTypeBO> selectBigDataImportareaDeptCount(CenterdataTForestImportarea centerdataTForestImportarea);
 
     List<VisuForestCloudEventTypeBO> selectBigDataTreesDeptCount(CenterdataTForestTrees centerdataTForestTrees);

+ 8 - 0
src/main/java/com/sooka/sponest/data/digitalforest/service/impl/ForestBigDataServiceImpl.java

@@ -8,6 +8,8 @@ import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
+import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyMaterial;
+import com.sooka.sponest.data.digitalfirecontrol.domain.vo.DataVisuFireCloudMapVO;
 import com.sooka.sponest.data.digitalforest.domain.*;
 import com.sooka.sponest.data.digitalforest.domain.bo.GridUserGwCount;
 import com.sooka.sponest.data.digitalforest.domain.bo.VisuForestCloudEventTypeBO;
@@ -53,6 +55,12 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
     }
     @DataScopeMutiDept(deptAlias = "d")
     @Override
+    public List<Map<String,Object>> getForestResourceCount(VisuForestCloudMapVO visuForestCloudMapVO) {
+        setSookaDataBase(visuForestCloudMapVO);
+        return forestBigDataMapper.getForestResourceCount(visuForestCloudMapVO);
+    }
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
     public List<VisuForestCloudEventTypeBO> selectBigDataImportareaDeptCount(CenterdataTForestImportarea centerdataTForestImportarea) {
         setSookaDataBase(centerdataTForestImportarea);
         return forestBigDataMapper.selectBigDataImportareaDeptCount(centerdataTForestImportarea);

+ 18 - 0
src/main/resources/mapper/digitalfirecontrol/FireControlBigDataMapper.xml

@@ -190,4 +190,22 @@
         WHERE 1=1 ${params.dataScope}
         GROUP BY a.dept_id
     </select>
+
+    <select id="selectAllResource" resultType="java.util.Map">
+        select '重点场所' name,count(*) value from centerdata_t_firecontrol_fire_key_places a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '压力传感器' name,count(*) value from centerdata_t_firecontrol_fire_pressure_sensor a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '基本联动力量' name,count(*) value from centerdata_t_firecontrol_basic_linkage_force a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '其他联动力量' name,count(*) value from centerdata_t_firecontrol_other_linkage_force a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+    </select>
 </mapper>

+ 45 - 0
src/main/resources/mapper/digitalforest/ForestBigDataMapper.xml

@@ -284,4 +284,49 @@
         order by a.create_time desc
     </select>
 
+    <select id="getForestResourceCount" resultType="java.util.Map">
+        select '水鹤' name,count(*) value from centerdata_t_forest_watercrane a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '取水口' name,count(*) value from centerdata_t_forest_waterintake a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        SELECT a.dict_label name,count(b.firehydrant_type) value FROM ${database_system}.sys_dict_data a left join
+        (SELECT a.firehydrant_type FROM centerdata_t_forest_firehydrant a
+        left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}) b on a.dict_value = b.firehydrant_type
+        where a.dict_type = 'firehydrant'
+        GROUP BY a.dict_value
+        union all
+        select '泡沫液' name,count(*) value from centerdata_t_firecontrol_foam_liquid a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '水源信息' name,count(*) value from centerdata_t_forest_channel a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '植树造林-植树区域' name,count(*) value from centerdata_t_forest_afforestationarea a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '野生动物-动物监测' name,count(*) value from centerdata_t_forest_animal a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '森林防火队' name,count(*) value from centerdata_t_forest_fireteam a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '林长管理' name,count(*) value from centerdata_t_forest_linleader a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+        union all
+        select '林业资源' name,count(*) value from centerdata_t_forest_resources a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 ${params.dataScope}
+    </select>
+
 </mapper>