|
|
@ -40,19 +40,23 @@ |
|
|
|
<if test="host != null and host != ''"> |
|
|
|
<if test="host != null and host != ''"> |
|
|
|
and host=#{host} |
|
|
|
and host=#{host} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and state in |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
and state in |
|
|
|
#{i} |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
</foreach> |
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
order by id asc |
|
|
|
order by id asc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<select id="queryNeedFailoverProcessInstanceHost" resultType="String"> |
|
|
|
<select id="queryNeedFailoverProcessInstanceHost" resultType="String"> |
|
|
|
select distinct host |
|
|
|
select distinct host |
|
|
|
from t_ds_process_instance |
|
|
|
from t_ds_process_instance |
|
|
|
where state in |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
where state in |
|
|
|
#{i} |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
</foreach> |
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="queryTopNProcessInstance" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
|
|
|
<select id="queryTopNProcessInstance" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
|
|
@ -77,10 +81,12 @@ |
|
|
|
<if test="tenantId != -1"> |
|
|
|
<if test="tenantId != -1"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and state in |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
and state in |
|
|
|
#{i} |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
</foreach> |
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
order by id asc |
|
|
|
order by id asc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
@ -92,10 +98,12 @@ |
|
|
|
<if test="workerGroupName != ''"> |
|
|
|
<if test="workerGroupName != ''"> |
|
|
|
and worker_group =#{workerGroupName} |
|
|
|
and worker_group =#{workerGroupName} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
and state in |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
and state in |
|
|
|
#{i} |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
</foreach> |
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
order by id asc |
|
|
|
order by id asc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
@ -134,10 +142,13 @@ |
|
|
|
<update id="setFailoverByHostAndStateArray"> |
|
|
|
<update id="setFailoverByHostAndStateArray"> |
|
|
|
update t_ds_process_instance |
|
|
|
update t_ds_process_instance |
|
|
|
set host=null |
|
|
|
set host=null |
|
|
|
where host =#{host} and state in |
|
|
|
where host =#{host} |
|
|
|
<foreach collection="states" index="index" item="i" open="(" close=")" separator=","> |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
#{i} |
|
|
|
and state in |
|
|
|
</foreach> |
|
|
|
<foreach collection="states" index="index" item="i" open="(" close=")" separator=","> |
|
|
|
|
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
</update> |
|
|
|
</update> |
|
|
|
<update id="updateProcessInstanceByState"> |
|
|
|
<update id="updateProcessInstanceByState"> |
|
|
|
update t_ds_process_instance |
|
|
|
update t_ds_process_instance |
|
|
@ -225,10 +236,12 @@ |
|
|
|
<include refid="baseSql"/> |
|
|
|
<include refid="baseSql"/> |
|
|
|
from t_ds_process_instance |
|
|
|
from t_ds_process_instance |
|
|
|
where process_definition_code=#{processDefinitionCode} |
|
|
|
where process_definition_code=#{processDefinitionCode} |
|
|
|
and state in |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
and state in |
|
|
|
#{i} |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
</foreach> |
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
order by id asc |
|
|
|
order by id asc |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
<select id="queryByProcessDefineCodeAndProcessDefinitionVersionAndStatusAndNextId" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
|
|
|
<select id="queryByProcessDefineCodeAndProcessDefinitionVersionAndStatusAndNextId" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
|
|
@ -237,10 +250,12 @@ |
|
|
|
from t_ds_process_instance |
|
|
|
from t_ds_process_instance |
|
|
|
where process_definition_code=#{processDefinitionCode} |
|
|
|
where process_definition_code=#{processDefinitionCode} |
|
|
|
and process_definition_version = #{processDefinitionVersion} |
|
|
|
and process_definition_version = #{processDefinitionVersion} |
|
|
|
and state in |
|
|
|
<if test="states != null and states.length != 0"> |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
and state in |
|
|
|
#{i} |
|
|
|
<foreach collection="states" item="i" open="(" close=")" separator=","> |
|
|
|
</foreach> |
|
|
|
#{i} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
and next_process_instance_id=0 |
|
|
|
and next_process_instance_id=0 |
|
|
|
and id <![CDATA[ < ]]> #{id} |
|
|
|
and id <![CDATA[ < ]]> #{id} |
|
|
|
order by id desc |
|
|
|
order by id desc |
|
|
|