From de0494d7a6f99f50fa33b9487dd2ffefca82e8b6 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期二, 08 四月 2025 17:44:47 +0800
Subject: [PATCH] 标准库功能修改

---
 inspect-server/src/main/resources/mapper/InsOrderMapper.xml |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index bc998cb..2fe9e71 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -96,11 +96,28 @@
         GROUP BY ins_sample_id
         ORDER BY ins_sample_id) isu ON isu.ins_sample_id = io.id
         where (io.ifs_inventory_id IS NULL OR TRIM(io.ifs_inventory_id)  = '')
-        <if test="isOrderAll != null and isOrderAll != ''">
+        <if test="otherParam.isOrderAll != null and otherParam.isOrderAll != ''">
             AND io.state in (1, 4)
         </if>
-        <if test="laboratory!=null and laboratory!=''">
-            AND io.laboratory=#{laboratory}
+        <if test="otherParam.laboratory!=null and otherParam.laboratory!=''">
+            AND io.laboratory=#{otherParam.laboratory}
+        </if>
+        <if test="otherParam.checkUserFlag != null and otherParam.checkUserFlag and otherParam.checkUserId != null ">
+            AND io.id IN (
+                SELECT DISTINCT
+                ins_sample_id AS orderId
+                FROM
+                ins_sample_user
+                WHERE
+                user_id = #{otherParam.checkUserId} UNION
+                SELECT
+                T2.ins_order_id AS orderId
+                FROM
+                ins_product T1
+                JOIN ins_sample T2 ON T1.ins_sample_id = T2.id
+                WHERE
+                T1.check_user_id = #{otherParam.checkUserId}
+            )
         </if>
         GROUP BY io.id,type
         order by type desc,io.id desc

--
Gitblit v1.9.3