select poi.obj_id,
poi.order_code,
poi.sale_order_code,
poi.sale_order_line_number,
poi.material_code,
poi.material_name,
poi.matkl,
poi.bom_code,
poi.order_amount,
poi.complete_amount,
poi.order_type,
poi.order_status,
poi.finish_flag,
poi.begin_date,
poi.end_date,
poi.real_begin_date,
poi.real_end_date,
poi.factory_code,
poi.is_release,
poi.work_center_code,
poi.routing_code,
poi.print_name,
poi.is_flag,
poi.created_by,
poi.created_time,
poi.updated_by,
poi.updated_time,
pod.SeqNo,
pod.OrderDate,
pod.DeliveryDate,
pod.ProductType,
pod.ProductStatus,
pod.OrderOwner,
pod.CustomerInfo,
pod.BeltLengthSpecifications,
pod.AreaAndWeight,
pod.UsingRawMaterials,
pod.BeltWidth,
pod.BeltClothLayer,
pod.BeltRequiredLength,
pod.GluingRequiredThickness,
pod.LowerGlueRequiredThickness,
pod.ProductionGluingThickness,
pod.UpperBufferAdhesiveThickness,
pod.ProductionLowerGlueThickness,
pod.LowerBufferAdhesiveThickness,
pod.ClothGlueThickness,
pod.SmallClothFabricLayer,
pod.SmallClothThickness,
pod.IsNeedThicken,
pod.EachLayerThickenThickness,
pod.ExtraThickeningThickness,
pod.TotalProductionThickness,
pod.AdditionalThickness,
pod.RecommendedShimThickness,
pod.SemiFinishedProductWidth,
pod.RollingProductionMeters,
pod.RecommendedPadWidth,
pod.BigFabricManufacturer,
pod.FabricSpecifications,
pod.EstimatedFabricUsage,
pod.ClothWidth,
pod.ClothWeight,
pod.SmallFabricSpecificationsDic,
pod.SmallClothWidth,
pod.SmallClothUsage,
pod.SmallClothWeight,
pod.GluingProcess,
pod.UpperLowerGlue,
pod.UpperLowerGlueCoefficient,
pod.UpperLowerGlueUsage,
pod.LowerGlue,
pod.LowerGlueCoefficient,
pod.LowerGlueUsage,
pod.LargeClothGlue,
pod.LargeClothGlueCoefficient,
pod.LargeClothGlueUsage,
pod.BufferGlueUsage,
pod.MiddleGlue,
pod.MiddleGlueCoefficient,
pod.MiddleGlueUsage,
pod.SmallBarWidth,
pod.SmallBarThickness,
pod.SmallBarStandardUsage,
pod.FormingArea,
pod.RollCoatingArea,
pod.RolledFabricArea,
pod.SulfurizationArea,
pod.LargeClothArea,
pod.SmallClothArea,
pod.BeltTotalArea,
pod.SkirtArea,
pod.PartitionArea,
pod.EdgeBandingTotalArea,
pod.WireropeBeltTotalArea
from prod_order_info poi
left join prod_order_detail pod on pod.SeqNo = poi.order_code
insert into prod_order_info
order_code,
sale_order_code,
sale_order_line_number,
material_code,
material_name,
matkl,
bom_code,
order_amount,
complete_amount,
order_type,
order_status,
finish_flag,
begin_date,
end_date,
real_begin_date,
real_end_date,
factory_code,
is_release,
work_center_code,
routing_code,
print_name,
is_flag,
created_by,
created_time,
updated_by,
updated_time,
#{orderCode},
#{saleOrderCode},
#{saleOrderLineNumber},
#{materialCode},
#{materialName},
#{matkl},
#{bomCode},
#{orderAmount},
#{completeAmount},
#{orderType},
#{orderStatus},
#{finishFlag},
#{beginDate},
#{endDate},
#{realBeginDate},
#{realEndDate},
#{factoryCode},
#{isRelease},
#{workCenterCode},
#{routingCode},
#{printName},
#{isFlag},
#{createdBy},
#{createdTime},
#{updatedBy},
#{updatedTime},
update prod_order_info
order_code = #{orderCode},
sale_order_code = #{saleOrderCode},
sale_order_line_number = #{saleOrderLineNumber},
material_code = #{materialCode},
material_name = #{materialName},
matkl = #{matkl},
bom_code = #{bomCode},
order_amount = #{orderAmount},
complete_amount = #{completeAmount},
order_type = #{orderType},
order_status = #{orderStatus},
finish_flag = #{finishFlag},
begin_date = #{beginDate},
end_date = #{endDate},
real_begin_date = #{realBeginDate},
real_end_date = #{realEndDate},
factory_code = #{factoryCode},
is_release = #{isRelease},
work_center_code = #{workCenterCode},
routing_code = #{routingCode},
print_name = #{printName},
is_flag = #{isFlag},
created_by = #{createdBy},
created_time = #{createdTime},
updated_by = #{updatedBy},
updated_time = #{updatedTime},
where obj_id = #{objId}
delete
from prod_order_info
where obj_id = #{objId}
delete from prod_order_info where obj_id in
#{objId}