update stock set quantity = #{dto.quantity} where id = #{dto.id} insert into stock (id, warehouse_id, product_id, quantity, activation) values (#{dto.id}, #{dto.warehouse_id}, #{dto.product_id}, #{dto.quantity}, 1) delete from stock where no = #{id}