From 83d43612df0238902ee1506c69e1fcc12f10a16e Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 17 六月 2024 13:48:10 +0800
Subject: [PATCH] 新增模板编号+检验项目参数排序+考评模块建表
---
cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml | 44 +++++++++++++++++++++++++++++++-------------
1 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml b/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml
index def7e4c..655974d 100644
--- a/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml
+++ b/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml
@@ -7,7 +7,7 @@
delete from structure_item_parameter where sample like concat('%',#{sample},'%')
</delete>
<select id="selectItemParameterList" resultType="com.yuanchu.mom.pojo.StructureItemParameter">
- select id,
+ select * from (select A.id,
inspection_item,
inspection_item_en,
inspection_item_subclass,
@@ -20,10 +20,10 @@
inspection_item_type,
checkout_number,
section,
- create_user,
- update_user,
- create_time,
- update_time,
+ A.create_user,
+ A.update_user,
+ A.create_time,
+ A.update_time,
method,
man_day,
bsm,
@@ -35,11 +35,26 @@
ask,
ask_tell,
inspection_item_class,
- inspection_item_class_en
- from structure_item_parameter
+ inspection_item_class_en,
+ code
+ from (select *,
+ CASE
+ WHEN INSTR(sample, ',') > 0 THEN
+ SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1)
+ when sample = '[""]' then null
+ ELSE
+ TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1))
+ END AS samples
+ from structure_item_parameter) A
+ left join structure_test_object sto on samples = specimen_name
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
- </if>
+ </if>)B
+ order by CASE
+ WHEN code IS NULL THEN 1
+ ELSE 0
+ END,
+ CAST(code AS UNSIGNED) asc
</select>
<resultMap id="getInsProductions" type="map">
@@ -51,14 +66,17 @@
<result property="name" column="subclass"/>
</resultMap>
<select id="getInsProduction" resultMap="getInsProductions">
- select id, inspection_item,
- case when inspection_item_subclass='' then inspection_item
- else inspection_item_subclass end as subclass
+ select id,
+ inspection_item,
+ case
+ when inspection_item_subclass = '' then inspection_item
+ else inspection_item_subclass end as subclass
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 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>
<resultMap id="itemDto" type="com.yuanchu.mom.dto.TestItemDto">
--
Gitblit v1.9.3