left join (select process_definition_id,release_state as schedule_release_state from t_ds_schedules group by process_definition_id,release_state) sc on sc.process_definition_id = td.id
left join (select process_definition_id,release_state as schedule_release_state from t_ds_schedules group by
left join t_ds_user tu on td.user_id = tu.id
process_definition_id,release_state) sc on sc.process_definition_id = td.id
(SELECT COUNT(*) FROM t_ds_process_definition AS def WHERE def.project_id = p.id) AS def_count,
(SELECT COUNT(*) FROM t_ds_process_definition AS def WHERE def.project_id = p.id) AS def_count,
(SELECT COUNT(*) FROM t_ds_process_definition def, t_ds_process_instance inst WHERE def.id = inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count
(SELECT COUNT(*) FROM t_ds_process_definition def, t_ds_process_instance inst WHERE def.id =
inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count
from t_ds_project p
from t_ds_project p
join t_ds_user u on u.id=p.user_id
join t_ds_user u on u.id=p.user_id
where 1=1
where 1=1
<iftest="userId != 0">
<iftest="userId != 0">
and p.id in
and p.id in
(select project_id from t_ds_relation_project_user where user_id=#{userId}
(select project_id from t_ds_relation_project_user where user_id=#{userId}
union select id as project_id from t_ds_project where user_id=#{userId}
union select id as project_id from t_ds_project where user_id=#{userId}
instance.host,instance.execute_path,instance.log_path,instance.alert_flag,instance.retry_times,instance.pid,instance.app_link,instance.flag,instance.retry_interval,instance.max_retry_times,instance.task_instance_priority,instance.worker_group,instance.executor_id,process.name as process_instance_name
<includerefid="baseSqlV2">
<propertyname="alias"value="instance"/>
</include>
,
process.name as process_instance_name
from t_ds_task_instance instance
from t_ds_task_instance instance
join t_ds_process_definition define ON instance.process_definition_id = define.id
join t_ds_process_definition define on instance.process_definition_id = define.id
join t_ds_process_instance process on process.id=instance.process_instance_id
join t_ds_process_instance process on process.id=instance.process_instance_id
where define.project_id = #{projectId}
where define.project_id = #{projectId}
<iftest="startTime != null">
<iftest="startTime != null">
and instance.start_time > #{startTime} and instance.start_time <![CDATA[ <=]]> #{endTime}
and instance.start_time > #{startTime} and instance.start_time <![CDATA[ <=]]> #{endTime}
@ -111,7 +130,7 @@
and instance.process_instance_id = #{processInstanceId}
and instance.process_instance_id = #{processInstanceId}
</if>
</if>
<iftest="searchVal != null and searchVal != ''">
<iftest="searchVal != null and searchVal != ''">
and instance.name like concat('%', #{searchVal}, '%')
and instance.name like concat('%', #{searchVal}, '%')
</if>
</if>
<iftest="taskName != null and taskName != ''">
<iftest="taskName != null and taskName != ''">
and instance.name=#{taskName}
and instance.name=#{taskName}
@ -129,7 +148,7 @@
and instance.executor_id = #{executorId}
and instance.executor_id = #{executorId}
</if>
</if>
<iftest="processInstanceName != null and processInstanceName != ''">
<iftest="processInstanceName != null and processInstanceName != ''">
and process.name like concat('%', #{processInstanceName}, '%')
and process.name like concat('%', #{processInstanceName}, '%')