|
@@ -235,7 +235,7 @@
|
|
|
</select>
|
|
|
<select id="getTaskPlanRealData" resultType="java.util.Map">
|
|
|
SELECT task.id,task.`name`,task_executor.id as teId, DATE_FORMAT(task.`end_date`, '%Y-%m-%d') as endDate, task_executor.`plan_hours` as planHours,task.plan_cost as planCost,
|
|
|
- (SELECT IFNULL(SUM(working_time),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1) AS realHours,
|
|
|
+ (SELECT IFNULL(SUM(working_time),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1 and report.creator_id = task_executor.executor_id) AS realHours,
|
|
|
task_executor.executor_id as executorId,task_executor.executor_name AS executorName,
|
|
|
IF(task_executor.real_cost = 0, task.plan_cost, task_executor.real_cost) AS realCost,
|
|
|
task.`task_status` as taskStatus, task.`task_type` as taskType,
|
|
@@ -709,7 +709,8 @@
|
|
|
<select id="getProjectAllTaskTimeCost"
|
|
|
resultType="com.management.platform.entity.vo.ProjectTaskTimeCostVO">
|
|
|
SELECT task.id as taskId,ifnull(task_executor.`plan_hours`,0) as planHours,
|
|
|
- (SELECT IFNULL(SUM(working_time),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1) AS realHours,
|
|
|
+ (SELECT IFNULL(SUM(working_time),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1
|
|
|
+ and report.creator_id = task_executor.executor_id) AS realHours,
|
|
|
task_executor.executor_id as executorId
|
|
|
FROM task
|
|
|
LEFT JOIN project ON project.id = task.`project_id`
|
|
@@ -722,7 +723,8 @@
|
|
|
from
|
|
|
(
|
|
|
SELECT task.project_id,task.id as taskId,ifnull(task_executor.`plan_hours`,0) as planHours,
|
|
|
- (SELECT IFNULL(SUM(working_time),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1) AS realHours,
|
|
|
+ (SELECT IFNULL(SUM(working_time),0) FROM report
|
|
|
+ WHERE report.`task_id` = task.id AND report.`state` = 1 and report.creator_id = task_executor.executor_id) AS realHours,
|
|
|
task_executor.executor_id as executorId
|
|
|
FROM task
|
|
|
LEFT JOIN project ON project.id = task.`project_id`
|