From a4a0e2bd0ddcf0b6c55b701fc52875f3302cbe11 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 27 五月 2026 19:39:57 +0800
Subject: [PATCH] feat 校验提交修改

---
 src/main/resources/mapper/purchase/InvoicePurchaseMapper.xml |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/main/resources/mapper/purchase/InvoicePurchaseMapper.xml b/src/main/resources/mapper/purchase/InvoicePurchaseMapper.xml
index 6da8a75..2a1425c 100644
--- a/src/main/resources/mapper/purchase/InvoicePurchaseMapper.xml
+++ b/src/main/resources/mapper/purchase/InvoicePurchaseMapper.xml
@@ -115,10 +115,11 @@
         <!--                and a.month = #{month}-->
         <!--            </if>-->
         <!--        </where>-->
+        select * from (
         SELECT
         month,
-        SUM(sales_tax_amount) AS sales_tax_amount,
-        SUM(purchase_tax_amount) AS purchase_tax_amount
+        SUM(sales_tax_amount) AS j_tax_amount,
+        SUM(purchase_tax_amount) AS x_tax_amount
         FROM (
         SELECT
         DATE_FORMAT(entry_date, '%Y-%m') AS month,
@@ -135,17 +136,18 @@
         0 AS sales_tax_amount,
         ROUND(SUM(contract_amount * 0.26), 2) AS purchase_tax_amount
         FROM purchase_ledger
-        <where>
-
-            a.month is not null
-            <if test="month != null">
-                and a.month = #{month}
-            </if>
-        </where>
+        WHERE entry_date IS NOT NULL
         GROUP BY DATE_FORMAT(entry_date, '%Y-%m')
         ) t
         GROUP BY month
-        ORDER BY month;
+        ORDER BY month
+        ) a
+        <where>
+            a.month is not null
+            <if test="month != null and month != ''">
+                and a.month = #{month}
+            </if>
+        </where>
 
     </select>
     <select id="listVat1" resultType="com.ruoyi.purchase.dto.VatDto">

--
Gitblit v1.9.3