From f321a3efb62601c0382626bfc25f1d137f9f10ed Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Wed, 16 Oct 2024 20:04:59 +0800
Subject: [PATCH] 进度统计柱状图支付率问题处理

---
 skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbProjectMapper.xml |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbProjectMapper.xml b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbProjectMapper.xml
index 539890a..2174434 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbProjectMapper.xml
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbProjectMapper.xml
@@ -411,7 +411,8 @@
 	NVL ( b."actual_fund", 0 )) noPay
 FROM
 	sjzt_md."tb_project" a
-	LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule"
+	LEFT JOIN (
+        SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule"
         WHERE 1=1
         <if test="params.tbYear != null and params.tbYear !=''">
             AND  "year" = #{params.tbYear}
@@ -419,6 +420,7 @@
         <if test="params.tbMonth != null and params.tbMonth !=''">
             AND "month" = #{params.tbMonth}
         </if>
+        group by "tb_project_id"
         ) b ON a."guid" = b."tb_project_id"
 	LEFT JOIN YWXT."att_ad_base" c ON ( a."city_code" = c."guid" )
 	OR ( a."county_code" = c."guid" )
@@ -439,14 +441,16 @@
 		NVL ( b."actual_fund", 0 )) noPay
 	FROM
 		sjzt_md."tb_project" a
-		LEFT JOIN  ( SELECT * FROM sjzt_md."tb_project_schedule"
-        WHERE 1=1
-        <if test="params.tbYear != null and params.tbYear !=''">
-            AND  "year" = #{params.tbYear}
-        </if>
-        <if test="params.tbMonth != null and params.tbMonth !=''">
-            AND "month" = #{params.tbMonth}
-        </if>
+		LEFT JOIN  (
+            SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule"
+            WHERE 1=1
+            <if test="params.tbYear != null and params.tbYear !=''">
+                AND  "year" = #{params.tbYear}
+            </if>
+            <if test="params.tbMonth != null and params.tbMonth !=''">
+                AND "month" = #{params.tbMonth}
+            </if>
+            group by "tb_project_id"
         ) b ON a."guid" = b."tb_project_id"
 		RIGHT JOIN YWXT."att_ad_base" c on c."ad_code" = a."city_code"
 		where c."p_ad_code" = #{params.adCode}
@@ -476,14 +480,16 @@
 		NVL ( b."actual_fund", 0 )) noPay
 	FROM
 		sjzt_md."tb_project" a
-		LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule"
-        WHERE  1=1
-        <if test="params.tbYear != null and params.tbYear !=''">
-            AND  "year" = #{params.tbYear}
-        </if>
-        <if test="params.tbMonth != null and params.tbMonth !=''">
-            AND "month" = #{params.tbMonth}
-        </if>
+		LEFT JOIN (
+            SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule"
+            WHERE  1=1
+            <if test="params.tbYear != null and params.tbYear !=''">
+                AND  "year" = #{params.tbYear}
+            </if>
+            <if test="params.tbMonth != null and params.tbMonth !=''">
+                AND "month" = #{params.tbMonth}
+            </if>
+            group by "tb_project_id"
         ) b ON a."guid" = b."tb_project_id"
 	GROUP BY
 		a."county_code",

--
Gitblit v1.9.3