insert into t_test(test_name, principal_id, test_type_id, test_purpose, status, del_flag, create_by, create_time, remark) values(#{testName}, #{principalId}, #{testTypeId}, #{testPurpose}, #{status}, #{delFlag}, #{createBy}, #{createTime}, #{remark}) update t_test set test_name=#{testName}, principal_id=#{principalId}, test_type_id=#{testTypeId}, test_purpose=#{testPurpose}, remark=#{remark}, update_by=#{updateBy}, update_time=#{updateTime} where test_id=#{testId} and del_flag='0' update t_test set status=#{status}, update_by=#{updateBy}, update_time=sysdate() where test_id=#{testId} and status='0' and del_flag='0' update t_test set del_flag=cast(test_id as char), update_by=#{updateBy}, update_time=sysdate() where test_id=#{testId} and del_flag='0' update t_test_battery set del_flag=cast(relation_id as char) where test_id=#{testId} and del_flag='0' update t_test_battery_field f join t_test_battery b on b.relation_id=f.relation_id set f.del_flag=cast(f.field_id as char) where b.test_id=#{testId} and f.del_flag='0' update t_test_warning_threshold set del_flag=cast(threshold_id as char) where test_id=#{testId} and del_flag='0' insert into t_test_battery(test_id, group_id, battery_no, cabinet_id, test_channel_no, collector_id, temperature_channel_no, positive_channel_no, negative_channel_no, del_flag) values(#{testId}, #{groupId}, #{batteryNo}, #{cabinetId}, #{testChannelNo}, #{collectorId}, #{temperatureChannelNo}, #{positiveChannelNo}, #{negativeChannelNo}, '0') insert into t_test_battery_field(relation_id, field_name, field_value, del_flag) values(#{relationId}, #{fieldName}, #{fieldValue}, '0') insert into t_test_warning_threshold(test_id, threshold_type, min_value, max_value, del_flag) values(#{testId}, #{thresholdType}, #{minValue}, #{maxValue}, '0')