From c0ffe9147554b1e3e4d5459b1cc530d09b55b165 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 12 三月 2024 16:01:14 +0800
Subject: [PATCH] 根据类型查询元数据(用于计算面积)

---
 src/main/java/com/lf/server/mapper/show/OneMapMapper.java   |   15 +++++++++++++++
 src/main/java/com/lf/server/service/show/OneMapService.java |   11 +++++++++++
 src/main/resources/mapper/show/OneMapMapper.xml             |   23 +++++++++++++++++++++--
 3 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/lf/server/mapper/show/OneMapMapper.java b/src/main/java/com/lf/server/mapper/show/OneMapMapper.java
index 0dff45a..86f2fe9 100644
--- a/src/main/java/com/lf/server/mapper/show/OneMapMapper.java
+++ b/src/main/java/com/lf/server/mapper/show/OneMapMapper.java
@@ -2,6 +2,7 @@
 
 import com.lf.server.entity.bs.MpipelineEntity;
 import com.lf.server.entity.ctrl.CountEntity;
+import com.lf.server.entity.ctrl.IdNameEntity;
 import com.lf.server.entity.show.OneMapEntity;
 import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Mapper;
@@ -237,4 +238,18 @@
      * @return
      */
     public List<CountEntity> countByMajor();
+
+    /**
+     * 鏌ヨ涓嚎缂撳啿鍖�
+     *
+     * @return
+     */
+    public Integer selectLineBuffer();
+
+    /**
+     * 鏍规嵁绫诲瀷鏌ヨ鍏冩暟鎹紙鐢ㄤ簬璁$畻闈㈢Н锛�
+     *
+     * @return
+     */
+    public List<IdNameEntity> selectMetaByType();
 }
diff --git a/src/main/java/com/lf/server/service/show/OneMapService.java b/src/main/java/com/lf/server/service/show/OneMapService.java
index 599dbd9..4316091 100644
--- a/src/main/java/com/lf/server/service/show/OneMapService.java
+++ b/src/main/java/com/lf/server/service/show/OneMapService.java
@@ -2,6 +2,7 @@
 
 import com.lf.server.entity.bs.MpipelineEntity;
 import com.lf.server.entity.ctrl.CountEntity;
+import com.lf.server.entity.ctrl.IdNameEntity;
 import com.lf.server.entity.show.OneMapEntity;
 import com.lf.server.mapper.show.OneMapMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -375,4 +376,14 @@
     public List<CountEntity> countByMajor() {
         return oneMapMapper.countByMajor();
     }
+
+    @Override
+    public Integer selectLineBuffer() {
+        return oneMapMapper.selectLineBuffer();
+    }
+
+    @Override
+    public List<IdNameEntity> selectMetaByType() {
+        return oneMapMapper.selectMetaByType();
+    }
 }
diff --git a/src/main/resources/mapper/show/OneMapMapper.xml b/src/main/resources/mapper/show/OneMapMapper.xml
index e8b1431..ff7812a 100644
--- a/src/main/resources/mapper/show/OneMapMapper.xml
+++ b/src/main/resources/mapper/show/OneMapMapper.xml
@@ -257,7 +257,7 @@
     <select id="countProjectType" resultType="java.util.Map">
         SELECT a.type,
                count(a.type) AS number,
-               sum(a.sizes) AS capacity
+               coalesce( cast(sum(a.sizes) as decimal(12, 2) ), 0)  AS capacity
         FROM lf.sys_meta a
                  INNER JOIN lf.sys_dir b ON a.dircode = b.code
         WHERE a.dircode LIKE '${projectCode}%'
@@ -305,7 +305,7 @@
         select '鍕樺療锛圗GE锛�' "m1", '涓夌淮鍦拌川妯″瀷' "m2", '骞虫柟绫�' "m3", (
 			select coalesce(sum(b.area), 0) from lf.sys_meta b
 		    inner join lf.sys_dir c on b.dircode = c.code
-		    where b.type in ('fbx', 'ifc', 'rvt') ) "sizes"
+		    where b.type in ('fbx', 'ifc') ) "sizes"
         union all
         select '鍦扮伨锛圗GD锛�' "m1", '鍦扮伨鐐�' "m2", '涓�' "m3", count(*) "sizes" from bd.b_geologic_hazard;
     </select>
@@ -314,4 +314,23 @@
     <select id="selectLineBuffer" resultType="java.lang.Integer">
         select fn_line_buffer();
     </select>
+
+    <!-- 鏍规嵁绫诲瀷鏌ヨ鍏冩暟鎹紙鐢ㄤ簬璁$畻闈㈢Н锛� -->
+    <select id="selectMetaByType" resultType="com.lf.server.entity.ctrl.IdNameEntity">
+        (select a.id, 'DOM' name from lf.sys_meta a
+            inner join lf.sys_dir b on a.dircode = b.code
+            where a.area is null and a.type in ('img', 'tif', 'tiff') and b.name = '鏁板瓧姝e皠褰卞儚鍥�')
+        union all
+        (select a.id, 'DEM' name from lf.sys_meta a
+            inner join lf.sys_dir b on a.dircode = b.code
+            where a.area is null and a.type in ('dem', 'tif', 'tiff') and b.name = '鏁板瓧楂樼▼妯″瀷')
+        union all
+        (select id, 'OSGB' name from lf.sys_meta where area is null and type = 'osgb')
+        union all
+        (select id, 'LAS' name from lf.sys_meta where area is null and type = 'las' or type = 'laz')
+        union all
+        (select id, 'IFC' name from lf.sys_meta where area is null and type = 'ifc')
+        union all
+        (select id, 'FBX' name from lf.sys_meta where area is null and type = 'fbx')
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3