insert into mp_fifth_payment_record( mp_id, fifth_planned_payment_amount, planned_payment_date, category, reimburser, actual_payment_amount, actual_payment_date, id, payment_count, payment_target ) values ( #{mpId}, 0 #{fifthPlannedPaymentAmount}, #{plannedPaymentDate}, #{category}, #{reimburser}, 0 #{actualPaymentAmount}, #{actualPaymentDate}, #{id}, 0 #{paymentCount}, #{paymentTarget} ) delete from mp_fifth_payment_record t where 1 = 1 and t.id = #{id} and t.mp_id = #{mpId} and t.category = #{category} and t.payment_count = #{paymentCount} and t.planned_payment_date >= #{startPlannedDate} and t.planned_payment_date <= #{endPlannedDate} update mp_fifth_payment_record t set t.id = #{id} ,t.b_id = #{newBId} , t.mp_id = #{mpId} , t.fifth_planned_payment_amount = #{fifthPlannedPaymentAmount} , t.planned_payment_date = #{plannedPaymentDate} , t.category = #{category} , t.reimburser = #{reimburser} , t.actual_payment_amount = #{actualPaymentAmount} , t.actual_payment_date = #{actualPaymentDate} , t.payment_count = #{paymentCount} where 1=1 and t.id = #{id} insert into mp_fifth_payment_record( mp_id, fifth_planned_payment_amount, planned_payment_date, category, reimburser, actual_payment_amount, actual_payment_date, id, payment_count ) values ( #{item.mpId}, 0#{item.fifthPlannedPaymentAmount}, #{item.plannedPaymentDate}, #{item.category}, #{item.reimburser}, 0#{item.actualPaymentAmount}, #{item.actualPaymentDate}, #{id}, 0#{item.paymentCount})