select car_id, shop_user_car.user_id, car_model, shop_user_car.car_no, maintenance_date, maintenance_mileage,
inspection_date, insurance_date, next_maintenance_date, next_maintenance_mileage,
next_inspection_date, insurance_expiry_date,car_brand,car_nature,car_register_date,car_license_img,
sys_user.nickname realName,sys_user.mobile phonenumber
from shop_user_car shop_user_car left join system_users sys_user on shop_user_car.user_id = sys_user.id
insert into shop_user_car
user_id,
car_model,
car_no,
maintenance_date,
maintenance_mileage,
inspection_date,
insurance_date,
next_maintenance_date,
next_maintenance_mileage,
next_inspection_date,
insurance_expiry_date,
car_brand,
car_nature,
car_register_date,
car_license_img,
#{userId},
#{carModel},
#{carNo},
#{maintenanceDate},
#{maintenanceMileage},
#{inspectionDate},
#{insuranceDate},
#{nextMaintenanceDate},
#{nextMaintenanceMileage},
#{nextInspectionDate},
#{insuranceExpiryDate},
#{carBrand},
#{carNature},
#{carRegisterDate},
#{carLicenseImg},
update shop_user_car
user_id = #{userId},
car_model = #{carModel},
car_no = #{carNo},
maintenance_date = #{maintenanceDate},
maintenance_mileage = #{maintenanceMileage},
inspection_date = #{inspectionDate},
insurance_date = #{insuranceDate},
next_maintenance_date = #{nextMaintenanceDate},
next_maintenance_mileage = #{nextMaintenanceMileage},
next_inspection_date = #{nextInspectionDate},
insurance_expiry_date = #{insuranceExpiryDate},
car_brand = #{carBrand},
car_nature = #{carNature},
car_register_date = #{carRegisterDate},
car_license_img = #{carLicenseImg},
where car_id = #{carId}
delete from shop_user_car where car_id = #{carId}
delete from shop_user_car where car_id in
#{carId}
delete from shop_user_car
where user_id = #{userId}