Переглянути джерело

删除多余查询 综合查询整理

朴弘宇 1 рік тому
батько
коміт
658e3e2c7f

+ 1 - 15
src/main/java/com/sooka/sponest/data/digitalfirecontrol/controller/FireControlBigDataController.java

@@ -53,7 +53,7 @@ public class FireControlBigDataController extends BaseController {
      * 查询消防各资源数量
      */
     @ApiOperation(value = "远程调用查询消防各资源数量", notes = "远程调用查询消防各资源数量")
-    @PostMapping("/geFireControltTotal")
+    @PostMapping("/selectAllResource")
     public R geFireControltTotal(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
         return R.ok(iFireControlBigDataService.geFireControltTotal(visuForestCloudMapVO));
     }
@@ -167,18 +167,4 @@ public class FireControlBigDataController extends BaseController {
         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);
-    }
 }

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

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

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

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

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

@@ -184,16 +184,4 @@ public class FireControlBigDataServiceImpl extends BaseServiceImpl implements IF
         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);
-    }
 }

+ 1 - 12
src/main/java/com/sooka/sponest/data/digitalforest/controller/ForestBigDataController.java

@@ -48,15 +48,6 @@ public class ForestBigDataController extends BaseController {
         return R.ok(forestBigDataService.selectBigDataFarmDeptCount(centerdataTForestFarm));
     }
 
-    /* 数字林业远端调用
-     *
-     * */
-    @ApiOperation(value = "远程调用查询林业各资源", notes = "远程调用查询林业各资源")
-    @PostMapping("/getTotal")
-    public R getTotal(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
-        return R.ok(forestBigDataService.getTotal(visuForestCloudMapVO));
-    }
-
     /**
      * 查询数据中台所有资源
      *
@@ -68,9 +59,7 @@ public class ForestBigDataController extends BaseController {
     @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);
+        return R.ok(forestBigDataService.getForestResourceCount(visuForestCloudMapVO));
     }
 
     @ApiImplicitParams(value = {

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

@@ -25,8 +25,6 @@ import java.util.Map;
 public interface ForestBigDataMapper {
     List<VisuForestCloudEventTypeBO> selectBigDataFarmDeptCount(CenterdataTForestFarm centerdataTForestFarm);
 
-    List<Map<String, Object>> getTotal(VisuForestCloudMapVO visuForestCloudMapVO);
-
     List<Map<String, Object>> getForestResourceCount(VisuForestCloudMapVO visuForestCloudMapVO);
 
     List<VisuForestCloudEventTypeBO> selectBigDataImportareaDeptCount(CenterdataTForestImportarea centerdataTForestImportarea);

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

@@ -24,8 +24,6 @@ import java.util.Map;
 public interface IForestBigDataService {
     List<VisuForestCloudEventTypeBO> selectBigDataFarmDeptCount(CenterdataTForestFarm centerdataTForestFarm);
 
-    List<Map<String, Object>> getTotal(VisuForestCloudMapVO visuForestCloudMapVO);
-
     List getForestResourceCount(VisuForestCloudMapVO visuForestCloudMapVO);
 
     List<VisuForestCloudEventTypeBO> selectBigDataImportareaDeptCount(CenterdataTForestImportarea centerdataTForestImportarea);

+ 1 - 6
src/main/java/com/sooka/sponest/data/digitalforest/service/impl/ForestBigDataServiceImpl.java

@@ -47,12 +47,7 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
         setSookaDataBase(centerdataTForestFarm);
         return forestBigDataMapper.selectBigDataFarmDeptCount(centerdataTForestFarm);
     }
-    @DataScopeMutiDept(deptAlias = "d")
-    @Override
-    public List<Map<String, Object>> getTotal(VisuForestCloudMapVO visuForestCloudMapVO) {
-        setSookaDataBase(visuForestCloudMapVO);
-        return forestBigDataMapper.getTotal(visuForestCloudMapVO);
-    }
+
     @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<Map<String,Object>> getForestResourceCount(VisuForestCloudMapVO visuForestCloudMapVO) {

+ 16 - 17
src/main/resources/mapper/digitalfirecontrol/FireControlBigDataMapper.xml

@@ -65,6 +65,22 @@
         select '专职站' name,count(*) value from centerdata_t_firecontrol_fulltime_station 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_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>
 
     <select id="selectBigDataWaterintakeDeptCount" parameterType="CenterdataTForestWaterintake"
@@ -191,21 +207,4 @@
         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>

+ 28 - 30
src/main/resources/mapper/digitalforest/ForestBigDataMapper.xml

@@ -44,36 +44,6 @@
         limit 8
     </select>
 
-    <select id="getTotal" parameterMap="pm_VisuForestCloudMapVO" resultType="map">
-        select '林场' name,count(*) value from centerdata_t_forest_grid_level a
-            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
-        where 1=1 AND a.forest_grid_level='1' ${params.dataScope}
-        union all
-        select '植树计划' name,count(*) value from centerdata_t_forest_afforestation 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_landing 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_trees 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_keyfireproofplots 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_grid_level a
-            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
-        where 1=1 AND a.forest_grid_level='3' ${params.dataScope}
-    </select>
-
     <select id="selectBigDataImportareaDeptCount" parameterType="CenterdataTForestImportarea"
             resultMap="VisuForestCloudEventTypeBOResult">
         select a.dept_name name,count(a.id) num from centerdata_t_forest_importarea a
@@ -300,6 +270,34 @@
         where a.dict_type = 'firehydrant'
         GROUP BY a.dict_value
         union all
+        select '林场' name,count(*) value from centerdata_t_forest_grid_level a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.forest_grid_level='1' ${params.dataScope}
+        union all
+        select '植树计划' name,count(*) value from centerdata_t_forest_afforestation 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_landing 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_trees 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_keyfireproofplots 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_grid_level a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.forest_grid_level='3' ${params.dataScope}
+        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}