From 901bab9b8b1c3773a644bdc74f5eafd666591aeb Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 17 九月 2026 13:37:24 +0800
Subject: [PATCH] feat: 1委托单 2下单详情 3检验任务 4检验任务复核 5检验任务详情 6标准维护 7检验单详情 8报告编制

---
 basic-server/src/main/resources/mapper/StandardTreeMapper.xml |  170 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 147 insertions(+), 23 deletions(-)

diff --git a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
index 4060428..f13da93 100644
--- a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
+++ b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -10,6 +10,8 @@
         <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/>
         <result property="sample" column="sample" jdbcType="VARCHAR"/>
         <result property="model" column="model" jdbcType="VARCHAR"/>
+        <result property="sort" column="sort" jdbcType="INTEGER"/>
+        <result property="standardMethodId" column="standard_method_id" jdbcType="INTEGER"/>
         <result property="createUser" column="create_user" jdbcType="INTEGER"/>
         <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
         <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
@@ -89,24 +91,106 @@
         rates
     </sql>
 
-    <select id="selectStandardTreeList" resultMap="FactoryDto">
-        select '涓ぉ绉戞妧妫�娴嬩腑蹇�'        factory,
-               l.laboratory_name laboratory,
-               sto.specimen_name sample_type,
-               p.name            sample,
-               st.model,
-               sto.code,
-               sto.id  sample_type_id,
-               sto.sort,
-               sto.specimen_name_en sample_type_en,
-               p.name_en sample_en
-        from laboratory l
-                 left join structure_test_object sto on sto.laboratory_id = l.id
-                 left join product p on p.object_id = sto.id
-                 left join standard_tree st on st.sample_type = sto.specimen_name
-            and st.sample = p.name
-        order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id
+    <select id="selectStandardLibraryTree" resultType="com.ruoyi.basic.dto.StandardLibraryTreeRowDto">
+        SELECT l.id                                      AS industry_id,
+               l.laboratory_name                         AS industry_name,
+               l.sort                                    AS industry_sort,
+               st.id                                     AS standard_id,
+               sm.id                                     AS standard_method_id,
+               sm.code                                   AS standard_code,
+               sm.name                                   AS standard_name,
+               sm.name_en                                AS standard_name_en,
+               CONCAT(sm.code, ' - ', sm.name)           AS standard_label,
+               st.sort                                   AS standard_sort
+        FROM laboratory l
+        LEFT JOIN standard_tree st
+               ON st.laboratory = l.laboratory_name
+              AND st.sample_type IS NULL
+              AND st.model IS NULL
+              AND st.standard_method_id IS NOT NULL
+              AND EXISTS (SELECT 1 FROM standard_method sm0
+                          WHERE sm0.id = st.standard_method_id
+                            AND sm0.is_product = 1 AND sm0.is_use = 1)
+        LEFT JOIN standard_method sm ON sm.id = st.standard_method_id
+        ORDER BY COALESCE(l.sort, 0), l.id,
+                 COALESCE(st.sort, 0), st.id
     </select>
+
+    <update id="updateProductListIndustry">
+        UPDATE standard_product_list
+        SET laboratory = #{newName},
+            tree = CASE WHEN sample_type IS NULL AND model IS NULL AND sample IS NOT NULL
+                        THEN CONCAT(#{newName}, ' - null - ', sample)
+                        ELSE tree END
+        WHERE laboratory = #{oldName}
+    </update>
+
+    <update id="updateProductListStandard">
+        UPDATE standard_product_list
+        SET sample = #{newName},
+            tree = CONCAT(#{industry}, ' - null - ', #{newName})
+        WHERE laboratory = #{industry}
+          AND sample = #{oldName}
+          AND sample_type IS NULL
+          AND model IS NULL
+    </update>
+
+    <update id="updateInsOrderIndustry">
+        UPDATE ins_order
+        SET laboratory = #{newName}
+        WHERE laboratory = #{oldName}
+          AND (state IS NULL OR state NOT IN (3, -1))
+          AND (ins_state IS NULL OR ins_state != 5)
+    </update>
+
+    <update id="updateInsSampleIndustry">
+        UPDATE ins_sample s
+        JOIN ins_order o ON o.id = s.ins_order_id
+        SET s.laboratory = #{newName}
+        WHERE s.laboratory = #{oldName}
+          AND (o.state IS NULL OR o.state NOT IN (3, -1))
+          AND (o.ins_state IS NULL OR o.ins_state != 5)
+    </update>
+
+    <update id="updateInsProductIndustry">
+        UPDATE ins_product p
+        JOIN ins_sample s ON s.id = p.ins_sample_id
+        JOIN ins_order o ON o.id = s.ins_order_id
+        SET p.laboratory = #{newName}
+        WHERE p.laboratory = #{oldName}
+          AND (o.state IS NULL OR o.state NOT IN (3, -1))
+          AND (o.ins_state IS NULL OR o.ins_state != 5)
+    </update>
+
+    <update id="updateInsOrderStandard">
+        UPDATE ins_order
+        SET sample = #{newName}
+        WHERE laboratory = #{industry}
+          AND sample = #{oldName}
+          AND (state IS NULL OR state NOT IN (3, -1))
+          AND (ins_state IS NULL OR ins_state != 5)
+    </update>
+
+    <update id="updateInsSampleStandard">
+        UPDATE ins_sample s
+        JOIN ins_order o ON o.id = s.ins_order_id
+        SET s.sample = #{newName}
+        WHERE s.laboratory = #{industry}
+          AND s.sample = #{oldName}
+          AND (o.state IS NULL OR o.state NOT IN (3, -1))
+          AND (o.ins_state IS NULL OR o.ins_state != 5)
+    </update>
+
+    <update id="updateInsProductStandard">
+        UPDATE ins_product p
+        JOIN ins_sample s ON s.id = p.ins_sample_id
+        JOIN ins_order o ON o.id = s.ins_order_id
+        SET p.sample = #{newName}
+        WHERE p.laboratory = #{industry}
+          AND p.sample = #{oldName}
+          AND (o.state IS NULL OR o.state NOT IN (3, -1))
+          AND (o.ins_state IS NULL OR o.ins_state != 5)
+    </update>
 
     <select id="selectStandardProductById" resultType="com.ruoyi.basic.pojo.StandardProductList">
         select inspection_item,
@@ -156,7 +240,7 @@
     </select>
 
     <select id="selectStandardTreeList2" resultType="com.ruoyi.basic.pojo.StandardTree">
-        select '涓ぉ绉戞妧妫�娴嬩腑蹇�'        factory,
+        select ''                          factory,
                l.laboratory_name laboratory,
                sto.specimen_name sample_type,
                p.name            sample
@@ -191,6 +275,44 @@
           and (laboratory is null
             or laboratory = ''
             or laboratory = #{laboratory})
+        order by inspection_item_class, inspection_item, id asc
+    </select>
+
+    <select id="selectStandardProductListByIndustry" resultType="com.ruoyi.basic.pojo.StandardProductList">
+        select inspection_item,
+               inspection_item_en,
+               inspection_item_subclass,
+               inspection_item_subclass_en,
+               inspection_item_class,
+               inspection_item_class_en,
+               method,
+               son_laboratory,
+               unit,
+               ask_tell as tell,
+               ask,
+               price,
+               man_hour,
+               man_hour_group,
+               man_day,
+               inspection_item_type,
+               inspection_value_type,
+               bsm,
+               template_id,
+               laboratory,
+               checkout_number,
+               section,
+               dic,
+               0 as state,
+               null as model,
+               #{standard} as sample,
+               #{tree} as tree,
+               id as structure_item_parameter_id,
+               radius_list,
+               rates
+        from structure_item_parameter
+        where (laboratory is null
+            or laboratory = ''
+            or laboratory = #{industry})
         order by inspection_item_class, inspection_item, id asc
     </select>
 
@@ -237,7 +359,7 @@
         where name = #{name}
     </select>
     <select id="selectStandardTreeListByPartNo" resultMap="FactoryDto">
-        select '涓ぉ绉戞妧妫�娴嬩腑蹇�' factory,
+        select ''                 factory,
                l.laboratory_name  laboratory,
                sto.specimen_name  sample_type,
                p.name             sample,
@@ -280,10 +402,12 @@
                      ir1.id                                      enter_report_id,
                      ir1.url                                     enter_url,
                      ir1.url_s                                   enter_url_s,
+                     ir1.is_ratify                               enter_ratify_status,
                      io2.id                                      quarter_order_id,
                      ir2.id                                      quarter_report_id,
                      ir2.url                                     quarter_url,
                      ir2.url_s                                   quarter_url_s,
+                     ir2.is_ratify                               quarter_ratify_status,
                      group_concat(distinct isa.sample_code, ' ')          sample_code,
                      group_concat(distinct isa.sample, ' ')               sample_name,
                      group_concat(distinct isa.model, ' ')                sample_model,
@@ -317,7 +441,7 @@
         order by send_time desc
     </select>
 
-    <select id="selectIfsPage" resultType="com.ruoyi.basic.pojo.IfsInventoryQuantity">
+    <select id="selectIfsPage" resultType="com.ruoyi.basic.vo.IfsInventoryQuantityVO">
         SELECT * from ifs_inventory_quantity ifs
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
@@ -334,7 +458,7 @@
         select * from (<include refid="getIfsOrder"/>
         <where>
             <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''">
-                send_time between #{beginDeclareDate} and #{endDeclareDate}
+                declare_date between #{beginDeclareDate} and #{endDeclareDate}
             </if>
         </where>
         ) a
@@ -347,7 +471,7 @@
         select * from (<include refid="getIfsOrder"/>
             <where>
                 <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''">
-                    send_time between #{beginDeclareDate} and #{endDeclareDate}
+                    declare_date between #{beginDeclareDate} and #{endDeclareDate}
                 </if>
             </where>
         ) a
@@ -360,7 +484,7 @@
         <where>
             and (quarter_order_id is not null)
             <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''">
-                and  send_time between #{beginDeclareDate} and #{endDeclareDate}
+                and  declare_date between #{beginDeclareDate} and #{endDeclareDate}
             </if>
         </where>
         ) a

--
Gitblit v1.9.3