|
@@ -234,7 +234,7 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="getTaskPlanRealData" resultType="java.util.Map">
|
|
<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.`plan_hours` as planHours,task.plan_cost as planCost,
|
|
|
|
|
|
+ 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) AS realHours,
|
|
task_executor.executor_id as executorId,task_executor.executor_name AS executorName,
|
|
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,
|
|
IF(task_executor.real_cost = 0, task.plan_cost, task_executor.real_cost) AS realCost,
|
|
@@ -708,7 +708,7 @@
|
|
</select>
|
|
</select>
|
|
<select id="getProjectAllTaskTimeCost"
|
|
<select id="getProjectAllTaskTimeCost"
|
|
resultType="com.management.platform.entity.vo.ProjectTaskTimeCostVO">
|
|
resultType="com.management.platform.entity.vo.ProjectTaskTimeCostVO">
|
|
- SELECT task.id as taskId,ifnull(task.`plan_hours`,0) as planHours,
|
|
|
|
|
|
+ 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) AS realHours,
|
|
task_executor.executor_id as executorId
|
|
task_executor.executor_id as executorId
|
|
FROM task
|
|
FROM task
|
|
@@ -717,4 +717,21 @@
|
|
WHERE task.project_id = #{projectId}
|
|
WHERE task.project_id = #{projectId}
|
|
and project.id = #{projectId}
|
|
and project.id = #{projectId}
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getProjectTaskTimeCostByIds" resultType="com.management.platform.entity.vo.ProjectTimeCostVO">
|
|
|
|
+ select project_id,sum(planHours) as planHoursSum,sum(realHours) as realHoursSum
|
|
|
|
+ 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,
|
|
|
|
+ task_executor.executor_id as executorId
|
|
|
|
+ FROM task
|
|
|
|
+ LEFT JOIN project ON project.id = task.`project_id`
|
|
|
|
+ left join task_executor on task_executor.task_id=task.id
|
|
|
|
+ WHERE task.project_id in
|
|
|
|
+ <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
|
|
|
|
+ #{projectId}
|
|
|
|
+ </foreach>
|
|
|
|
+ )tmp1
|
|
|
|
+ group by project_id
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|