diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml index ebf446a0d8..8b654a2ec8 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml @@ -129,17 +129,17 @@ order by instance.start_time desc - select id from t_ds_task_instance where process_instance_id = #{processInstanceId} and task_type = #{taskType} and state = #{state} and flag = 1 - select id from t_ds_task_instance where process_instance_id = - (select process_instance_id in t_ds_relation_process_instance where parent_task_instance_id = #{subProcessTaskId}) + (select process_instance_id from t_ds_relation_process_instance where parent_task_instance_id = #{subProcessTaskId}) and state = #{state} and flag = 1