@ -18,13 +18,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace= "org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper" >
<mapper namespace= "org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper" >
<sql id= "baseSql" >
id, name, process_definition_id, state, recovery, start_time, end_time, run_times,host,
command_type, command_param, task_depend_type, max_try_times, failure_strategy, warning_type,
warning_group_id, schedule_time, command_start_time, global_params, process_instance_json, flag,
update_time, is_sub_process, executor_id, locations, connects, history_cmd, dependence_schedule_times,
process_instance_priority, worker_group, timeout, tenant_id, var_pool
</sql>
<select id= "queryDetailById" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryDetailById" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select inst.*
select
from t_ds_process_instance inst
<include refid= "baseSql" />
where inst.id = #{processId}
from t_ds_process_instance
where id = #{processId}
</select>
</select>
<select id= "queryByHostAndStatus" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryByHostAndStatus" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where 1=1
where 1=1
<if test= "host != null and host != ''" >
<if test= "host != null and host != ''" >
@ -38,7 +47,8 @@
</select>
</select>
<select id= "queryTopNProcessInstance" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryTopNProcessInstance" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where state = #{status}
where state = #{status}
and start_time between
and start_time between
@ -48,7 +58,8 @@
</select>
</select>
<select id= "queryByTenantIdAndStatus" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryByTenantIdAndStatus" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where 1=1
where 1=1
<if test= "tenantId != -1" >
<if test= "tenantId != -1" >
@ -62,7 +73,8 @@
</select>
</select>
<select id= "queryByWorkerGroupIdAndStatus" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryByWorkerGroupIdAndStatus" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where 1=1
where 1=1
<if test= "workerGroupId != -1" >
<if test= "workerGroupId != -1" >
@ -76,10 +88,17 @@
</select>
</select>
<select id= "queryProcessInstanceListPaging" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryProcessInstanceListPaging" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select instance.id,instance.name,instance.process_definition_id,instance.state,instance.recovery,instance.start_time,instance.end_time,instance.run_times,instance.host,instance.command_type,instance.command_param,
select
instance.task_depend_type,instance.max_try_times,instance.failure_strategy,instance.warning_type,instance.warning_group_id,instance.schedule_time,instance.command_start_time,instance.global_params,instance.flag,
instance.id, instance.name, instance.process_definition_id, instance.state, instance.recovery,
instance.update_time,instance.is_sub_process,instance.executor_id,instance.locations,instance.connects,instance.history_cmd,instance.dependence_schedule_times,instance.process_instance_priority,instance.worker_group,
instance.start_time, instance.end_time, instance.run_times, instance.host,
instance.timeout,instance.tenant_id
instance.command_type, instance.command_param, instance.task_depend_type, instance.max_try_times,
instance.failure_strategy, instance.warning_type,
instance.warning_group_id, instance.schedule_time, instance.command_start_time, instance.global_params,
instance.process_instance_json, instance.flag,
instance.update_time, instance.is_sub_process, instance.executor_id, instance.locations, instance.connects,
instance.history_cmd, instance.dependence_schedule_times,
instance.process_instance_priority, instance.worker_group, instance.timeout, instance.tenant_id,
instance.var_pool
from t_ds_process_instance instance
from t_ds_process_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
where 1=1
where 1=1
@ -153,13 +172,15 @@
group by t.state
group by t.state
</select>
</select>
<select id= "queryByProcessDefineId" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryByProcessDefineId" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where process_definition_id=#{processDefinitionId}
where process_definition_id=#{processDefinitionId}
order by start_time desc limit #{size}
order by start_time desc limit #{size}
</select>
</select>
<select id= "queryLastSchedulerProcess" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryLastSchedulerProcess" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where process_definition_id=#{processDefinitionId}
where process_definition_id=#{processDefinitionId}
<if test= "startTime!=null and endTime != null " >
<if test= "startTime!=null and endTime != null " >
@ -168,7 +189,8 @@
order by end_time desc limit 1
order by end_time desc limit 1
</select>
</select>
<select id= "queryLastRunningProcess" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryLastRunningProcess" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where process_definition_id=#{processDefinitionId}
where process_definition_id=#{processDefinitionId}
<if test= "states !=null and states.length != 0" >
<if test= "states !=null and states.length != 0" >
@ -184,7 +206,8 @@
order by start_time desc limit 1
order by start_time desc limit 1
</select>
</select>
<select id= "queryLastManualProcess" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
<select id= "queryLastManualProcess" resultType= "org.apache.dolphinscheduler.dao.entity.ProcessInstance" >
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where process_definition_id=#{processDefinitionId}
where process_definition_id=#{processDefinitionId}
and schedule_time is null
and schedule_time is null
@ -195,7 +218,8 @@
</select>
</select>
<select id= "queryByProcessDefineIdAndStatus"
<select id= "queryByProcessDefineIdAndStatus"
resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
select *
select
<include refid= "baseSql" />
from t_ds_process_instance
from t_ds_process_instance
where process_definition_id=#{processDefinitionId}
where process_definition_id=#{processDefinitionId}
and state in
and state in