SELECT task.id,tg.id as groupId, task.`name`,task.executor_name,task.executor_id,DATE_FORMAT(task.`end_date`, '%Y-%m-%d') as end_date, task.`plan_hours`,
(SELECT IFNULL(SUM(working_time),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1) AS real_hours,
+ (SELECT IFNULL(SUM(cost),0) FROM report WHERE report.`task_id` = task.id AND report.`state` = 1) AS real_cost,
task.`task_status`, task.`task_type`,
project.`project_code`, project.`project_name`,tg.name as groupName