From cbadfa371df97fc26e800bef29c3829b2ce304d3 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 24 五月 2026 14:47:10 +0800
Subject: [PATCH] git排除test文件
---
src/main/resources/mapper/basic/CustomerMapper.xml | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 53 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index 20aaefc..7453e03 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -26,7 +26,6 @@
from customer c
left join sys_user u on c.usage_user = u.user_id
<where>
- and c.usage_status = 1
<if test="c.customerName != null and c.customerName != ''">
and customer_name like concat('%', #{c.customerName}, '%')
</if>
@@ -108,4 +107,57 @@
</if>
</where>
</select>
+
+ <select id="customewTransactions" resultType="com.ruoyi.sales.vo.CustomerTransactionsVo">
+ select T1.customer_id,
+ c.customer_name,
+ T1.contractAmounts,
+ IFNULL(T3.outboundAmount, 0) AS shippedAmount,
+ GREATEST(T1.contractAmounts - IFNULL(T3.outboundAmount, 0), 0) AS unshippedAmount
+ from (select customer_id, sum(contract_amount) as contractAmounts from sales_ledger group by customer_id) T1
+ left join (
+ SELECT
+ sl.customer_id,
+ sum(sor.stock_out_num * slp.tax_inclusive_unit_price) as outboundAmount
+ FROM stock_out_record sor
+ LEFT join shipping_info s on sor.record_id = s.id
+ LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id
+ LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id
+ WHERE sor.record_type='13'
+ and sor.approval_status=1
+ and slp.type = 1
+ group by sl.customer_id
+ ) T3 on T3.customer_id=T1.customer_id
+ left join customer c on T1.customer_id = c.id
+ <where>
+ <if test="customerName!=null and customerName!=''">
+ AND c.customer_name LIKE CONCAT('%', #{customerName}, '%')
+ </if>
+ </where>
+ </select>
+
+ <select id="customewTransactionsDetails"
+ resultType="com.ruoyi.sales.vo.CustomerTransactionsDetailsVo">
+ select sl.id salesLedgerId,
+ sl.sales_contract_no,
+ sl.execution_date,
+ sl.contract_amount,
+ IFNULL(T2.outboundAmount, 0) AS shippedAmount,
+ GREATEST(sl.contract_amount - IFNULL(T2.outboundAmount, 0), 0) AS unshippedAmount
+ from sales_ledger sl
+ left join (
+ SELECT
+ sl.id,
+ sum(sor.stock_out_num * slp.tax_inclusive_unit_price) as outboundAmount
+ FROM stock_out_record sor
+ left join shipping_info s on sor.record_id = s.id
+ LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id
+ LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id
+ WHERE sor.record_type='13'
+ and sor.approval_status=1
+ and slp.type = 1
+ group by sl.id
+ )T2 on T2.id = sl.id
+ where sl.customer_id = #{customerId}
+ </select>
</mapper>
--
Gitblit v1.9.3