alter table master_app_production.customer_group_payments add payment_condition_price int(11) after customer_group_id;
update master_app_production.customer_group_payments set payment_condition_price = (payment_condition_code DIV 10) * 10000;
update master_app_production.customer_group_payments set payment_condition_price = NULL WHERE payment_condition_code - (payment_condition_code DIV 10) * 10 in (1,2); 
update master_app_production.customer_group_payments set payment_condition_code = CASE WHEN payment_condition_code - (payment_condition_code DIV 10) * 10 = 3 THEN 1 WHEN  payment_condition_code - (payment_condition_code DIV 10) * 10 = 4 THEN 2 ELSE NULL END; 
update master_app_production.customer_group_payments set payment_type_code = CASE WHEN payment_type_code = 0 THEN 1 WHEN payment_type_code > 0 THEN 2 ELSE NULL END;

alter table master_app_production.supplier_group_payments add payment_condition_price int(11) after supplier_group_id;
update master_app_production.supplier_group_payments set payment_condition_price = (payment_condition_code DIV 10) * 10000;
update master_app_production.supplier_group_payments set payment_condition_price = NULL WHERE payment_condition_code - (payment_condition_code DIV 10) * 10 in (1,2); 
update master_app_production.supplier_group_payments set payment_condition_code = CASE WHEN payment_condition_code - (payment_condition_code DIV 10) * 10 = 3 THEN 1 WHEN  payment_condition_code - (payment_condition_code DIV 10) * 10 = 4 THEN 2 ELSE NULL END; 
update master_app_production.supplier_group_payments set payment_type_code = CASE WHEN payment_type_code = 0 THEN 1 WHEN payment_type_code > 0 THEN 2 ELSE NULL END;

delete from master_app_production.code_masters where code_type_id = 38;
insert into master_app_production.code_masters set code_type_id=38, code_number=1,disp_name="以上", disp_sort=1, j_name="以上", e_name="greater than or equal to", invalid_flag_code=0, created_at=NOW(), updated_at=NOW();
insert into master_app_production.code_masters set code_type_id=38, code_number=2,disp_name="超え", disp_sort=2, j_name="超え", e_name="greater than", invalid_flag_code=0, created_at=NOW(), updated_at=NOW();

delete from master_app_production.code_masters where code_type_id = 39;
insert into master_app_production.code_masters set code_type_id=39, code_number=1,disp_name="振込", disp_sort=1, j_name="振込", e_name="transfer", invalid_flag_code=0, created_at=NOW(), updated_at=NOW();
insert into master_app_production.code_masters set code_type_id=39, code_number=2,disp_name="手形", disp_sort=2, j_name="手形", e_name="bill", invalid_flag_code=0, created_at=NOW(), updated_at=NOW();
