Commit 774bed6a by 泽锋 李

修改 现金流汇总的计算

parent 4afce949
......@@ -1784,15 +1784,15 @@ start transaction;
-- 清空视图表的数据
Truncate table dc_report_cash_flow_group_day_temp;
insert dc_report_cash_flow_group_day_temp (`year`,`month`,`day`,`val`,`data_type`,`type`,`date`)
insert dc_report_cash_flow_group_day_temp (`platform_type`,`web_site`,`year`,`month`,`day`,`val`,`data_type`,`type`,`date`)
(
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 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)
)
;
insert dc_report_cash_flow_group_day_temp (`year`,`month`,`day`,`val`,`data_type`,`type`,`date`)
insert dc_report_cash_flow_group_day_temp (`platform_type`,`web_site`,`year`,`month`,`day`,`val`,`data_type`,`type`,`date`)
(
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)
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)
);
alter table dc_report_cash_flow_group_day rename dc_report_cash_flow_group_dayTemp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment