select bbi.barcode_id,
bbi.print_time,
bbi.print_person,
bbi.batch_flag,
bbi.barcode_type,
bbi.barcode_info,
bbi.batch_code,
bbi.single_flag,
bbi.pallet_info_code,
bbi.bind_barcode,
bbi.material_id,
bbi.barcode_spec,
bmi.material_code,
bmi.material_name,
bmi.material_spec,
bbi.manufacturer_id,
bbi.product_barcode,
bbi.amount,
bbi.machine_name,
bbi.print_number,
bbi.purchase_order_id,
bbi.po_no,
bbi.production_date,
bbi.accepted_date,
bbi.complete_flag,
bbi.last_outstock_date,
bbi.plan_code,
bbi.plan_detail_code,
bbi.safe_flag,
bbi.sale_order_id,
bbi.saleorder_code,
bbi.project_no,
bbi.transferred_plan_detail_code,
bbi.print_flag,
bbi.serial_number,
bbi.remark,
bbi.bind_status,
bbi.bind_by,
bbi.bind_time,
bbi.update_by,
bbi.update_time
from mes_base_barcode_info bbi
left join mes_base_material_info bmi on bmi.material_id = bbi.material_id
insert into mes_base_barcode_info
print_time,
print_person,
print_flag,
batch_flag,
barcode_type,
single_flag,
barcode_info,
batch_code,
pallet_info_code,
bind_barcode,
material_id,
barcode_spec,
manufacturer_id,
amount,
product_barcode,
machine_name,
print_number,
purchase_order_id,
po_no,
production_date,
accepted_date,
last_outstock_date,
plan_code,
plan_detail_code,
safe_flag,
sale_order_id,
saleorder_code,
project_no,
complete_flag,
serial_number,
remark,
bind_status,
bind_by,
bind_time,
update_by,
update_time,
#{printTime},
#{printPerson},
#{printFlag},
#{batchFlag},
#{barcodeType},
#{singleFlag},
#{barcodeInfo},
#{batchCode},
#{palletInfoCode},
#{bindBarcode},
#{materialId},
#{barcodeSpec},
#{manufacturerId},
#{amount},
#{productBarcode},
#{machineName},
#{printNumber},
#{purchaseOrderId},
#{poNo},
#{productionDate},
#{acceptedDate},
#{lastOutstockDate},
#{planCode},
#{planDetailCode},
#{safeFlag},
#{saleOrderId},
#{saleorderCode},
#{projectNo},
#{completeFlag},
#{serialNumber},
#{remark},
#{bindStatus},
#{bindBy},
#{bindTime},
#{updateBy},
#{updateTime},
update mes_base_barcode_info
print_time = #{printTime},
print_person = #{printPerson},
batch_flag = #{batchFlag},
print_flag = #{printFlag},
barcode_type = #{barcodeType},
barcode_info = #{barcodeInfo},
batch_code = #{batchCode},
pallet_info_code = #{palletInfoCode},
material_id = #{materialId},
manufacturer_id = #{manufacturerId},
amount = #{amount},
machine_name = #{machineName},
print_number = #{printNumber},
po_no = #{poNo},
production_date = #{productionDate},
accepted_date = #{acceptedDate},
last_outstock_date = #{lastOutstockDate},
plan_code = #{planCode},
plan_detail_code = #{planDetailCode},
sale_order_id = #{saleOrderId},
saleorder_code = #{saleorderCode},
safe_flag = #{safeFlag},
project_no = #{projectNo},
transferred_plan_detail_code = #{transferredPlanDetailCode},
serial_number = #{serialNumber},
remark = #{remark},
bind_barcode = #{bindBarcode},
bind_status = #{bindStatus},
bind_by = #{bindBy},
bind_time = #{bindTime},
update_by = #{updateBy},
update_time = #{updateTime},
where barcode_id = #{barcodeId}
delete
from mes_base_barcode_info
where barcode_id = #{barcodeId}
delete from mes_base_barcode_info where barcode_id in
#{barcodeId}
INSERT INTO mes_base_barcode_info (batch_flag,barcode_type,barcode_info,batch_code,material_id,barcode_spec,manufacturer_id,amount,purchase_order_id,po_no,production_date,accepted_date,last_outstock_date,plan_code,plan_detail_code,safe_flag,sale_order_id,saleorder_code,project_no,serial_number,remark,bind_status,update_by,update_time) VALUES
( #{item.batchFlag}, #{item.barcodeType}, #{item.barcodeInfo}, #{item.batchCode}, #{item.materialId}, #{item.barcodeSpec}, #{item.manufacturerId}, #{item.amount}, #{item.purchaseOrderId}, #{item.poNo}, #{item.productionDate}, #{item.acceptedDate}, #{item.lastOutstockDate}, #{item.planCode},#{item.planDetailCode}, #{item.safeFlag},#{item.saleOrderId}, #{item.saleorderCode},#{item.projectNo}, #{item.serialNumber},#{item.remark}, #{item.bindStatus},#{item.updateBy}, #{item.updateTime})