From e700e89f85e58747b57fc0d7e1fd30f3483aacca Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期六, 14 九月 2024 16:05:57 +0800
Subject: [PATCH] 检验任务历史记录

---
 inspect-server/src/main/resources/mapper/InsOrderMapper.xml |   87 ++-----------------------------------------
 1 files changed, 4 insertions(+), 83 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index 27cb1fb..f466f31 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -122,31 +122,6 @@
         <result column="name" property="name"/>
         <result column="create_time" property="create_time"/>
     </resultMap>
-    <select id="selectInsOrderParameter" resultType="com.yuanchu.mom.pojo.InsOrder">
-        select *
-        from (
-        select
-        id,
-        appointed,
-        user_id,
-        create_user,
-        otc_code,
-        code,
-        custom,
-        update_user,
-        update_time,
-        type,
-        entrust_code,
-        company,
-        remark,
-        create_time,
-        state
-        from ins_order
-        ) a
-        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
-            ${ew.customSqlSegment}
-        </if>
-    </select>
     <select id="getLaboratoryCode" resultType="java.lang.String">
         select laboratory_number
         from laboratory
@@ -172,31 +147,6 @@
     </select>
     <select id="selectCostStatistics" resultType="com.yuanchu.mom.dto.CostStatisticsDto">
         select * from (
-        <!--SELECT
-        i.id,
-        i.entrust_code,
-        i.create_time,
-        isa.sample,
-        isa.model,
-        c.price,
-        c.cost,
-        c.inspection_item,
-        cus.company,
-        u.`name`,
-        i.create_user,
-        c.ins_sample_id
-        FROM
-        ins_order i
-        LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id
-        LEFT JOIN `user` u ON u.id = i.user_id
-        left join custom cus on cus.id = u.company
-        LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id,GROUP_CONCAT(b.inspection_item2
-        SEPARATOR ',')
-        inspection_item from (select *,GROUP_CONCAT(inspection_item
-        SEPARATOR ',') inspection_item2 from ins_product where state = 1 GROUP BY ins_sample_id,man_hour_group) b GROUP
-        BY b.ins_sample_id) c ON c.ins_sample_id = isa.id
-        where (i.state = 1 or i.state = 3 or i.state = 4)
-        ) a-->
         SELECT A.id,
         A.entrust_code,
         A.create_time,
@@ -233,9 +183,9 @@
         SEPARATOR ',')
         inspection_item from (select * ,
         GROUP_CONCAT(CONCAT(inspection_item,'@',inspection_item_subclass) SEPARATOR ',')inspection_item2 from
-        ins_product where state = 1 and template_id IS NOT NULL GROUP BY ins_sample_id,man_hour_group) b GROUP
+        ins_product where state = 1 and ins_result is not null and ins_result!=2 and template_id IS NOT NULL GROUP BY ins_sample_id,man_hour_group) b GROUP
         BY b.ins_sample_id) c ON c.ins_sample_id = isa.id
-        where (i.state = 1 or i.state = 3 or i.state = 4) and c.ins_sample_id IS not NULL)A
+        where (<!--i.state = 1 or i.state = 3 or -->i.state = 4) and c.ins_sample_id IS not NULL)A
         GROUP BY
         A.id,
         A.entrust_code,
@@ -363,11 +313,6 @@
         from `center-lims`.enums
         where value = #{value}
     </select>
-    <select id="getStandardMethodCode" resultType="java.lang.String">
-        select code
-        from `center-lims`.standard_method
-        where id = #{id}
-    </select>
     <select id="selLaboratoryCode" resultType="java.lang.String">
         select laboratory_code
         from laboratory
@@ -385,30 +330,6 @@
 
     <select id="selectCostStatistics2" resultType="com.yuanchu.mom.dto.CostStatisticsDto">
         select * from (
-        <!--SELECT
-        i.id,
-        i.entrust_code,
-        i.create_time,
-        isa.sample,
-        isa.model,
-        c.price,
-        c.cost,
-        c.inspection_item,
-        u.company,
-        u.`name`,
-        i.create_user,
-        c.ins_sample_id
-        FROM
-        ins_order i
-        LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id
-        LEFT JOIN `user` u ON u.id = i.user_id
-        LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id,GROUP_CONCAT(b.inspection_item2
-        SEPARATOR ',')
-        inspection_item from (select *,GROUP_CONCAT(inspection_item
-        SEPARATOR ',') inspection_item2 from ins_product where state = 1 GROUP BY ins_sample_id,man_hour_group) b GROUP
-        BY b.ins_sample_id) c ON c.ins_sample_id = isa.id
-        where (i.state = 1 or i.state = 3 or i.state = 4)
-        ) a-->
         SELECT A.id,
         A.entrust_code,
         A.create_time,
@@ -449,9 +370,9 @@
         SEPARATOR ',')
         inspection_item from (select * ,
         GROUP_CONCAT(CONCAT(inspection_item,'@',inspection_item_subclass) SEPARATOR ',')inspection_item2 from
-        ins_product where state = 1 and template_id IS NOT NULL GROUP BY ins_sample_id,man_hour_group) b GROUP
+        ins_product where state = 1 and ins_result is not null and ins_result!=2 and template_id IS NOT NULL GROUP BY ins_sample_id,man_hour_group) b GROUP
         BY b.ins_sample_id) c ON c.ins_sample_id = isa.id
-        where (i.state = 1 or i.state = 3 or i.state = 4) and c.ins_sample_id IS not NULL)A
+        where (<!--i.state = 1 or i.state = 3 or -->i.state = 4) and c.ins_sample_id IS not NULL)A
         GROUP BY
         A.id,
         A.entrust_code,

--
Gitblit v1.9.3