From e2c5017787d7fc5eea2afb8bc84bca0db054ad8c Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期三, 09 四月 2025 17:46:36 +0800
Subject: [PATCH] Merge branch 'radio_frequency' of http://114.132.189.42:9002/r/lims-ruoyi-after into radio_frequency

---
 basic-server/src/main/resources/mapper/StandardTreeMapper.xml |   44 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
index 7eafed8..ffe58e3 100644
--- a/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
+++ b/basic-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -25,6 +25,18 @@
     <resultMap id="LaboratoryDto" type="com.ruoyi.basic.dto.LaboratoryDto">
         <result property="label" column="laboratory"/>
         <result property="value" column="laboratory"/>
+        <collection property="children" resultMap="ObjectTypeDto"/>
+    </resultMap>
+
+    <resultMap id="ObjectTypeDto" type="com.ruoyi.basic.dto.ObjectTypeDto">
+        <result property="label" column="object_type"/>
+        <result property="value" column="object_type"/>
+        <collection property="children" resultMap="workShopNameDto"/>
+    </resultMap>
+
+    <resultMap id="workShopNameDto" type="com.ruoyi.basic.dto.WorkShopNameDto">
+        <result property="label" column="workShopName"/>
+        <result property="value" column="workShopName"/>
         <collection property="children" resultMap="SampleTypeDto"/>
     </resultMap>
 
@@ -35,6 +47,8 @@
         <result property="sort" column="sort"/>
         <result property="partNo" column="part_no"/>
         <result property="sampleTypeEn" column="sample_type_en"/>
+        <result property="workShopName" column="workShopName"/>
+        <result property="workShopId" column="workShopId"/>
         <collection property="children" resultMap="SampleDto"/>
     </resultMap>
 
@@ -90,8 +104,10 @@
     </sql>
 
     <select id="selectStandardTreeList" resultMap="FactoryDto">
-        select '涓ぉ绉戞妧妫�娴嬩腑蹇�'        factory,
+        select '涓ぉ绉戞妧'        factory,
                l.laboratory_name laboratory,
+               sto.object_type object_type,
+               ws.`name` workShopName,
                sto.specimen_name sample_type,
                p.name            sample,
                st.model,
@@ -99,12 +115,14 @@
                sto.id  sample_type_id,
                sto.sort,
                sto.specimen_name_en sample_type_en,
-               p.name_en sample_en
+               p.name_en sample_en,
+               ws.id workShopId
         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
+                 LEFT JOIN work_shop ws ON ws.id = sto.work_shop_id
         order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id
     </select>
 
@@ -164,7 +182,7 @@
         </if>
     </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
@@ -245,11 +263,15 @@
         where name = #{name}
     </select>
     <select id="selectStandardTreeListByPartNo" resultMap="FactoryDto">
-        select '涓ぉ绉戞妧妫�娴嬩腑蹇�' factory,
+        select '涓ぉ绉戞妧' factory,
                l.laboratory_name  laboratory,
+               sto.object_type object_type,
+               ws.`name` workShopName,
                sto.specimen_name  sample_type,
                p.name             sample,
-               st.model,
+               m.model_name  model,
+               ws.`name` workShopName,
+               ws.id workShopId,
                CASE
                    WHEN p.id = (SELECT pp.product_id
                                 FROM product_part pp
@@ -269,6 +291,8 @@
                  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
+                 LEFT JOIN model m ON m.product_id = p.id
+                 LEFT JOIN work_shop ws ON ws.id = sto.work_shop_id
         where (p.id = (select pp.product_id
                        from product_part pp
                        where pp.part_no = #{partNo})
@@ -322,6 +346,7 @@
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>
+        order by send_time desc
     </select>
 
     <select id="selectIfsPage" resultType="com.ruoyi.basic.pojo.IfsInventoryQuantity">
@@ -348,6 +373,7 @@
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>
+        order by send_time desc
     </select>
     <select id="getIfsByOverList" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto">
         select * from (<include refid="getIfsOrder"/>
@@ -387,4 +413,12 @@
             </foreach>
         </if>
     </select>
+
+    <select id="getStandardTree3" resultType="com.ruoyi.basic.dto.SampleDto">
+        select model label,
+               model value
+        from standard_tree
+        where sample_type = #{sampleType}
+          and sample is null
+    </select>
 </mapper>

--
Gitblit v1.9.3