From f00a59b4f30accf2b23ae0d58fac23d966a48d24 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 13 六月 2026 20:11:51 +0800
Subject: [PATCH] fix: 优化生产订单查询
---
src/main/resources/mapper/stock/StockOutRecordMapper.xml | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/stock/StockOutRecordMapper.xml b/src/main/resources/mapper/stock/StockOutRecordMapper.xml
index 35421c9..33e42ec 100644
--- a/src/main/resources/mapper/stock/StockOutRecordMapper.xml
+++ b/src/main/resources/mapper/stock/StockOutRecordMapper.xml
@@ -46,6 +46,12 @@
<if test="params.productName != null and params.productName != ''">
and p.product_name like concat('%',#{params.productName},'%')
</if>
+ <if test="params.model != null and params.model != ''">
+ and pm.model like concat('%',#{params.model},'%')
+ </if>
+ <if test="params.batchNo != null and params.batchNo != ''">
+ and sor.batch_no like concat('%',#{params.batchNo},'%')
+ </if>
<if test="params.type != null and params.type != ''">
and sor.type = #{params.type}
</if>
@@ -56,7 +62,7 @@
and p.id in (select id from product_tree)
</if>
</where>
- order by sor.id desc
+ order by sor.create_time desc
</select>
<select id="listStockOutRecordExportData" resultType="com.ruoyi.stock.execl.StockOutRecordExportData">
SELECT
@@ -86,7 +92,7 @@
order by sor.id desc
</select>
- <select id="listPageAccountSales" resultType="com.ruoyi.account.bean.vo.SalesOutboundVo">
+ <select id="listPageAccountSales" resultType="com.ruoyi.account.bean.vo.sales.SalesOutboundVo">
SELECT
sor.id,
sor.outbound_batches,
@@ -94,6 +100,7 @@
sor.create_time as shippingDate,
p.product_name,
pm.model as specification_model,
+ slp.tax_rate,
sor.stock_out_num * slp.tax_inclusive_unit_price as outboundAmount,
s.shipping_no,
sl.sales_contract_no
@@ -110,6 +117,9 @@
<if test="req.customerName != null and req.customerName != ''">
AND sl.customer_name LIKE CONCAT('%',#{req.customerName},'%')
</if>
+ <if test="req.customerId != null ">
+ AND sl.customer_id = #{req.customerId}
+ </if>
<if test="req.startDate != null and req.endDate != null">
AND s.shipping_date BETWEEN #{req.startDate} AND #{req.endDate}
</if>
--
Gitblit v1.9.3