From f38aee0763020103d18feb53f00e9df5c1bc4315 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 03 四月 2026 10:46:49 +0800
Subject: [PATCH] 保养后生成领用记录
---
src/main/resources/mapper/quality/RawMaterialMapper.xml | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/quality/RawMaterialMapper.xml b/src/main/resources/mapper/quality/RawMaterialMapper.xml
index 88b7603..da34144 100644
--- a/src/main/resources/mapper/quality/RawMaterialMapper.xml
+++ b/src/main/resources/mapper/quality/RawMaterialMapper.xml
@@ -22,15 +22,21 @@
FROM raw_material rm
LEFT JOIN product_model pm ON rm.product_model_id = pm.id
LEFT JOIN product p ON p.id = pm.product_id
- where
- 1=1
- <if test="params.checkType != null ">
+ WHERE p.id IS NOT NULL
+ AND rm.id IS NOT NULL
+ <if test="params.checkType != null">
AND rm.check_type = #{params.checkType}
</if>
- <if test="params.entryDateStart != null and params.entryDateStart != '' ">
+ <if test="params.batchNo != null and params.batchNo != ''">
+ AND rm.batch_no LIKE CONCAT('%', #{params.batchNo}, '%')
+ </if>
+ <if test="params.inspectState != null">
+ AND rm.inspect_state = #{params.inspectState}
+ </if>
+ <if test="params.entryDateStart != null and params.entryDateStart != ''">
AND rm.check_time >= #{params.entryDateStart}
</if>
- <if test="params.entryDateEnd != null and params.entryDateEnd != '' ">
+ <if test="params.entryDateEnd != null and params.entryDateEnd != ''">
AND rm.check_time <= #{params.entryDateEnd}
</if>
ORDER BY rm.check_time DESC
--
Gitblit v1.9.3