insert into quality_report_sample_item(items_id,report_sample_id,sort,item_name,item_reference,judge_formula,value_formula,item_code,item_type,parameter_format,aisle,"position",wire_core,unit,param_type,item_value,is_check) select qtsp."id",#{reportSample.id},qtsp."index",qtsp.parameter_item,qtsp.reference_value,qtsp.judge_formula,qtsp.value_formula,qtsp.code,qtsp.type,qtsp.parameter_format, qtsp.aisle,qtsp."position",qtsp.wire_core,qtsp.unit,qtsp.param_type,qtsp.default_value,qtsp.is_check from quality_test_standard_param qtsp left join quality_test_standard qts on qtsp.test_standard_id=qts."id" where qts.standard_no=#{reportSample.testStandardNo} and qtsp.active=true and qts.active=true insert into quality_report_sample_item(items_id, report_sample_id, sort, item_name, item_reference, judge_formula, value_formula, item_code, item_type, parameter_format, aisle, "position", wire_core,extends_part_no, extends_routing_id, extends_routing_no, extends_operation_id, extends_operation_no, extends_test_standard_id, extends_test_standard_no,extends_test_standard_param_id, extends_test_standard_param_no, technology_document_standard_param_id,unit,param_type,item_value,is_check) select pmtsp."id", #{reportSample.id}, pmtsp."index", pmtsp.parameter_item, pmtsp.reference_value, pmtsp.judge_formula, pmtsp.value_formula, pmtsp.code, pmtsp.type, pmtsp.parameter_format, pmtsp.aisle, pmtsp."position", pmtsp.wire_core, pmtsp.extends_part_no, pmtsp.extends_routing_id, pmtsp.extends_routing_no, pmtsp.extends_operation_id, pmtsp.extends_operation_no, pmtsp.extends_test_standard_id, pmtsp.extends_test_standard_no, pmtsp.extends_test_standard_param_id, pmtsp.extends_test_standard_param_no, pmtsp.technology_document_standard_param_id, pmtsp.unit, pmtsp.param_type, pmtsp.default_value, pmtsp.is_check from plan_mo_test_standard_param pmtsp left join plan_mo_test_standard pmts on pmtsp.mo_test_standard_id = pmts."id" where pmts."id" = #{reportSample.testStandardId} and pmtsp.active = true delete from quality_report_sample_item where report_sample_id = #{sampleId} INSERT INTO quality_report_sample_item ( items_id, report_sample_id, sort, item_name, item_value, is_qualified, remark, item_reference, test_value, test_user, item_code, item_type, judge_formula, value_formula, parameter_format, param_type, aisle, "position", wire_core, extends_part_no, extends_routing_id, extends_routing_no, extends_operation_id, extends_operation_no, extends_test_standard_id, extends_test_standard_no, extends_test_standard_param_id, extends_test_standard_param_no, technology_document_standard_param_id, extends_result_flag, unit, cal_item_value, acq_item_value, is_check ) SELECT A.items_id, #{reportSampleId}, A.sort, A.item_name, A.item_value, A.is_qualified, A.remark, A.item_reference, A.test_value, A.test_user, A.item_code, A.item_type, A.judge_formula, A.value_formula, A.parameter_format, A.param_type, A.aisle, A."position", A.wire_core, A.extends_part_no, A.extends_routing_id, A.extends_routing_no, A.extends_operation_id, A.extends_operation_no, A.extends_test_standard_id, A.extends_test_standard_no, A.extends_test_standard_param_id, A.extends_test_standard_param_no, A.technology_document_standard_param_id, A.extends_result_flag, A.unit, A.cal_item_value, A.acq_item_value, A.is_check FROM quality_report_sample_item A WHERE A.report_sample_id = #{copyId}