From 804c80b0fd284c7464066efbd5e5833ddacfb635 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 11 四月 2025 13:11:16 +0800
Subject: [PATCH] 原辅材下单优化
---
basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml | 72 ++++++++++++++++++++++++-----------
1 files changed, 49 insertions(+), 23 deletions(-)
diff --git a/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml b/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml
index ae4ba83..d9a1457 100644
--- a/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml
+++ b/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml
@@ -92,7 +92,8 @@
inspection_item_class_en,
code,
radius_list,
- rates
+ rates,
+ delegate_request_flag
FROM
temp_sample A
LEFT JOIN
@@ -145,38 +146,59 @@
<result property="name" column="subclass"/>
</resultMap>
<select id="getInsProduction" resultMap="getInsProductions">
- select distinct id,
- CASE
- WHEN INSTR(sample, ',') > 0 THEN
- SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1)
- when sample = '[""]' then '*'
- ELSE
- TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1))
- END
- as sample,
- inspection_item,
- case
- when inspection_item_subclass is null or inspection_item_subclass = '' then inspection_item
- else inspection_item_subclass end as subclass,
- case
- when inspection_item_class is null or inspection_item_class = '' then inspection_item
- else inspection_item_class end as item_class
- from structure_item_parameter
+ SELECT DISTINCT
+ id,
+ CASE
+ WHEN INSTR(sample, ',') > 0 THEN
+ TRIM(BOTH '"' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', - 1), '"]]', 1))
+ WHEN sample = '[""]' THEN
+ '*'
+ ELSE
+ TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1))
+ END AS sample,
+ inspection_item,
+ CASE
+ WHEN inspection_item_subclass IS NULL
+ OR TRIM(inspection_item_subclass) = '' THEN
+ inspection_item
+ ELSE
+ inspection_item_subclass
+ END AS subclass,
+ CASE
+ WHEN inspection_item_class IS NULL
+ OR TRIM(inspection_item_class) = '' THEN
+ inspection_item
+ ELSE
+ inspection_item_class
+ END AS item_class
+ FROM
+ structure_item_parameter;
</select>
<select id="getItemTree" resultMap="itemDto">
- select sto.id sId, sto.specimen_name sName, p.id pId, p.name pName
- from structure_test_object sto
- left join product p on p.object_id = sto.id
+ SELECT
+ sto.id AS sId,
+ sto.specimen_name AS labelName,
+ CONCAT(sto.specimen_name, ' (', sto.object_type, ')') AS sName,
+ p.id AS pId,
+ p.name AS pName,
+ sto.object_type
+ FROM
+ structure_test_object sto
+ LEFT JOIN
+ product p
+ ON p.object_id = sto.id;
</select>
<resultMap id="itemDto" type="com.ruoyi.basic.dto.TestItemDto">
<result column="sId" property="id"/>
<result column="sName" property="name"/>
+ <result column="labelName" property="labelName"/>
<collection property="children" resultMap="productDto"/>
</resultMap>
<resultMap id="productDto" type="com.ruoyi.basic.dto.ProductDto">
<result column="pId" property="id"/>
<result column="pName" property="name"/>
+ <result column="labelName" property="labelName"/>
</resultMap>
<select id="selectItemParameterBySample" resultType="com.ruoyi.basic.pojo.StructureItemParameter">
@@ -186,13 +208,17 @@
sample is NULL
OR sample = ''
or sample = '[]'
- OR sample LIKE CONCAT('%', #{sample}, '%')
+ OR sample LIKE CONCAT('%', #{structureItemParameterDto.tree}, '%')
)
+ <if test="structureItemParameterDto.delegateRequestFlag != null and structureItemParameterDto.delegateRequestFlag !='' ">
+ AND delegate_request_flag = #{structureItemParameterDto.delegateRequestFlag}
+ </if>
+
order by id asc
</select>
<select id="getItemTreeProduct" resultMap="itemDto">
- select sto.id sId, sto.specimen_name sName, p.id pId, p.name pName
+ select sto.id sId, sto.specimen_name sName, p.name labelName, p.id pId, p.name pName
from structure_test_object sto
left join product p on p.object_id = sto.id
WHERE sto.object_type = #{objectType}
--
Gitblit v1.9.3