-- 将停车位置为占用状态
UPDATE parkingspotinformation
SET occupancy_status = 1
WHERE parking_spot_id = ?
-- 更新停车记录的结束时间
UPDATE parkingrecord
SET end_time = ?
WHERE record_id = ?;
-- 修改用户信息
update userinformation
set name=?,telephone=?,user_type=?,parking_spot_id=?,address=?,gender=?
where user_id=?
-- 对指定user_id的用户记录进行更新
UPDATE userinformation SET name=?,gender=?, telephone=?, address=?WHERE user_id=?；
-- 将特定车型的停车费用提高10%
UPDATE ParkingRecord pr
JOIN VehicleInformation vi ON pr.car_license = vi.car_license
JOIN ParkingSpotInformation psi ON pr.parking_spot_id = psi.parking_spot_id
SET pr.parking_fee = pr.parking_fee * 1.1
WHERE vi.brand = ?;
-- 将停车超过 6 小时的记录的停车费用增加 20%
UPDATE ParkingRecord
SET parking_fee = parking_fee * 1.2
WHERE TIMESTAMPDIFF(HOUR, start_time, end_time) > 6;
-- 更新停车记录的车辆信息
UPDATE ParkingRecord pr
JOIN VehicleInformation vi ON pr.car_license = vi.car_license
SET vi.brand = ?, vi.model = ?
WHERE pr.record_id = ?;
