select bs.budget_settle_id, bs.budget_id, bs.content, bs.price_id, bs.check_price_id, p.work_type, p.work_item, p.sub_item, p.scale_grade, p.unit, p.common_price, p.complex_price, cp.work_type as check_work_type, cp.work_item as check_work_item, cp.sub_item as check_sub_item, cp.scale_grade as check_scale_grade, cp.unit as check_unit, cp.common_price as check_common_price, cp.complex_price as check_complex_price, cp.remark as check_remark, bs.workload, bs.coefficient, bs.ground_type, bs.settle , bs.remark from cmc_budget_settle as bs left join cmc_price as p on p.id = bs.price_id left join cmc_check_price as cp on cp.id = bs.check_price_id insert into cmc_budget_settle budget_settle_id, budget_id, content, price_id, check_price_id, workload, coefficient, ground_type, settle, remark, #{budgetSettleId}, #{budgetId}, #{content}, #{priceId}, #{checkPriceId}, #{workload}, #{coefficient}, #{groundType}, #{settle}, #{remark}, update cmc_budget_settle budget_id = #{budgetId}, content = #{content}, price_id = #{priceId}, check_price_id = #{checkPriceId}, workload = #{workload}, coefficient = #{coefficient}, ground_type = #{groundType}, settle = #{settle}, remark = #{remark}, where budget_settle_id = #{budgetSettleId} delete from cmc_budget_settle where budget_id = #{budgetId} delete from cmc_budget_settle where budget_id in #{budgetId}