From 67647a9bdb5ca2c0acf5c5f635ec28d2e4d6c9db Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 08 十月 2026 13:58:51 +0800
Subject: [PATCH] fix:countTodayByCreateTime方法加上null值判断

---
 src/main/resources/mapper/account/sales/AccountSalesCollectionMapper.xml |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/account/sales/AccountSalesCollectionMapper.xml b/src/main/resources/mapper/account/sales/AccountSalesCollectionMapper.xml
index 6e0e8d0..c107d13 100644
--- a/src/main/resources/mapper/account/sales/AccountSalesCollectionMapper.xml
+++ b/src/main/resources/mapper/account/sales/AccountSalesCollectionMapper.xml
@@ -20,13 +20,17 @@
     </resultMap>
     <select id="listPageAccountSalesCollection"
             resultType="com.ruoyi.account.bean.vo.sales.AccountSalesCollectionVo">
-       select * from (select ascc.*,
+       select
+           A.* ,
+           if(asd.receipt_number is not null, true, false) as isAccountStatemen
+       from (select ascc.*,
                c.customer_name,
                GROUP_CONCAT(sour.outbound_batches SEPARATOR ',') AS outboundBatches
         from account_sales_collection ascc
         left join customer c on ascc.customer_id = c.id
         left join stock_out_record sour on FIND_IN_SET(sour.id, ascc.stock_out_record_ids) > 0
         GROUP BY ascc.id)A
+       left join account_statement_details asd on A.collection_number = asd.receipt_number
          <where>
             <if test="req.customerId != null">
                  AND A.customer_id = #{req.customerId}
@@ -46,10 +50,11 @@
     <select id="existsByStockOutRecordId" resultType="java.lang.Boolean">
         SELECT COUNT(*) > 0
         FROM account_sales_collection
-        WHERE
-        <foreach collection="stockOutRecordIds" item="id" open="(" separator=" OR " close=")">
-            FIND_IN_SET(#{id}, stock_out_record_ids)
-        </foreach>
+        <where>
+            <foreach collection="stockOutRecordIds" item="id" open="(" separator=" OR " close=")">
+                FIND_IN_SET(#{id}, stock_out_record_ids)
+            </foreach>
+        </where>
     </select>
     <select id="getOutboundBatchesByCustomer"
             resultType="com.ruoyi.account.bean.vo.sales.SalesOutboundVo">
@@ -85,5 +90,13 @@
 
         order by sor.id DESC
     </select>
+    <select id="selectIncomeStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
+         SELECT DATE_FORMAT(collection_date, #{dateFormat}) AS dateStr,
+                IFNULL(SUM(collection_amount), 0)            AS amount
+         FROM account_sales_collection
+         WHERE collection_date BETWEEN #{startStr} AND #{endStr}
+         GROUP BY dateStr
+         ORDER BY dateStr
+    </select>
 
 </mapper>

--
Gitblit v1.9.3