select platform_type,web_site,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 occur_time_year_month_no,day(occur_time)
select platform_type,web_site,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 and occur_time>=@btime GROUP BY occur_time_year_month_no,day(occur_time)
select platform_type,web_site,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 pay_time_year_month_no,day(pay_time)
select platform_type,web_site,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 and pay_time>=@btime GROUP BY pay_time_year_month_no,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;
vardata=_connection.QueryFirstOrDefault<dc_report_cash_flow_forecast_task_input_dto>("select * from dc_report_cash_flow_forecast_task where id="+id);
data.sales=_connection.Query<dc_report_cash_flow_forecast_task_input_dto.sale_dto>(" select `date`,`val` from dc_report_cash_flow_forecast_task_sale where task_id=@task_id ",new{task_id=id}).ToList();
if(data.sales!=null&&data.sales.Count>=1)
vardata=_connection.QueryFirstOrDefault<dc_report_cash_flow_forecast_task_input_dto>("select * from dc_report_cash_flow_forecast_task where id="+id);
data.sales=_connection.Query<dc_report_cash_flow_forecast_task_input_dto.sale_dto>(" select `date`,`val` from dc_report_cash_flow_forecast_task_sale where task_id=@task_id ",new{task_id=id}).ToList();
varpay_sql=" select pay_time as 'date',sum(val) as 'val',data_type,1 as 'type',platform_type,web_site from dc_report_cash_flow_forecast_task_log where task_id=@task_id ";
varturnover_sql=" select * from dc_report_cash_flow_forecast_turnover where task_id=@task_id ";
vardata1=_connection.QueryFirstOrDefault<DateTime?>(" select min(occur_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata2=_connection.QueryFirstOrDefault<DateTime?>(" select min(pay_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata3=_connection.QueryFirstOrDefault<DateTime?>(" select max(occur_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata4=_connection.QueryFirstOrDefault<DateTime?>(" select max(pay_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata1=_connection.QueryFirstOrDefault<DateTime?>(" select min(occur_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata2=_connection.QueryFirstOrDefault<DateTime?>(" select min(pay_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata3=_connection.QueryFirstOrDefault<DateTime?>(" select max(occur_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});
vardata4=_connection.QueryFirstOrDefault<DateTime?>(" select max(pay_time) from dc_report_cash_flow_forecast_task_log where task_id=@task_id ",new{task_id=id});