SELECT
        id,
        charge_id as charge_customer_id,
        dealer_group_id as charge_customer_group_id,
        NULL as user_id,
        j_dealer_name as disp_name,
        id as disp_sort,
        j_dealer_name as j_name,
        e_dealer_name as e_name,
        dealer_kana as kana_name,
        dealer_name1 as print_name_1,
        dealer_name2 as print_name_2,
        dealer_zip as zip,
        dealer_address1 as address_1,
        dealer_address2 as address_2,
        dealer_address3 as address_3,
        dealer_tel as tel,
        dealer_fax as fax,
        customer_title_id as title_code,
        1 as duty_type_code,
        5 as duty_rate,
        0 as price_duty_type_code,
        1 as duty_calc_type_code,
        1 as frac_digit_code,
        1 as fraction_method_code,
        1 as shipping_sheet_type_code,
        1 as sale_sheet_type_code,
        1 as charge_sheet_type_code,
        dealer_note as note,
        0 as invalid_flag_code,
        NULL as deleted_at,
        NOW() as created_at,
        NOW() as updated_at
FROM dealers
INTO OUTFILE "/tmp/customers.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';
