select bc.budget_car_id, bc.budget_id, bc.car_id, c.license_plate, bc.days, bc.depreciation, bc.distance, bc.mileage, bc.expense from cmc_budget_car as bc left join cmc_car as c on c.car_id = bc.car_id insert into cmc_budget_car budget_car_id, budget_id, car_id, days, depreciation, distance, mileage, expense, #{budgetCarId}, #{budgetId}, #{carId}, #{days}, #{depreciation}, #{distance}, #{mileage}, #{expense}, update cmc_budget_car budget_id = #{budgetId}, car_id = #{carId}, days = #{days}, depreciation = #{depreciation}, distance = #{distance}, mileage = #{mileage}, expense = #{expense}, where budget_car_id = #{budgetCarId} delete from cmc_budget_car where budget_car_id = #{budgetCarId} delete from cmc_budget_car where budget_car_id in #{budgetCarId}