From 1fd7a7d67a5df84b57af4fbcc310aa66da3cd8ca Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 25 三月 2026 17:51:16 +0800
Subject: [PATCH] feat:1.出入库单位转换 2.仓储/耗材导出字段值优化 3.仓储/耗材库存为0不展示

---
 src/main/resources/mapper/quality/RawMaterialMapper.xml |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/mapper/quality/RawMaterialMapper.xml b/src/main/resources/mapper/quality/RawMaterialMapper.xml
index a5869d5..da34144 100644
--- a/src/main/resources/mapper/quality/RawMaterialMapper.xml
+++ b/src/main/resources/mapper/quality/RawMaterialMapper.xml
@@ -22,16 +22,22 @@
         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 != '' ">
-            AND rm.check_time &gt;= DATE_FORMAT(#{params.entryDateStart},'%Y-%m-%d')
+        <if test="params.batchNo != null and params.batchNo != ''">
+            AND rm.batch_no LIKE CONCAT('%', #{params.batchNo}, '%')
         </if>
-        <if test="params.entryDateEnd != null and params.entryDateEnd != '' ">
-            AND rm.check_time &lt;= DATE_FORMAT(#{params.entryDateEnd},'%Y-%m-%d')
+        <if test="params.inspectState != null">
+            AND rm.inspect_state = #{params.inspectState}
+        </if>
+        <if test="params.entryDateStart != null and params.entryDateStart != ''">
+            AND rm.check_time &gt;= #{params.entryDateStart}
+        </if>
+        <if test="params.entryDateEnd != null and params.entryDateEnd != ''">
+            AND rm.check_time &lt;= #{params.entryDateEnd}
         </if>
         ORDER BY rm.check_time DESC
     </select>

--
Gitblit v1.9.3