From 3575452cd246e75dea1091dea52282449babddcc Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 15 三月 2024 10:54:04 +0800
Subject: [PATCH] 修改统计数据的精度

---
 src/main/resources/mapper/show/OneMapMapper.xml   |   14 +++++++-------
 src/main/resources/mapper/show/PipelineMapper.xml |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main/resources/mapper/show/OneMapMapper.xml b/src/main/resources/mapper/show/OneMapMapper.xml
index 6459d8b..4f083f5 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,
-               coalesce( cast(sum(a.sizes) as decimal(12, 2) ), 0)  AS capacity
+               coalesce( cast(sum(a.sizes) as decimal(20, 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}%'
@@ -293,19 +293,19 @@
 		select '娴嬬粯锛圗SV锛�' "m1", '鏁板瓧绾垮垝鍥�' "m2", '骞虫柟鍗冪背' "m3", coalesce(sum(area), 0) "sizes" from lf.sys_line_buffer
         union all
         select '娴嬬粯锛圗SV锛�' "m1", '鏁板瓧姝e皠褰卞儚鍥�' "m2", '骞虫柟鍗冪背' "m3", (
-			select coalesce(sum(b.area), 0) from lf.sys_meta b
+			select cast( coalesce(sum(b.area), 0) / 1000000 as decimal(20, 2)) from lf.sys_meta b
 		    inner join lf.sys_dir c on b.dircode = c.code
 		    where c.name = '鏁板瓧姝e皠褰卞儚鍥�' and b.type in ('img', 'tif', 'tiff') ) "sizes"
         union all
         select '娴嬬粯锛圗SV锛�' "m1", '绠$嚎鏁版嵁' "m2", '鍗冪背' "m3",
-			cast( coalesce(sum( ST_Length( ST_GeographyFromText( ST_AsText(geom) ) ) ) / 1000, 0) as decimal(12, 2) ) "sizes" from bs.m_pipeline
+			cast( coalesce(sum( ST_Length( ST_GeographyFromText( ST_AsText(geom) ) ) ) / 1000, 0) as decimal(20, 2) ) "sizes" from bs.m_pipeline
         union all
         select '鍕樺療锛圗GE锛�' "m1", '鍕樻帰鐐�' "m2", '涓�' "m3", count(*) "sizes" from bs.s_explorationpoint
         union all
-        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') ) "sizes"
+        select '鍕樺療锛圗GE锛�' "m1", '涓夌淮鍦拌川妯″瀷' "m2", '骞虫柟鍗冪背' "m3", (
+			select cast( coalesce(sum(b.area), 0) / 1000000 as decimal(20, 2))
+            from lf.sys_meta b
+            where b.type in ('fbx', 'ifc') ) "sizes"
         union all
         select '鍦扮伨锛圗GD锛�' "m1", '鍦扮伨鐐�' "m2", '涓�' "m3", count(*) "sizes" from bd.b_geologic_hazard;
     </select>
diff --git a/src/main/resources/mapper/show/PipelineMapper.xml b/src/main/resources/mapper/show/PipelineMapper.xml
index 3e67c63..f6d2b35 100644
--- a/src/main/resources/mapper/show/PipelineMapper.xml
+++ b/src/main/resources/mapper/show/PipelineMapper.xml
@@ -19,7 +19,7 @@
 
     <select id="selectPipeAnalysis" resultType="com.lf.server.entity.show.PipelineEntity">
         select row_number() over() as gid, a.name as acrossName, b.segname as segName, b.remarks, b.pipename as pipeName,
-            cast( st_length( st_geographyfromtext( st_astext( st_intersection(ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) as decimal(12, 2) ) AS acrossLength,
+            cast( st_length( st_geographyfromtext( st_astext( st_intersection(ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) as decimal(20, 2) ) AS acrossLength,
             st_astext( st_intersection( ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) as wkt
         from ${tab} as a, (select segname, remarks, pipename, geom from bs.m_pipesegment where gid = #{gid} ) as b
         where ST_Intersects(a.geom, b.geom)

--
Gitblit v1.9.3