Przeglądaj źródła

林业网格+林业资源

zhaowenrui 1 rok temu
rodzic
commit
f0c0e7d4a5

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

@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -168,4 +169,24 @@ public class ForestBigDataController extends BaseController {
     public R focusOnFire() {
         return R.ok(forestBigDataService.focusOnFire());
     }
+
+    /**
+     * 林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)
+     * @return
+     */
+    @ApiOperation(value = "林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)", notes = "林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)")
+    @GetMapping("/resourcesAreaCount")
+    public R selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException {
+        return forestBigDataService.selectResourcesAreaCount(centerdataTForestResources);
+    }
+
+    /**
+     * 林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)
+     * @return
+     */
+    @ApiOperation(value = "林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)", notes = "林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)")
+    @GetMapping("/forestGridCount")
+    public R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
+        return forestBigDataService.selectForestGridCount(centerdataTForestGridLevel);
+    }
 }

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

@@ -58,4 +58,7 @@ public interface ForestBigDataMapper {
     List<Map<String, Object>> linLeaderCount();
 
     List<Map<String, Object>> focusOnFire();
+    List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources);
+
+    List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel);
 }

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

@@ -1,5 +1,6 @@
 package com.sooka.sponest.data.digitalforest.service;
 
+import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
@@ -10,6 +11,7 @@ import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestImportarea
 import com.sooka.sponest.data.generalbusiness.domain.bo.CenterdataTForestWeatherinformationBigDataBO;
 import com.sooka.sponest.data.generalbusiness.domain.vo.CenterdataTForestWeatherinformationBigDataVO;
 
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -54,4 +56,8 @@ public interface IForestBigDataService {
     List<Map<String, Object>> linLeaderCount();
 
     List<Map<String, Object>> focusOnFire();
+
+    R selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException;
+
+    R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException;
 }

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

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.digitalforest.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
@@ -17,9 +18,11 @@ import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestImportarea
 import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestWeatherinformation;
 import com.sooka.sponest.data.generalbusiness.domain.bo.CenterdataTForestWeatherinformationBigDataBO;
 import com.sooka.sponest.data.generalbusiness.domain.vo.CenterdataTForestWeatherinformationBigDataVO;
+import com.sooka.sponest.data.utils.DeptLevelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -35,6 +38,9 @@ import java.util.Map;
 public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForestBigDataService {
     @Autowired
     private ForestBigDataMapper forestBigDataMapper;
+
+    @Autowired
+    private DeptLevelUtil deptLevelUtil;
     @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<VisuForestCloudEventTypeBO> selectBigDataFarmDeptCount(CenterdataTForestFarm centerdataTForestFarm) {
@@ -198,4 +204,20 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
     public List<Map<String, Object>> focusOnFire() {
         return forestBigDataMapper.focusOnFire();
     }
+
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public R selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException {
+        setSookaDataBase(centerdataTForestResources);
+        List<Map<String,Object>> list = forestBigDataMapper.selectResourcesAreaCount(centerdataTForestResources);
+        return deptLevelUtil.getDeptLevel(list);
+    }
+
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
+        setSookaDataBase(centerdataTForestGridLevel);
+        List<Map<String,Object>> list = forestBigDataMapper.selectForestGridCount(centerdataTForestGridLevel);
+        return deptLevelUtil.getDeptLevel(list);
+    }
 }

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

@@ -201,19 +201,43 @@
     </select>
 
     <select id="linLeaderCount" resultType="map">
-        SELECT COUNT(lin_job) as VALUE ,  '三员[治安员,卫生员,技术员]' name FROM `centerdata_t_forest_linleader` WHERE lin_job in ( "forest_lin_jy", "forest_lin_wsy", "forest_lin_jsy")
+        SELECT COUNT(lin_job) as value ,  '三员[治安员,卫生员,技术员]' name FROM `centerdata_t_forest_linleader` WHERE lin_job in ( "forest_lin_jy", "forest_lin_wsy", "forest_lin_jsy")
         UNION all
-        SELECT COUNT(lin_job) as VALUE ,  '村级林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job = "forest_lin_linzhang" and lin_level = "forest_lin_sq"
+        SELECT COUNT(lin_job) as value ,  '村级林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job = "forest_lin_linzhang" and lin_level = "forest_lin_sq"
         UNION all
-        SELECT COUNT(lin_job) as VALUE ,  '乡镇街林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job = "forest_lin_linzhang" and lin_level = "forest_lin_xz"
+        SELECT COUNT(lin_job) as value ,  '乡镇街林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job = "forest_lin_linzhang" and lin_level = "forest_lin_xz"
         UNION all
-        SELECT COUNT(lin_job) as VALUE ,  '县区林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job = "forest_lin_linzhang" and lin_level = "forest_lin_xq"
+        SELECT COUNT(lin_job) as value ,  '县区林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job = "forest_lin_linzhang" and lin_level = "forest_lin_xq"
         UNION all
-        SELECT COUNT(lin_job) as VALUE ,  '护林员' name FROM `centerdata_t_forest_linleader` WHERE   lin_job = "forest_lin_hly"
+        SELECT COUNT(lin_job) as value ,  '护林员' name FROM `centerdata_t_forest_linleader` WHERE   lin_job = "forest_lin_hly"
     </select>
 
 
     <select id="focusOnFire" resultType="map">
-        SELECT SUM(plots_area) as '面积' ,GROUP_CONCAT(DISTINCT forest_species SEPARATOR ',')as '防火林种',dept_name as '归属部门' FROM `centerdata_t_forest_keyfireproofplots` GROUP BY dept_name
+        SELECT SUM(plots_area) as '面积' ,COUNT(DISTINCT forest_species)as '防火林种',dept_name as '归属部门' FROM `centerdata_t_forest_keyfireproofplots` GROUP BY dept_name
+    </select>
+
+    <select id="selectResourcesAreaCount" resultType="java.util.Map">
+        select d.ancestors ancestors,a.dept_id deptId,ifnull(sum(a.forestry_area),0) areaTotal
+        from centerdata_t_forest_resources a
+        left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        <where>
+            ${params.dataScope}
+        </where>
+        group by a.dept_id
+        order by a.create_time desc
+
+    </select>
+
+    <select id="selectForestGridCount" resultType="java.util.Map">
+        select d.ancestors ancestors,a.dept_id deptId,ifnull(count(a.id),0) gridTotal
+        from centerdata_t_forest_grid_level a
+        left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        <where>
+        and a.forest_grid_level = "3"
+            ${params.dataScope}
+        </where>
+        group by a.dept_id
+        order by a.create_time desc
     </select>
 </mapper>