order_code ,material_id,purchase_num,arrival_num,type,qualified_num,disqualification_num,wbs,arrival_time,measurement_id,supplier_id,entry_number,warehousing_num insert into tld_warehousing_virtual(unique_code, num, storage_location_code, wllb_code, supp_id, serial, type, produc_date, capacity, seq, user_id, storage_location_name, attribute, notice_id, warehouse_transfer_id, storage_location_code_ck,wbs, receive_goods_id, account_sleeve) values (#{uniqueCode}, #{num}, #{storageLocationCode}, #{wllbCode}, #{suppId}, #{serial}, #{type}, #{producDate}, #{capacity}, #{seq}, #{userId}, #{storageLocationName}, #{attribute}, #{noticeId}, #{warehouseTransferId}, #{storageLocationCodeCk},#{wbs},#{receiveGoodsId},#{accountSleeve}) delete from tld_warehousing_virtual where id = #{id} update tld_receive_goods set warehousing_num = warehousing_num + #{warehousingNum} where id = #{id} insert into tld_storage(wllb_code,supplier_id,serial,produc_date,produc_batch,capacity,seq,type,user_id,department_id,storage_location_code,scrq,storage_code,wbs,order_code) values (#{item.wllbCode},#{item.suppId},#{item.serial},#{item.producDate},#{item.producDate},#{item.num},#{item.seq},#{item.type},#{item.userId},#{item.departmentId},#{item.storageLocationCode},now(),#{item.storageCode},#{item.wbs},#{item.warehouseTransferId}) insert into tld_inventory(storage_location_code,wllb_class,material_id,amount,totime,hold,amount_lock,account_sleeve,wbs,supplier_id,serial,wllb_code,produc_date,scrq,produc_batch,attribute) values (#{item.storageLocationCode},#{item.wllbClass},#{item.materialId},#{item.num},now(),'0','0',#{item.accountSleeve},#{item.wbs},#{item.suppId},#{item.serial},#{item.wllbCode},#{item.producDate}, now(),#{item.producDate},#{item.attribute}) delete from tld_warehousing_virtual where unique_code = #{uniqueCode} insert into tld_return_gs_warehousing(storage_code, gs_ck, source_type, move_type, entry_number, wbs, material_id, warehousing_num, receive_goods_id, scrq, order_number, user_name, storage_location_code) values (#{storageCode}, #{gsCk}, #{sourceType}, #{moveType}, #{entryNumber}, #{wbs}, #{materialId}, #{warehousingNum}, #{id}, now(), #{orderNumber}, #{userName}, #{storageLocationCode}); insert into tld_inventory(storage_location_code, material_id, amount, hold, amount_lock, account_sleeve, wbs, produc_date, scrq, wllb_class, produc_batch, attribute, serial, supplier_id, wllb_code, totime) value (#{storageLocationCode},#{materialId},#{warehousingNum},'0','0',#{companyNumber},#{wbs},#{producBatch},now(),#{wllbClass},#{producBatch},#{attribute},#{serial},#{supplierId},#{wllbCode},now()); update tld_inventory set amount = amount + #{warehousingNum}, totime = now() where storage_location_code = #{storageLocationCode} and material_id = #{materialId} and wbs = #{wbs}; delete from tld_inventory where storage_location_code = #{storageLocationCode} and material_id = #{materialId} update tld_inventory set amount = amount - #{warehousingNum} where storage_location_code = #{storageLocationCode} and material_id = #{materialId} insert into tld_half_product(wllb_code, produc_date, produc_batch, capacity, user_id, storage_location_code, scrq, storage_code, wbs, production_code) value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{storageCode},#{wbs}, #{productionCode}) update tld_ask_goods set out_num = ifnull(out_num, 0) + #{warehousingNum}, type = '1' where id = #{id} insert into tld_removal_half_product(wllb_code, num, user_id, scrq, ask_goods_id, department, storage_code, wbs, company_number) value (#{wllbCode},#{num},#{userId},now(),#{askGoodsId},#{department},#{storageCode},#{wbs},#{companyNumber}) insert into tld_half(wllb_code, produc_date, produc_batch, capacity, user_id, storage_location_code, scrq, serial, seq, attribute, storage_code, wbs, production_code) value (#{wllbCode},#{producDate},#{producDate},#{num},#{userId},#{storageLocationCode},now(),#{serial},#{seq},#{attribute},#{storageCode},#{wbs},#{productionCode}) update tld_notice set warehousing_num = (warehousing_num + 0) + #{warehousingNum} ,type = '1' where notice_id = #{noticeId} and material_id = #{materialId} update tld_storage set storage_code = #{storageCode} where wllb_code = #{wllbCode} and supplier_id = #{suppId} and serial = #{serial} and produc_batch = #{producDate} update tld_inventory set amount = (amount + 0) + #{amount} where id = #{id} update tld_inventory set amount = amount + #{num} where material_id = #{materialId} and storage_location_code = #{storageLocationCode} insert into tld_return_gs_other_warehousing(storage_code, account_sleeve, storage_location_code, wbs, amount, material_id) value (#{storageCode},#{accountSleeve},#{storageLocationCode},#{wbs},#{num},#{materialId}) insert into tld_inventory(storage_location_code, wllb_class, library_type, material_id, amount, totime, amount_lock, account_sleeve, wbs, supplier_id, serial, wllb_code, produc_date, scrq, produc_batch, attribute) value (#{storageLocationCode},#{wllbClass},#{libraryType},#{materialId},#{amount},now(),'0',#{accountSleeve},#{wbs},#{supplierId},#{serial},#{wllbCode},#{producDate},now(),#{producDate},#{attribute})