ifs.shipment_id,ifs.site,ifs.customer_no,ifs.customer_name,ifs.ship_date,sh.create_date
insert into shipment_handle(shipment_id, site, create_by, create_date)
values (#{shipmentId}, #{site}, #{createBy}, #{createDate})
insert into TransDetail(transno, site, itemno, partno, locationid, transqty, direction, batchno, standcost, actualcost, price, freight, duty, orderref1, orderref2, orderref3, orderref4, orderref5, remark, vitualpartflag, manufacturedate, expireddate, transqty2, costgroupid, orderreftype_db, orderreftype, wdr_no, enterdate, enterby)
values
(#{item.transNo}, #{item.site}, #{item.itemNo}, #{item.partNo}, #{item.locationID}, #{item.transQty}, #{item.direction}, #{item.batchNo}, #{item.standCost}, #{item.actualCost}, #{item.price}, #{item.freight}, #{item.duty}, #{item.orderRef1}, #{item.orderRef2}, #{item.orderRef3}, #{item.orderRef4}, #{item.orderRef5}, #{item.remark}, #{item.vitualPartFlag}, #{item.manufactureDate}, #{item.expiredDate}, #{item.transQty2}, #{item.costGroupID}, #{item.orderRefTypeDb}, #{item.orderRefType}, #{item.wdrNo}, #{item.enterDate}, #{item.enterBy})
insert into TransDetailsub(transno, site, seqno, itemno, locationid, batchno, boxno, rollno, rollqty, orderref1, orderref2, orderref3, orderref4, orderref5, remark)
values
(#{item.transNo}, #{item.site}, #{item.seqNo}, #{item.itemNo}, #{item.locationID}, #{item.batchNo}, #{item.boxNo}, #{item.rollNo}, #{item.rollQty}, #{item.orderRef1}, #{item.orderRef2}, #{item.orderRef3}, #{item.orderRef4}, #{item.orderRef5}, #{item.remark})
delete from shipment_handle
where shipment_id = #{shipmentId} and site = #{site}
exec dbo.UpdateTransNo #{site},#{spr}