From 6df2206a9afdedb975e2b2d34cc025ded39f20ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Mon, 28 Feb 2022 16:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8A=82=E7=82=B9=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E3=80=81=E6=A0=87=E7=AD=BE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/xm/core/dao/XmTaskMapper.xml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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 )