From 17f516545b88e2b53cffed0afb289f3ac6b76159 Mon Sep 17 00:00:00 2001 From: ArgonarioD Date: Wed, 6 Jul 2022 12:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=9F=A5=E8=AF=A2su?= =?UTF-8?q?btask=E6=97=B6hasChildren=E5=AD=97=E6=AE=B5=E9=83=BD=E4=B8=BAtr?= =?UTF-8?q?ue=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/TaskMapper.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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}