select stock_id, warehouse_name, location_id, vehicle_id, goods_id, goods_name, batch_no, available_num, remain_num, real_num, provider_id,
provider_name, production_date, expiration_date, stock_status, goods_status, create_time, last_update_time, last_update_user, remark,
is_inventory, inventory_task_id, current_location, shelf_life,single_weight
from tbl_app_stock
insert into tbl_app_stock
stock_id,
warehouse_name,
location_id,
vehicle_id,
goods_id,
goods_name,
batch_no,
remain_num,
available_num,
real_num,
provider_id,
provider_name,
production_date,
expiration_date,
stock_status,
goods_status,
create_time,
last_update_time,
last_update_user,
remark,
is_inventory,
inventory_task_id,
current_location,
shelf_life,
single_weight
#{stockId},
#{warehouseName},
#{locationId},
#{vehicleId},
#{goodsId},
#{goodsName},
#{batchNo},
#{remainNum},
#{availableNum},
#{realNum},
#{providerId},
#{providerName},
#{productionDate},
#{expirationDate},
#{stockStatus},
#{goodsStatus},
#{createTime},
#{lastUpdateTime},
#{lastUpdateUser},
#{remark},
#{isInventory},
#{inventoryTaskId},
#{currentLocation},
#{shelfLife},
#{singleWeight}
update tbl_app_stock
location_id = #{locationId},
vehicle_id = #{vehicleId},
goods_id = #{goodsId},
goods_name = #{goodsName},
batch_no = #{batchNo},
remain_num = #{remainNum},
available_num = #{availableNum},
real_num = #{realNum},
provider_id = #{providerId},
provider_name = #{providerName},
production_date = #{productionDate},
expiration_date = #{expirationDate},
stock_status = #{stockStatus},
goods_status = #{goodsStatus},
create_time = #{createTime},
last_update_time = #{lastUpdateTime},
last_update_user = #{lastUpdateUser},
remark = #{remark},
is_inventory = #{isInventory},
inventory_task_id = #{inventoryTaskId},
current_location = #{currentLocation},
shelf_life = #{shelfLife},
single_weight = #{singleWeight},
where stock_id = #{stockId}
update tbl_app_stock set location_id = #{newLocationId} where location_id = #{oldLocationId}
update tbl_app_stock set location_id = #{newLocationId}, stock_status = #{status} where location_id = #{oldLocationId}
update tbl_app_stock set available_num = real_num;
delete from tbl_app_stock where stock_id = #{stockId}
delete from tbl_app_stock where location_id = #{locationId}
update tbl_app_stock set stock_status = #{status} where location_id = #{locationId}
update tbl_app_stock set available_num = #{availableNum} where stock_id = #{stockId}
update tbl_app_stock set production_date = #{productionDate} where stock_id = #{stockId}
update tbl_app_stock set location_id = #{locationId} where batch_no = #{batchNo}