From 81d5a5c27c971faae10a57c224b72e823f4f5d32 Mon Sep 17 00:00:00 2001 From: liding <756868258@qq.com> Date: 星期五, 25 四月 2025 11:03:44 +0800 Subject: [PATCH] 可靠性计划产品选择 --- basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml | 84 ++++++++++++++++++++++++++++++------------ 1 files changed, 60 insertions(+), 24 deletions(-) diff --git a/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml b/basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml index ae4ba83..a3316cc 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,frequency,rates_group FROM temp_sample A LEFT JOIN @@ -145,36 +146,67 @@ <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> + + <resultMap id="itemDto1" type="com.ruoyi.basic.dto.TestItemDto"> + <result column="sId" property="id"/> + <result column="sName" property="name"/> + <collection property="children" resultMap="productDto1"/> + </resultMap> + <resultMap id="productDto1" type="com.ruoyi.basic.dto.ProductDto"> <result column="pId" property="id"/> <result column="pName" property="name"/> </resultMap> @@ -186,13 +218,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 id="getItemTreeProduct" resultMap="itemDto1"> + 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