From 36ccc814cb2499757a0cfd5525d5e8d0c2309b64 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期三, 27 十一月 2024 16:02:42 +0800 Subject: [PATCH] 企业微信的消息提醒的信息改成单号样品名+检验下单的模版保存,如果存在同名的情况,将原有的情况覆盖掉,并添加提示框+首页展示添加样品名称 --- cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml | 61 +++++++++++++++++++++++------- 1 files changed, 47 insertions(+), 14 deletions(-) diff --git a/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml b/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml index e732e26..57616e4 100644 --- a/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml +++ b/cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml @@ -79,20 +79,53 @@ <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 then inspection_item - else inspection_item_subclass end as subclass - from structure_item_parameter + WITH expanded_sample AS ( + SELECT + id, + CASE + WHEN INSTR(sample, '","') > 0 THEN + SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1) + when sample = '[]' then '*' + WHEN INSTR(sample, '"],["') > 0 THEN + TRIM(BOTH '["]' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '"],["', 1), '"', -1)) + ELSE + TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1)) + END + AS component1, + CASE + WHEN INSTR(sample, '"],["') > 0 THEN + TRIM(BOTH '["]' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '"],["', -1), '"', 1)) + ELSE + NULL + END AS component2, + inspection_item, + CASE + WHEN inspection_item_subclass IS NULL THEN inspection_item + ELSE inspection_item_subclass + END AS subclass + FROM + structure_item_parameter + ) + SELECT + id, + CASE + WHEN component1 IS NOT NULL THEN component1 + ELSE '*' + END AS sample, + inspection_item, + subclass + FROM + expanded_sample + UNION ALL + SELECT + id, + component2 AS sample, + inspection_item, + subclass + FROM + expanded_sample + WHERE + component2 IS NOT NULL; </select> <select id="getItemTree" resultMap="itemDto"> select sto.id sId, sto.specimen_name sName, p.id pId, p.name pName -- Gitblit v1.9.3