From 12ecef99059f411e802c6fbc6f9a641c422b1747 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期六, 03 八月 2024 22:34:20 +0800
Subject: [PATCH] 数采bug修复

---
 inspect-server/src/main/resources/mapper/InsOrderMapper.xml |   54 +++++-------------------------------------------------
 1 files changed, 5 insertions(+), 49 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index 6c549ad..bf07385 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -60,37 +60,9 @@
     <select id="selectInsOrderPage" resultType="com.yuanchu.mom.dto.SampleOrderDto">
         select *
         from (
-        <!--SELECT
-        io.*,
-        ir.id report_id,
-        ir.url,
-        ir.url_s,
-        (select count(*) from ins_sample isa2
-        where isa2.ins_order_id = io.id and  CHAR_LENGTH(isa2.sample_code) &lt;32 ) sample_num,
-        concat(ROUND((select count(*) from ins_product ip
-        where state = 1 and ins_result is not null and ip.ins_sample_id in (select id from ins_sample where
-        ins_sample.ins_order_id= io.id )) / (select count(*) from ins_product ip2
-        where state = 1 and ip2.ins_sample_id in (select id from ins_sample where ins_sample.ins_order_id= io.id )) *
-        100, 2), '%') insProgress,
-        group_concat(distinct isa.sample_code,' ') sample_code,
-        group_concat(distinct isa.sample,' ') sample_name,
-        group_concat(distinct isa.model,' ') sample_model,
-        u.name
-        FROM
-        ins_order io
-        LEFT JOIN ins_sample isa ON io.id = isa.ins_order_id
-        LEFT JOIN ( SELECT id, ins_order_id, is_ratify, url,url_s FROM ins_report WHERE is_ratify = 1 ) ir ON io.id =
-        ir.ins_order_id
-        left join user u on io.create_user = u.id
-        where 1=1
-        <if test="laboratory!=null and laboratory!=''">
-            and io.laboratory=#{laboratory}
-        </if>
-        GROUP BY
-        io.id-->
-
         SELECT
         io.*,
+        isau.user_id assign,
         ir.id report_id,
         ir.url,
         ir.url_s,
@@ -104,6 +76,8 @@
         ins_order io
         LEFT JOIN
         ins_sample isa ON io.id = isa.ins_order_id
+        LEFT JOIN
+        ins_sample_user isau ON isau.ins_sample_id = io.id
         LEFT JOIN
         (SELECT id, ins_order_id, is_ratify, url, url_s FROM ins_report WHERE is_ratify = 1) ir ON io.id = ir.ins_order_id
         LEFT JOIN
@@ -130,8 +104,8 @@
         <if test="laboratory!=null and laboratory!=''">
             AND io.laboratory=#{laboratory}
         </if>
-        GROUP BY
-        io.id
+        GROUP BY io.id,type
+        order by type desc,io.id desc
         ) a
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
@@ -500,23 +474,5 @@
         select name
         from department_lims
         where id = #{depLimsId}
-    </select>
-
-    <select id="getDeviceMessage" resultType="java.util.Map">
-        select d.device_name, d.management_number, d.file_type, d.collect_url
-        FROM
-            device d,
-            device_data_config ddc
-        <if test="sample != '' and sample != null">
-            inner join structure_item_parameter sip on sip.sample like concat('%', #{sample}, '%') and sip.id = ddc.structure_item_parameter_id
-        </if>
-        where d.ip = #{ip}
-          and ddc.inspection_item = #{inspectionItem}
-            <if test="inspectionItemSubclass != '' and inspectionItemSubclass != null">
-                and ddc.inspection_item_subclass = #{inspectionItemSubclass}
-            </if>
-          and d.device_status = 0
-          and d.ins_product_ids is not null
-        limit 1
     </select>
 </mapper>

--
Gitblit v1.9.3