From 41df92a5ee14f19e7453cf0674c1537da46be2ca Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 19 四月 2024 15:42:27 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/CompanyMoneyMapper.xml |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/CompanyMoneyMapper.xml b/src/main/resources/mapper/CompanyMoneyMapper.xml
index 4f9db96..2b6062a 100644
--- a/src/main/resources/mapper/CompanyMoneyMapper.xml
+++ b/src/main/resources/mapper/CompanyMoneyMapper.xml
@@ -31,13 +31,17 @@
     <select id="selectMoneyReceivablesAll" resultType="java.lang.Double">
         select sum(receivables) receivables from man_company_money
         where year(create_time) = #{year}
-        and user_id = #{userId}
+        <if test="userId != null">
+            and user_id = #{userId}
+        </if>
     </select>
 
     <select id="selectMoneyActualReceiptsAll" resultType="java.lang.Double">
         select sum(actual_receipts) actualReceipts from man_company_money
         where year(create_time) = #{year}
-        and user_id = #{userId}
+        <if test="userId != null">
+            and user_id = #{userId}
+        </if>
     </select>
 
     <select id="selectMoneyCopyAll" resultMap="BaseResultMap">

--
Gitblit v1.9.1