select task_id, task_no, scope_type, warehouse_id, warehouse_code, warehouse_name,
location_id, location_code, location_name, category_id, category_code, category_name,
owner_user_id, owner_user_name, task_status, issue_time, finish_time,
create_by, create_time, update_by, update_time, remark, del_flag
from ams_inventory_task
insert into ams_inventory_task (
task_no, scope_type, warehouse_id, warehouse_code, warehouse_name,
location_id, location_code, location_name, category_id, category_code, category_name,
owner_user_id, owner_user_name, task_status, create_by, create_time, remark, del_flag
) values (
#{taskNo}, #{scopeType}, #{warehouseId}, #{warehouseCode}, #{warehouseName},
#{locationId}, #{locationCode}, #{locationName}, #{categoryId}, #{categoryCode}, #{categoryName},
#{ownerUserId}, #{ownerUserName}, #{taskStatus}, #{createBy}, #{createTime}, #{remark}, #{delFlag}
)
update ams_inventory_task
set scope_type = #{scopeType},
warehouse_id = #{warehouseId},
warehouse_code = #{warehouseCode},
warehouse_name = #{warehouseName},
location_id = #{locationId},
location_code = #{locationCode},
location_name = #{locationName},
category_id = #{categoryId},
category_code = #{categoryCode},
category_name = #{categoryName},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark}
where task_id = #{taskId} and del_flag = '0' and task_status = 'DRAFT'
update ams_inventory_task
task_status = #{taskStatus},
issue_time = #{issueTime},
finish_time = #{finishTime},
update_by = #{updateBy},
update_time = #{updateTime},
where task_id = #{taskId} and del_flag = '0'
and task_status = #{params.expectedStatus}
and task_status in
#{status}
and task_status not in
#{status}
update ams_inventory_task_item
set inventory_warehouse_id = #{inventoryWarehouseId},
inventory_warehouse_name = #{inventoryWarehouseName},
inventory_location_id = #{inventoryLocationId},
inventory_location_name = #{inventoryLocationName},
inventory_result = #{inventoryResult},
inventory_user_id = #{inventoryUserId},
inventory_user_name = #{inventoryUserName},
inventory_time = #{inventoryTime},
update_by = #{updateBy},
update_time = #{updateTime},
remark = #{remark}
where item_id = #{itemId}
and task_id = #{taskId}
and del_flag = '0'
update ams_inventory_task
set del_flag = '1'
where task_id = #{taskId} and del_flag = '0' and task_status = 'DRAFT'
update ams_inventory_task
set del_flag = '1'
where task_id in
#{taskId}
and del_flag = '0' and task_status = 'DRAFT'
update ams_inventory_task_item
set del_flag = '1'
where task_id in
#{taskId}
and del_flag = '0'
update ams_inventory_task_item
set del_flag = '1'
where task_id = #{taskId} and del_flag = '0'
insert into ams_inventory_task_item (
task_id, task_no, asset_id, asset_code, asset_name, category_id, category_code,
category_name, spec_model, brand, book_warehouse_id, book_warehouse_name,
book_location_id, book_location_name, create_by, create_time, remark, del_flag
) values
(
#{item.taskId}, #{item.taskNo}, #{item.assetId}, #{item.assetCode}, #{item.assetName},
#{item.categoryId}, #{item.categoryCode}, #{item.categoryName}, #{item.specModel}, #{item.brand},
#{item.bookWarehouseId}, #{item.bookWarehouseName}, #{item.bookLocationId},
#{item.bookLocationName}, #{item.createBy}, #{item.createTime}, #{item.remark}, #{item.delFlag}
)