select id,
       dealer_group_id as customer_group_id,
       charge_condition_id as payment_condition_code,
       payment_id as payment_type_code,
       payment_month as payment_month_code,
       payment_date as payment_date_code,
       encachement_month as encach_month_code,
       encachement_date as encach_date_code,
       dealer_group_note as note,
       NOW() as created_at,
       NOW() updated_at
FROM dealer_payments
INTO OUTFILE "/tmp/customer_group_payments.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';
