| | |
| | | inspection_item_class_en, |
| | | code, |
| | | radius_list, |
| | | rates |
| | | rates, |
| | | delegate_request_flag,frequency,rates_group |
| | | FROM |
| | | temp_sample A |
| | | LEFT JOIN |
| | |
| | | <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"> |
| | |
| | | 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} |