select thisTab.id, thisTab.dispatch_id, thisTab.dispatch_no, thisTab.product_id, thisTab.quantity, thisTab.product_name, thisTab.product_type, thisTab.sum_weight, thisTab.net_weight, thisTab.sum_net_weight, thisTab.volume, thisTab.sum_volume, thisTab.loose_pieces, thisTab.full_containers, thisTab.container_no, thisTab.pallet_count, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark, thisTab.record_status, thisTab.pack_unit, thisTab.gross_weight from tms_goods_detail AS thisTab
select count(0) from tms_goods_detail as thisTab
and thisTab.dispatch_id = #{dispatchId}
and thisTab.dispatch_no = #{dispatchNo}
and thisTab.product_id = #{productId}
and thisTab.quantity = #{quantity}
and thisTab.product_name like concat('%', #{productName}, '%')
and thisTab.product_type = #{productType}
and thisTab.sum_weight = #{sumWeight}
and thisTab.net_weight = #{netWeight}
and thisTab.sum_net_weight = #{sumNetWeight}
and thisTab.volume = #{volume}
and thisTab.sum_volume = #{sumVolume}
and thisTab.loose_pieces = #{loosePieces}
and thisTab.full_containers = #{fullContainers}
and thisTab.container_no = #{containerNo}
and thisTab.pallet_count = #{palletCount}
and thisTab.record_status = #{recordStatus}
and thisTab.pack_unit = #{packUnit}
and thisTab.gross_weight = #{grossWeight}
insert into tms_goods_detail
dispatch_id,
dispatch_no,
product_id,
quantity,
product_name,
product_type,
sum_weight,
net_weight,
sum_net_weight,
volume,
sum_volume,
loose_pieces,
full_containers,
container_no,
pallet_count,
create_by,
create_time,
update_by,
update_time,
remark,
record_status,
pack_unit,
gross_weight,
#{dispatchId},
#{dispatchNo},
#{productId},
#{quantity},
#{productName},
#{productType},
#{sumWeight},
#{netWeight},
#{sumNetWeight},
#{volume},
#{sumVolume},
#{loosePieces},
#{fullContainers},
#{containerNo},
#{palletCount},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{remark},
#{recordStatus},
#{packUnit},
#{grossWeight},
insert into tms_goods_detail
id,dispatch_id,dispatch_no,product_id,quantity,product_name,product_type,sum_weight,net_weight,sum_net_weight,volume,sum_volume,loose_pieces,full_containers,container_no,pallet_count,create_by,create_time,update_by,update_time,remark,record_status,pack_unit,gross_weight,
#{item.id},#{item.dispatchId},#{item.dispatchNo},#{item.productId},#{item.quantity},#{item.productName},#{item.productType},#{item.sumWeight},#{item.netWeight},#{item.sumNetWeight},#{item.volume},#{item.sumVolume},#{item.loosePieces},#{item.fullContainers},#{item.containerNo},#{item.palletCount},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.recordStatus},#{item.packUnit},#{item.grossWeight},
update tms_goods_detail
dispatch_id = #{dispatchId},
dispatch_no = #{dispatchNo},
product_id = #{productId},
quantity = #{quantity},
product_name = #{productName},
product_type = #{productType},
sum_weight = #{sumWeight},
net_weight = #{netWeight},
sum_net_weight = #{sumNetWeight},
volume = #{volume},
sum_volume = #{sumVolume},
loose_pieces = #{loosePieces},
full_containers = #{fullContainers},
container_no = #{containerNo},
pallet_count = #{palletCount},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark},
record_status = #{recordStatus},
pack_unit = #{packUnit},
gross_weight = #{grossWeight},
where id = #{id}
update tms_goods_detail
dispatch_id = #{item.dispatchId},
dispatch_no = #{item.dispatchNo},
product_id = #{item.productId},
quantity = #{item.quantity},
product_name = #{item.productName},
product_type = #{item.productType},
sum_weight = #{item.sumWeight},
net_weight = #{item.netWeight},
sum_net_weight = #{item.sumNetWeight},
volume = #{item.volume},
sum_volume = #{item.sumVolume},
loose_pieces = #{item.loosePieces},
full_containers = #{item.fullContainers},
container_no = #{item.containerNo},
pallet_count = #{item.palletCount},
create_by = #{item.createBy},
create_time = #{item.createTime},
update_by = #{item.updateBy},
update_time = #{item.updateTime},
remark = #{item.remark},
record_status = #{item.recordStatus},
pack_unit = #{item.packUnit},
gross_weight = #{item.grossWeight},
where id = #{item.id}
delete from tms_goods_detail where id = #{id}
delete from tms_goods_detail where id in
#{id}