select
bcs.cargo_space_id,
bcs.warehouse_id,
bcs.roadway_id,
bcs.cargo_area_id,
bcs.the_type,
bcs.the_type_name,
bcs.cargo_space_name,
bcs.the_platoon,
bcs.the_column,
bcs.the_floor,
bcs.status,
bcs.locked,
bcs.tray_code,
bcs.cargo_hight,
bcs.iss_double,
bcs.group_coding_no,
bcs.group_coding,
bcs.cargo_space_logo,
bcs.this_cargo_area,
bw.warehouse_name
from bas_cargo_space bcs
left join bas_warehouse bw on bcs.warehouse_id = bw.warehouse_id
insert into bas_cargo_space
cargo_space_id,
warehouse_id,
roadway_id,
cargo_area_id,
the_type,
the_type_name,
cargo_space_name,
the_platoon,
the_column,
the_floor,
status,
locked,
tray_code,
cargo_hight,
iss_double,
group_coding_no,
group_coding,
cargo_space_logo,
this_cargo_area,
#{cargoSpaceId},
#{warehouseId},
#{roadwayId},
#{cargoAreaId},
#{theType},
#{theTypeName},
#{cargoSpaceName},
#{thePlatoon},
#{theColumn},
#{theFloor},
#{status},
#{locked},
#{trayCode},
#{cargoHight},
#{issDouble},
#{groupCodingNo},
#{groupCoding},
#{cargoSpaceLogo},
#{thisCargoArea},
update bas_cargo_space
warehouse_id = #{warehouseId},
roadway_id = #{roadwayId},
cargo_area_id = #{cargoAreaId},
the_type = #{theType},
the_type_name = #{theTypeName},
cargo_space_name = #{cargoSpaceName},
the_platoon = #{thePlatoon},
the_column = #{theColumn},
the_floor = #{theFloor},
status = #{status},
locked = #{locked},
tray_code = #{trayCode},
cargo_hight = #{cargoHight},
iss_double = #{issDouble},
group_coding_no = #{groupCodingNo},
group_coding = #{groupCoding},
cargo_space_logo = #{cargoSpaceLogo},
this_cargo_area = #{thisCargoArea},
where cargo_space_id = #{cargoSpaceId}
delete from bas_cargo_space where cargo_space_id = #{cargoSpaceId}
delete from bas_cargo_space where cargo_space_id in
#{cargoSpaceId}