diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml index e4180a9f..e8e3256d 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml @@ -236,13 +236,12 @@ group by t.parent_taskid ) t2 ON t2.parent_taskid = res.id - SET res.budget_cost = t2.budget_cost, - res.budget_workload = t2.budget_workload, + SET res.act_cost = t2.act_cost, res.act_workload = t2.act_workload, res.rate = case when t2.budget_workload=0 then 0 else t2.budget_workload_rate / t2.budget_workload end, - res.start_time = t2.start_time, - res.end_time = t2.end_time, + res.start_time = ifnull(res.start_time,t2.start_time), + res.end_time = ifnull(t2.end_time,t2.end_time), res.act_start_time = t2.act_start_time, res.act_end_time = t2.act_end_time, res.children_cnt = ifnull( t2.children_cnt, 0 ) @@ -261,13 +260,9 @@ SELECT t.parent_taskid, count(1) as children_cnt, - sum( ifnull( t.budget_cost, 0 ) ) AS budget_cost, - sum( ifnull( t.budget_workload, 0 ) ) AS budget_workload, sum( ifnull( t.act_cost, 0 ) ) AS act_cost, sum( ifnull( t.act_workload, 0 ) ) AS act_workload, sum( ifnull( t.budget_workload, 0 ) * ifnull( t.rate, 0 ) ) as budget_workload_rate, - min( t.start_time ) AS start_time, - max( t.end_time ) AS end_time, min( t.act_start_time ) AS act_start_time, max( t.act_end_time ) AS act_end_time FROM @@ -275,13 +270,12 @@ WHERE t.parent_taskid = #{item} ) t2 ON t2.parent_taskid = res.id - SET res.budget_cost = t2.budget_cost, - res.budget_workload = t2.budget_workload, + SET res.act_cost = t2.act_cost, res.act_workload = t2.act_workload, res.rate = case when t2.budget_workload=0 then 0 else t2.budget_workload_rate / t2.budget_workload end, - res.start_time = t2.start_time, - res.end_time = t2.end_time, + res.start_time = ifnull(res.start_time,t2.start_time), + res.end_time = ifnull(t2.end_time,t2.end_time), res.act_start_time = t2.act_start_time, res.act_end_time = t2.act_end_time , res.children_cnt = ifnull( t2.children_cnt, 0 )