From e78cc56f04556a1d3d54f0db830ba9f16eb28a58 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期六, 03 八月 2024 21:40:53 +0800
Subject: [PATCH] 检验下单待检撤销+删除检验值结论还在

---
 inspect-server/src/main/resources/mapper/InsSampleMapper.xml |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
index ade36d6..ea09efc 100644
--- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -27,7 +27,7 @@
     <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO">
         select * from(select * from(
         SELECT
-        a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,<!--(ios.verify_user = #{userId})--> verify_user
+        a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,verify_user
         FROM
         (
         SELECT
@@ -40,11 +40,12 @@
         isu.user_id,
         user.name userName,
         ip.son_laboratory,
-        io.ins_time
+        io.ins_time,
+        io.laboratory
         FROM
         ins_order io
         LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id
-        LEFT JOIN ( <!--SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id -->
+        LEFT JOIN (
         SELECT *
         FROM ins_sample_user u
         WHERE son_laboratory=#{sonLaboratory} and (ins_sample_id, id) IN (
@@ -59,7 +60,6 @@
         LEFT JOIN user ON isu.user_id = user.id
         WHERE
         io.state = 1
-        # AND io.ins_state != 5
         and send_time is not null
         <if test="userId !=null and userId!=''">
             and (isu.user_id = #{userId} OR isu.user_id is NULL )
@@ -80,11 +80,14 @@
         ) isu2 on
         isu2.ins_sample_id = a.id
         ORDER BY
-        <!--a.user_id DESC,-->
         a.type DESC,
         a.id
         ) b
-        where ins_state is not null)A
+        where ins_state is not null
+        <if test="laboratory!=null and laboratory!=''">
+            and laboratory=#{laboratory}
+        </if>
+        )A
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>
@@ -102,11 +105,12 @@
         io.type,
         io.appointed,
         io.send_time,
-        group_concat(distinct isa.sample,' ') sample,
+        group_concat(distinct isa.sample,' ') sampleType,
         isu.user_id,
         user.name userName,
         ip.son_laboratory,
-        io.ins_time
+        io.ins_time,
+        io.laboratory
         FROM
         ins_order io
         LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id
@@ -131,7 +135,6 @@
             and (isu.user_id = #{userId} OR isu.user_id is NULL )
         </if>
         OR isu.user_id is NULL
-
         GROUP BY
         ip.son_laboratory,
         io.id
@@ -145,12 +148,15 @@
         OR user_id is NULL
         ) isu2 on
         isu2.ins_sample_id = a.id
+        where ins_state is not null
+        <if test="laboratory != null and laboratory!=''">
+            and laboratory=#{laboratory}
+        </if>
         ORDER BY
         <!--a.user_id DESC,-->
         a.type DESC,
         a.id
         ) b
-        where ins_state is not null )A
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>
@@ -268,6 +274,7 @@
         select name_en
         from `center-lims`.product
         where name = #{sample}
+        limit 1
     </select>
     <select id="selectSampleProductListByOrderId2" resultMap="sampleDto">
         select isa.*,
@@ -297,8 +304,8 @@
                method,
                man_day,
                bsm,
-                ask,
-               tell ,
+               ask,
+               tell,
                `last_value`,
                ip.ins_result  ip_ins_result,
                state,

--
Gitblit v1.9.3