select year(occur_time) as 'year',month(occur_time) as 'month',day(occur_time) as 'day',sum(val) as 'val',data_type,1,min(occur_time) as 'date' from dc_report_cash_flow_log where is_delete=0 GROUP BY data_type,year(occur_time),month(occur_time),day(occur_time)
select year(pay_time) as 'year',month(pay_time) as 'month',day(pay_time) as 'day',sum(val) as 'val',data_type,2,min(pay_time) as 'date' from dc_report_cash_flow_log where is_delete=0 GROUP BY data_type,year(pay_time),month(pay_time),day(pay_time)
);
alter table dc_report_cash_flow_group_day rename dc_report_cash_flow_group_dayTemp;
alter table dc_report_cash_flow_group_day_temp rename dc_report_cash_flow_group_day;
alter table dc_report_cash_flow_group_dayTemp rename dc_report_cash_flow_group_day_temp;