| | |
| | | <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> |
| | | select * from(select * from( |
| | | SELECT |
| | | a.*,ios.ins_state,ios.verify_tell,verify_user,ios.id orderStateId,ios.create_time,ios.sort,sort_time,version |
| | | a.*,ios.ins_state,ios.verify_tell,verify_user,ios.id orderStateId,ios.create_time,ios.sort,sort_time,version,ios.num num1 |
| | | FROM |
| | | ( |
| | | SELECT |
| | |
| | | |
| | | <select id="selectSampleProductListByOrderId" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where ins_order_id = #{id} |
| | | and state = 1 |
| | | -- and ins_fiber_id is null |
| | | -- and ins_fibers_id is null |
| | | and <!--isa.sample_code NOT REGEXP '/'--> |
| | | isa.id in(select id1 from (select is2.id id1 ,ip.id from ins_sample is2 left join ins_product ip on is2.id = |
| | | ip.ins_sample_id where ip.id is not null)s ) |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | <select id="getInsOrderAndSample" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ip.id ip_id, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic, |
| | | ip.temperature, |
| | | ip.humidity |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where ins_order_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | </select> |
| | | <select id="getSampleEn" resultType="java.lang.String"> |
| | | select name_en |
| | | from `center-lims`.product |
| | | where name = #{sample} |
| | | limit 1 |
| | | </select> |
| | | <select id="selectSampleProductListByOrderId2" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where ins_order_id = #{id} |
| | | where isa.ins_order_id = #{id} |
| | | and state = 1 |
| | | and ios.laboratory = #{laboratory} |
| | | and (ipr2.num = ios.num or ipr2.num is null) |
| | | and (ipr.num = ios.num or ipr.num is null) |
| | | and isa.id in (select id1 |
| | | from (select is2.id id1, ip.id |
| | | from ins_sample is2 |
| | | left join ins_product ip on is2.id = |
| | | ip.ins_sample_id |
| | | where ip.id is not null) s) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | | else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' |
| | | THEN CAST(SUBSTRING(man_hour_group, 2) AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | , id asc |
| | | </select> |
| | | <select id="selectSampleProductListByOrder2Id" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and state = 1 |
| | | and ios.laboratory = #{laboratory} |
| | | and isa.id in (select id1 |
| | | from (select is2.id id1, ip.id |
| | | from ins_sample is2 |
| | | left join ins_product ip on is2.id = |
| | | ip.ins_sample_id |
| | | where ip.id is not null) s) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | | else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' |
| | | THEN CAST(SUBSTRING(man_hour_group, 2) AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | , id asc |
| | | </select> |
| | | <select id="getInsOrderAndSample" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic, |
| | | ip.temperature, |
| | | ip.humidity |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ios.laboratory = #{laboratory} |
| | | and (ipr2.num = ios.num or ipr2.num is null) |
| | | and (ipr.num = ios.num or ipr.num is null) |
| | | </select> |
| | | <select id="getInsOrderAndSample2" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic, |
| | | ip.temperature, |
| | | ip.humidity |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ios.laboratory = #{laboratory} |
| | | </select> |
| | | <select id="getSampleEn" resultType="java.lang.String"> |
| | | select name_en |
| | | from `center-lims`.product |
| | | where name = #{sample} |
| | | limit 1 |
| | | </select> |
| | | <select id="selectSampleProductListByOrderId2" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and ip.standard_method_list_id is not null |
| | | and state = 1 |
| | | and (ipr2.num = ios.num or ipr2.num is null) |
| | | and (ipr.num = ios.num or ipr.num is null) |
| | | order by case |
| | | when man_hour_group is NULL then 1 |
| | | when man_hour_group = '' then 1 |
| | | else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' |
| | | THEN CAST(SUBSTRING(man_hour_group, 2) AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | , id asc |
| | | </select> |
| | | <select id="selectSampleProductListByOrder2Id2" resultMap="sampleDto"> |
| | | select isa.*, |
| | | ios.num num1, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | tell, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s |
| | | from ins_sample isa |
| | | left join ins_order_state ios on isa.ins_order_id = ios.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where isa.ins_order_id = #{id} |
| | | and ip.standard_method_list_id is not null |
| | | and state = 1 |
| | | order by case |
| | |
| | | THEN CAST(SUBSTRING(man_hour_group, 2) AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | , id asc |
| | | </select> |
| | | |
| | | <select id="selectSampleProductListByOrderId3" resultMap="sampleDto3"> |
| | | select isa.id, |
| | | sample_code, |
| | |
| | | </select> |
| | | |
| | | <select id="getInsProduct1" resultMap="product"> |
| | | select ip.id ip_id, |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_product ip |
| | | left join ins_sample isa on ip.ins_sample_id = isa.id |
| | | left join ins_order_state ios on ios.ins_order_id = isa.ins_order_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where ins_sample_id = #{id} |
| | |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and standard_method_list_id is not null |
| | | and ip.standard_method_list_id is not null |
| | | and ios.laboratory = #{laboratory} |
| | | and (ipr2.num = ios.num or ipr2.num is null) |
| | | and (ipr.num = ios.num or ipr.num is null) |
| | | order by ipr.id, ipr2.id |
| | | </select> |
| | | <select id="getIns2Product1" resultMap="product"> |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_product ip |
| | | left join ins_sample isa on ip.ins_sample_id = isa.id |
| | | left join ins_order_state ios on ios.ins_order_id = isa.ins_order_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and ip.standard_method_list_id is not null |
| | | and ios.laboratory = #{laboratory} |
| | | order by ipr.id, ipr2.id |
| | | </select> |
| | | <select id="get2InsProduct1" resultMap="product"> |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |
| | | ip.laboratory ip_laboratory, |
| | | ip.sample_type ip_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | son_laboratory, |
| | | ip.unit ip_unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result ip_ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user ip_create_user, |
| | | ip.update_user ip_update_user, |
| | | ip.create_time ip_create_time, |
| | | ip.update_time ip_update_time, |
| | | template_id, |
| | | ipr.ins_value, |
| | | ipr.com_value, |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ipr2.frequency, |
| | | ipr2.often, |
| | | ipr2.port, |
| | | ipr2.angle, |
| | | ipr2.value, |
| | | ipr2.result, |
| | | ipr2.equip_value equipValue2, |
| | | ipr2.equip_name equipName2, |
| | | ip.method_s, |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_product ip |
| | | left join ins_sample isa on ip.ins_sample_id = isa.id |
| | | left join ins_order_state ios on ios.ins_order_id = isa.ins_order_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_product_result_2 ipr2 on ip.id = ipr2.ins_product_id |
| | | where ins_sample_id = #{id} |
| | | and state = 1 |
| | | and ip.son_laboratory = #{laboratory} |
| | | and ins_fiber_id is null |
| | | and ins_fibers_id is null |
| | | and ip.standard_method_list_id is not null |
| | | and ios.laboratory = #{laboratory} |
| | | and ipr2.num = #{num} |
| | | and ipr.num = #{num} |
| | | order by ipr.id, ipr2.id |
| | | </select> |
| | | |
| | | <select id="getReportModel" resultType="java.util.Map"> |
| | |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="standardMethodListId" column="standard_method_list_id"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="num1" column="num1"/> |
| | | <collection property="insProduct" resultMap="product"/> |
| | | </resultMap> |
| | | |
| | |
| | | from standard_method |
| | | where id = (select standard_method_list_id from ins_sample where id = #{sampleId}) |
| | | </select> |
| | | <select id="selectSampleList" resultType="java.util.Map"> |
| | | select DISTINCT sample_code |
| | | from ins_sample |
| | | left join ins_product ip on ins_sample.id = ip.ins_sample_id |
| | | where ins_order_id = #{orderId} |
| | | and ip.id is not null |
| | | </select> |
| | | </mapper> |