Browse Source

珍稀古树

zhaowenrui 1 năm trước cách đây
mục cha
commit
37de46a858

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

@@ -189,4 +189,10 @@ public class ForestBigDataController extends BaseController {
     public R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
     public R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
         return R.ok(forestBigDataService.selectForestGridCount(centerdataTForestGridLevel));
         return R.ok(forestBigDataService.selectForestGridCount(centerdataTForestGridLevel));
     }
     }
+
+    @ApiOperation(value = "远程调用查询珍稀古树", notes = "远程调用查询珍稀古树")
+    @GetMapping ("/selectTreeCount")
+    public R selectTreeCount(CenterdataTForestTrees centerdataTForestTrees) {
+        return R.ok(forestBigDataService.selectTreeCount(centerdataTForestTrees));
+    }
 }
 }

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

@@ -61,4 +61,6 @@ public interface ForestBigDataMapper {
     List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources);
     List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources);
 
 
     List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel);
     List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel);
+
+    List<Map<String,Object>> selectTreeCount(CenterdataTForestTrees centerdataTForestTrees);
 }
 }

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

@@ -1,6 +1,5 @@
 package com.sooka.sponest.data.digitalforest.service;
 package com.sooka.sponest.data.digitalforest.service;
 
 
-import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
@@ -60,4 +59,7 @@ public interface IForestBigDataService {
     List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException;
     List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException;
 
 
     List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException;
     List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException;
+
+    List<Map<String,Object>> selectTreeCount(CenterdataTForestTrees centerdataTForestTrees);
+
 }
 }

+ 11 - 5
src/main/java/com/sooka/sponest/data/digitalforest/service/impl/ForestBigDataServiceImpl.java

@@ -1,7 +1,6 @@
 package com.sooka.sponest.data.digitalforest.service.impl;
 package com.sooka.sponest.data.digitalforest.service.impl;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
@@ -23,10 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.io.IOException;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * @Auther: mjq
  * @Auther: mjq
@@ -220,4 +217,13 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
         List<Map<String,Object>> list = forestBigDataMapper.selectForestGridCount(centerdataTForestGridLevel);
         List<Map<String,Object>> list = forestBigDataMapper.selectForestGridCount(centerdataTForestGridLevel);
         return deptLevelUtil.getDeptLevel(list);
         return deptLevelUtil.getDeptLevel(list);
     }
     }
+
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> selectTreeCount(CenterdataTForestTrees centerdataTForestTrees) {
+        setSookaDataBase(centerdataTForestTrees);
+        List<Map<String,Object>> list = forestBigDataMapper.selectTreeCount(centerdataTForestTrees);
+        return deptLevelUtil.getDeptLevel(list);
+    }
+
 }
 }

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

@@ -30,6 +30,7 @@
         <result property="deptName" column="dept_name"/>
         <result property="deptName" column="dept_name"/>
     </resultMap>
     </resultMap>
 
 
+
     <parameterMap id="pm_VisuForestCloudMapVO"
     <parameterMap id="pm_VisuForestCloudMapVO"
                   type="com.sooka.sponest.data.app.domain.VisuForestCloudMapVO"></parameterMap>
                   type="com.sooka.sponest.data.app.domain.VisuForestCloudMapVO"></parameterMap>
 
 
@@ -240,4 +241,15 @@
         group by a.dept_id
         group by a.dept_id
         order by a.create_time desc
         order by a.create_time desc
     </select>
     </select>
+
+    <select id="selectTreeCount" resultType="java.util.Map">
+        select d.ancestors ancestors,a.dept_id deptId,ifnull(count(a.id),0) treeTotal
+        from centerdata_t_forest_trees 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>
 </mapper>
 </mapper>