From 51786b723d0a91d11476776d9ce50af7994dc4bd Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 23 九月 2026 15:58:53 +0800
Subject: [PATCH] feat(inspect): 完善检验订单状态管理和样品接收流程

---
 inspect-server/src/main/resources/mapper/InsSampleMapper.xml |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
index c540fb2..ad6224c 100644
--- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -491,18 +491,20 @@
                  left join ins_product ip on isa.id = ip.ins_sample_id
                  left join ins_product_result ipr on ip.id = ipr.ins_product_id
         where ins_order_id = #{id}
-          and (
-              (ip.state = 1 and ip.son_laboratory = #{laboratory})
-              or (
-                  ip.id is null
-                  and #{laboratory} = '鏂拌仛'
-                  and exists (
-                      select 1
-                      from ins_order_standard_template iost
-                      where iost.ins_order_id = isa.ins_order_id
-                  )
-              )
-          )
+        <if test="laboratory != null and laboratory != ''">
+            and (
+                (ip.state = 1 and ip.son_laboratory = #{laboratory})
+                or (
+                    ip.id is null
+                    and #{laboratory} = '鏂拌仛'
+                    and exists (
+                        select 1
+                        from ins_order_standard_template iost
+                        where iost.ins_order_id = isa.ins_order_id
+                    )
+                )
+            )
+        </if>
     </select>
     <select id="getSampleEn" resultType="java.lang.String">
         select name_en
@@ -608,10 +610,12 @@
                  left join ins_product_result ipr on ip.id = ipr.ins_product_id
         where ins_sample_id = #{id}
           and state = 1
+        <if test="laboratory != null and laboratory != ''">
           and ip.son_laboratory = #{laboratory}
+        </if>
           and ins_fiber_id is null
           and ins_fibers_id is null
-          and (standard_method_list_id is not null or template_row_index is not null)
+          and template_id is not null
         /* 鐢电紗閰嶇疆鏍囪瘑 */
         <if test="cableTag == null or cableTag == ''">
             and ip.cable_tag is null
@@ -635,10 +639,12 @@
         left join ins_product_result ipr on ip.id = ipr.ins_product_id
         where ins_sample_id = #{id}
         and state = 1
+        <if test="laboratory != null and laboratory != ''">
         and ip.son_laboratory = #{laboratory}
+        </if>
         and ins_fiber_id is null
         and ins_fibers_id is null
-        and (standard_method_list_id is not null or template_row_index is not null)
+        and template_id is not null
         and ip.raw_material_tag = #{rawMaterialTag}
         order by sort asc
     </select>

--
Gitblit v1.9.3