From 0d7d874912d0147376826b55667a1deb6547ed91 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 21 五月 2026 15:25:27 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' into dev_宁夏_英泽防锈
---
src/main/resources/mapper/stock/StockInRecordMapper.xml | 45 +++++++++++++++++++++++++++++----------------
1 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/src/main/resources/mapper/stock/StockInRecordMapper.xml b/src/main/resources/mapper/stock/StockInRecordMapper.xml
index c0e08af..55e57a3 100644
--- a/src/main/resources/mapper/stock/StockInRecordMapper.xml
+++ b/src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -31,6 +31,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 sir.batch_no like concat('%',#{params.batchNo},'%')
+ </if>
<if test="params.type != null and params.type != ''">
and sir.type = #{params.type}
</if>
@@ -70,22 +76,29 @@
</where>
order by sir.id desc
</select>
- <select id="listPageAccountPurchase" resultType="com.ruoyi.account.bean.vo.PurchaseInboundVo">
+ <select id="listPageAccountPurchase" resultType="com.ruoyi.account.bean.vo.purchase.PurchaseInboundVo">
SELECT
- sir.id,
- sir.inbound_batches,
- pl.supplier_name,
- DATE(sir.create_time) AS inboundDate,
- p.product_name,
- slp.specification_model,
- sor.stock_in_num * slp.tax_inclusive_unit_price as InboundAmount,
- pl.purchase_contract_number
- FROM stock_in_record sir
- LEFT JOIN purchase_ledger pl ON sir.record_id = pl.id
- LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = pl.id and slp.type = 2
- left join product_model pm on slp.product_model_id = pm.id
- left join product p on pm.product_id = p.id
- WHERE sir.approval_status=1 and sir.record_type='7'
+ sir.id,
+ sir.inbound_batches,
+ pl.supplier_name,
+ DATE(sir.create_time) AS inboundDate,
+ p.product_name,
+ pm.model as specification_model,
+ sir.stock_in_num * slp.tax_inclusive_unit_price AS InboundAmount,
+ pl.purchase_contract_number
+ FROM stock_in_record sir
+ -- 10 绫诲瀷鎵嶅叧鑱旇川妫�琛�
+ LEFT JOIN quality_inspect qi ON sir.record_type = 10 AND sir.record_id = qi.id
+ -- 鍔ㄦ�佸叧鑱旈噰璐紙鑷姩閫傞厤 7 鍜� 10锛�
+ LEFT JOIN purchase_ledger pl
+ ON pl.id = IF(sir.record_type = 7, sir.record_id, qi.purchase_ledger_id)
+ -- 浜у搧鍏宠仈涓嶅姩
+ LEFT JOIN sales_ledger_product slp ON pl.id = slp.product_id
+ LEFT JOIN product_model pm ON sir.product_model_id = pm.id
+ LEFT JOIN product p ON pm.product_id = p.id
+ -- 鏉′欢
+ WHERE sir.approval_status = 1 AND slp.type = 2
+ AND sir.record_type IN ('7','10')
<if test="req.inboundBatches != null and req.inboundBatches != ''">
AND sir.inbound_batches LIKE CONCAT('%',#{req.inboundBatches},'%')
</if>
@@ -93,7 +106,7 @@
AND pl.supplier_name LIKE CONCAT('%',#{req.supplierName},'%')
</if>
<if test="req.startDate != null and req.endDate != null">
- AND DATE(sir.create_time) BETWEEN #{startDate} AND #{endDate}
+ AND DATE(sir.create_time) BETWEEN #{req.startDate} AND #{req.endDate}
</if>
order by sir.id DESC
</select>
--
Gitblit v1.9.3