diff --git a/src/main/resources/mapper/TaskMapper.xml b/src/main/resources/mapper/TaskMapper.xml index ddfe28f..59fa44d 100644 --- a/src/main/resources/mapper/TaskMapper.xml +++ b/src/main/resources/mapper/TaskMapper.xml @@ -6,10 +6,10 @@ task_name, task_project_id, task_holder_id, - s.staff_fullname AS task_holder_name, + s.staff_fullname AS task_holder_name, task_status, task_type, - task_father_id, + t.task_father_id, task_created_time, task_start_time, task_end_time, @@ -17,11 +17,12 @@ task_priority, task_description, attached_info, - EXISTS(SELECT task_id FROM task WHERE task_father_id = task.task_id) AS has_children - FROM task - JOIN (SELECT staff_id, staff_fullname FROM staff) AS s ON task.task_holder_id = s.staff_id + judge.task_father_id IS NOT NULL AS has_children + FROM task AS t + JOIN (SELECT staff_id, staff_fullname FROM staff) AS s ON t.task_holder_id = s.staff_id + LEFT JOIN (SELECT DISTINCT task_father_id FROM task) AS judge ON t.task_id = judge.task_father_id WHERE is_deleted = 0 AND task_project_id = #{projectId} - AND task_father_id = #{fatherId} + AND t.task_father_id = #{fatherId}