Commit 680f9c0e by guominglei

插件端开启调度和撤销调度

parent e124cbe9
package com.byit.mapper; package com.byit.mapper;
import com.byit.model.JobTask; import com.byit.model.JobTask;
import com.byit.model.JobTaskSchedule;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -55,9 +56,9 @@ public interface JobTaskMapper { ...@@ -55,9 +56,9 @@ public interface JobTaskMapper {
/** /**
* 根据id删除多个 * 根据id删除多个
* @param jobTasks * @param jobTaskSchedules
*/ */
void deleteInId(@Param("jobTasks") List<JobTask> jobTasks); void deleteInId(@Param("jobTaskSchedules") List<JobTaskSchedule> jobTaskSchedules);
/** /**
* 根据runid删除运行信息 * 根据runid删除运行信息
......
...@@ -15,10 +15,11 @@ import java.util.List; ...@@ -15,10 +15,11 @@ import java.util.List;
public interface JobTaskRunLogMapper { public interface JobTaskRunLogMapper {
/** /**
* 查询没有结束的节点 * 查询没有结束的节点
* @param nodIds * @param nodeIds
* @param runId
* @return * @return
*/ */
int findJobTaskRunLogNotEndNodeByRunCodeCount(@Param("nodeIds") List<Integer> nodeIds); List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(@Param("nodeIds") List<Integer> nodeIds, @Param("runId") String runId);
/** /**
* 查根据flowId和RunId查询一批节点 * 查根据flowId和RunId查询一批节点
......
...@@ -2,7 +2,6 @@ package com.byit.service; ...@@ -2,7 +2,6 @@ package com.byit.service;
import com.byit.model.JobTaskRunLog; import com.byit.model.JobTaskRunLog;
import com.byit.model.JobTaskRunLogWithBLOBs; import com.byit.model.JobTaskRunLogWithBLOBs;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -17,9 +16,10 @@ public interface JobTaskRunLogService { ...@@ -17,9 +16,10 @@ public interface JobTaskRunLogService {
/** /**
* 查询没有结束的节点 * 查询没有结束的节点
* @param nodIds * @param nodIds
* @param runId
* @return * @return
*/ */
int findJobTaskRunLogNotEndNodeByRunCodeCount(List<Integer> nodIds); List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(List<Integer> nodIds, String runId);
/** /**
* 查根据flowId和RunId查询一批节点 * 查根据flowId和RunId查询一批节点
* @param flowId * @param flowId
......
package com.byit.service; package com.byit.service;
import com.byit.model.JobTask; import com.byit.model.JobTask;
import org.apache.ibatis.annotations.Param; import com.byit.model.JobTaskSchedule;
import java.util.List; import java.util.List;
...@@ -42,5 +42,5 @@ public interface JobTaskService { ...@@ -42,5 +42,5 @@ public interface JobTaskService {
* 根据集合删除 * 根据集合删除
* @param jobTasks * @param jobTasks
*/ */
void removeMythJobTaskInIds(List<JobTask> jobTasks); void removeMythJobTaskInIds(List<JobTaskSchedule> jobTasks);
} }
...@@ -29,8 +29,8 @@ public class JobTaskRunLogServiceImpl implements JobTaskRunLogService { ...@@ -29,8 +29,8 @@ public class JobTaskRunLogServiceImpl implements JobTaskRunLogService {
} }
@Override @Override
public int findJobTaskRunLogNotEndNodeByRunCodeCount(List<Integer> nodIds) { public List<JobTaskRunLog> findJobTaskRunLogNotEndNodeByRunCodeCount(List<Integer> nodIds, String runId) {
return jobTaskRunLogMapper.findJobTaskRunLogNotEndNodeByRunCodeCount(nodIds); return jobTaskRunLogMapper.findJobTaskRunLogNotEndNodeByRunCodeCount(nodIds, runId);
} }
@Override @Override
......
...@@ -2,6 +2,7 @@ package com.byit.service.impl; ...@@ -2,6 +2,7 @@ package com.byit.service.impl;
import com.byit.mapper.JobTaskMapper; import com.byit.mapper.JobTaskMapper;
import com.byit.model.JobTask; import com.byit.model.JobTask;
import com.byit.model.JobTaskSchedule;
import com.byit.service.JobTaskService; import com.byit.service.JobTaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -62,10 +63,10 @@ public class JobTaskServiceImpl implements JobTaskService { ...@@ -62,10 +63,10 @@ public class JobTaskServiceImpl implements JobTaskService {
/** /**
* 删除多个任务 根据id * 删除多个任务 根据id
* @param jobTasks 任务实体 * @param jobTaskSchedules 任务实体
*/ */
@Override @Override
public void removeMythJobTaskInIds(List<JobTask> jobTasks) { public void removeMythJobTaskInIds(List<JobTaskSchedule> jobTaskSchedules) {
jobTaskMapper.deleteInId(jobTasks); jobTaskMapper.deleteInId(jobTaskSchedules);
} }
} }
...@@ -3,6 +3,7 @@ package com.byit.thread; ...@@ -3,6 +3,7 @@ package com.byit.thread;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.byit.job.WorkRoulette; import com.byit.job.WorkRoulette;
import com.byit.model.JobTask; import com.byit.model.JobTask;
import com.byit.model.JobTaskRunLog;
import com.byit.model.JobTaskRunLogWithBLOBs; import com.byit.model.JobTaskRunLogWithBLOBs;
import com.byit.model.JobTaskSchedule; import com.byit.model.JobTaskSchedule;
import com.byit.service.JobTaskRunLogService; import com.byit.service.JobTaskRunLogService;
...@@ -137,17 +138,28 @@ public class JobScheduleHelper{ ...@@ -137,17 +138,28 @@ public class JobScheduleHelper{
//在日志表里面创建一条记录 //在日志表里面创建一条记录
//根据 map_flow_id查询当前的版本的工作流 使用祝工作流的runId 保存到执行记录表和任务表 //根据 map_flow_id查询当前的版本的工作流 使用祝工作流的runId 保存到执行记录表和任务表
}else{ }else{
List<Integer> dependIdByNodeId = nodeDependencyService.findDependIdByNodeId(jobTask.getNodeId());
int jobTaskRunLogNotEndNodeByRunCodeCount = 0;
if (CollectionUtil.isNotEmpty(dependIdByNodeId)){
jobTaskRunLogNotEndNodeByRunCodeCount = jobTaskRunLogService.findJobTaskRunLogNotEndNodeByRunCodeCount(dependIdByNodeId);
}
if("start".equals(jobTask.getNodeName()) || (jobTaskRunLogNotEndNodeByRunCodeCount==0)){
if("start".equals(jobTask.getNodeName()) ){
log.debug("任务:{}", jobTask); log.debug("任务:{}", jobTask);
JobTaskSchedule jobTaskSchedule = new JobTaskSchedule(); JobTaskSchedule jobTaskSchedule = new JobTaskSchedule();
BeanUtils.copyProperties(jobTask,jobTaskSchedule); BeanUtils.copyProperties(jobTask,jobTaskSchedule);
jobTaskSchedules.add(jobTaskSchedule); jobTaskSchedules.add(jobTaskSchedule);
}else {
List<Integer> dependIdByNodeId = nodeDependencyService.findDependIdByNodeId(jobTask.getNodeId());
List<JobTaskRunLog> jobTaskRunLogList = jobTaskRunLogService.findJobTaskRunLogNotEndNodeByRunCodeCount(dependIdByNodeId, jobTask.getRunId());
if (CollectionUtil.isEmpty(jobTaskRunLogList)){
return;
}
jobTaskRunLogList.forEach(e ->{
if(!("1".equals(e.getRunCode()) || "3".equals(e.getRunCode()))){
return;
}
});
JobTaskSchedule jobTaskSchedule = new JobTaskSchedule();
BeanUtils.copyProperties(jobTask,jobTaskSchedule);
jobTaskSchedules.add(jobTaskSchedule);
} }
} }
...@@ -155,7 +167,7 @@ public class JobScheduleHelper{ ...@@ -155,7 +167,7 @@ public class JobScheduleHelper{
if(CollectionUtil.isNotEmpty(jobTaskSchedules)) { if(CollectionUtil.isNotEmpty(jobTaskSchedules)) {
jobTaskScheduleService.saveAllData(jobTaskSchedules); jobTaskScheduleService.saveAllData(jobTaskSchedules);
jobTaskService.removeMythJobTaskInIds(jobTasks); jobTaskService.removeMythJobTaskInIds(jobTaskSchedules);
} }
}else{ }else{
...@@ -397,10 +409,10 @@ public class JobScheduleHelper{ ...@@ -397,10 +409,10 @@ public class JobScheduleHelper{
private Integer saveLog(JobTaskSchedule mythJobTaskSchedule){ private Integer saveLog(JobTaskSchedule mythJobTaskSchedule){
JobTaskRunLogWithBLOBs jobTaskRunLog = new JobTaskRunLogWithBLOBs(); JobTaskRunLogWithBLOBs jobTaskRunLog = new JobTaskRunLogWithBLOBs();
//jobTaskRunLog.setRunId(mythJobTaskSchedule.getRunId()); jobTaskRunLog.setRunId(mythJobTaskSchedule.getRunId());
jobTaskRunLog.setFlowId(mythJobTaskSchedule.getFlowId()); jobTaskRunLog.setFlowId(mythJobTaskSchedule.getFlowId());
jobTaskRunLog.setFlowName("1"); jobTaskRunLog.setFlowName("1");
jobTaskRunLog.setRunId("qwer-tyui-opas-dfgh"); jobTaskRunLog.setNodeId(mythJobTaskSchedule.getNodeId());
jobTaskRunLog.setNodeName(mythJobTaskSchedule.getNodeName()); jobTaskRunLog.setNodeName(mythJobTaskSchedule.getNodeName());
jobTaskRunLog.setRunParams(mythJobTaskSchedule.getRunParam()); jobTaskRunLog.setRunParams(mythJobTaskSchedule.getRunParam());
jobTaskRunLog.setFailedRemainingCount(mythJobTaskSchedule.getFailedRetryCount()); jobTaskRunLog.setFailedRemainingCount(mythJobTaskSchedule.getFailedRetryCount());
......
...@@ -365,11 +365,11 @@ ...@@ -365,11 +365,11 @@
</update> </update>
<!--多个删除--> <!--多个删除-->
<delete id="deleteInId" parameterType="com.byit.model.JobTask"> <delete id="deleteInId" parameterType="com.byit.model.JobTaskSchedule">
delete from job_task delete from job_task
where id in where id in
<foreach collection="jobTasks" item="jobTask" open="(" separator="," close=")"> <foreach collection="jobTaskSchedules" item="jobTaskSchedule" open="(" separator="," close=")">
#{jobTask.id} #{jobTaskSchedule.id}
</foreach> </foreach>
</delete> </delete>
<!--根据id删除--> <!--根据id删除-->
......
...@@ -40,11 +40,12 @@ ...@@ -40,11 +40,12 @@
run_msg, trigger_msg run_msg, trigger_msg
</sql> </sql>
<select id="findJobTaskRunLogNotEndNodeByRunCodeCount" resultType="java.lang.Integer"> <select id="findJobTaskRunLogNotEndNodeByRunCodeCount" resultMap="BaseResultMap">
select count(*) select <include refid="Base_Column_List" />
from job_task_run_log from job_task_run_log
where (run_code = '0' or run_code = '5') where
and node_id in run_id = #{runId}
and node_id in
<foreach item="nodeId" collection="nodeIds" open="(" separator="," close=")"> <foreach item="nodeId" collection="nodeIds" open="(" separator="," close=")">
#{nodeId} #{nodeId}
</foreach> </foreach>
......
...@@ -2,375 +2,385 @@ ...@@ -2,375 +2,385 @@
<!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="com.byit.mapper.JobTaskScheduleMapper"> <mapper namespace="com.byit.mapper.JobTaskScheduleMapper">
<resultMap id="BaseResultMap" type="com.byit.model.JobTaskSchedule"> <resultMap id="BaseResultMap" type="com.byit.model.JobTaskSchedule">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="node_id" jdbcType="INTEGER" property="nodeId" /> <result column="node_id" jdbcType="INTEGER" property="nodeId"/>
<result column="block_strategy" jdbcType="VARCHAR" property="blockStrategy" /> <result column="block_strategy" jdbcType="VARCHAR" property="blockStrategy"/>
<result column="plugin_token" jdbcType="VARCHAR" property="pluginToken" /> <result column="plugin_token" jdbcType="VARCHAR" property="pluginToken"/>
<result column="failed_retry_count" jdbcType="INTEGER" property="failedRetryCount" /> <result column="failed_retry_count" jdbcType="INTEGER" property="failedRetryCount"/>
<result column="flow_id" jdbcType="INTEGER" property="flowId" /> <result column="flow_id" jdbcType="INTEGER" property="flowId"/>
<result column="gateway_token" jdbcType="VARCHAR" property="gatewayToken" /> <result column="gateway_token" jdbcType="VARCHAR" property="gatewayToken"/>
<result column="job_type" jdbcType="VARCHAR" property="jobType" /> <result column="job_type" jdbcType="VARCHAR" property="jobType"/>
<result column="handler_name" jdbcType="VARCHAR" property="handlerName" /> <result column="handler_name" jdbcType="VARCHAR" property="handlerName"/>
<result column="node_desc" jdbcType="VARCHAR" property="nodeDesc" /> <result column="node_desc" jdbcType="VARCHAR" property="nodeDesc"/>
<result column="node_name" jdbcType="VARCHAR" property="nodeName" /> <result column="node_name" jdbcType="VARCHAR" property="nodeName"/>
<result column="map_flow_id" jdbcType="INTEGER" property="mapFlowId" /> <result column="map_flow_id" jdbcType="INTEGER" property="mapFlowId"/>
<result column="node_timeout" jdbcType="BIGINT" property="nodeTimeout" /> <result column="node_timeout" jdbcType="BIGINT" property="nodeTimeout"/>
<result column="is_virtual" jdbcType="CHAR" property="isVirtual" /> <result column="is_virtual" jdbcType="CHAR" property="isVirtual"/>
<result column="plugin_urls" jdbcType="VARCHAR" property="pluginUrls" /> <result column="plugin_urls" jdbcType="VARCHAR" property="pluginUrls"/>
<result column="priority" jdbcType="CHAR" property="priority" /> <result column="priority" jdbcType="CHAR" property="priority"/>
<result column="failed_retry_interval" jdbcType="BIGINT" property="failedRetryInterval" /> <result column="failed_retry_interval" jdbcType="BIGINT" property="failedRetryInterval"/>
<result column="routing_strategy" jdbcType="VARCHAR" property="routingStrategy" /> <result column="routing_strategy" jdbcType="VARCHAR" property="routingStrategy"/>
<result column="run_id" jdbcType="VARCHAR" property="runId" /> <result column="run_id" jdbcType="VARCHAR" property="runId"/>
<result column="run_param" jdbcType="VARCHAR" property="runParam" /> <result column="run_param" jdbcType="VARCHAR" property="runParam"/>
<result column="run_source_desc" jdbcType="VARCHAR" property="runSourceDesc" /> <result column="run_source_desc" jdbcType="VARCHAR" property="runSourceDesc"/>
<result column="script_urls" jdbcType="VARCHAR" property="scriptUrls" /> <result column="script_urls" jdbcType="VARCHAR" property="scriptUrls"/>
<result column="source_principal" jdbcType="VARCHAR" property="sourcePrincipal" /> <result column="source_principal" jdbcType="VARCHAR" property="sourcePrincipal"/>
<result column="trigger_time" jdbcType="BIGINT" property="triggerTime" /> <result column="trigger_time" jdbcType="BIGINT" property="triggerTime"/>
<result column="trigger_status" jdbcType="CHAR" property="triggerStatus" /> <result column="trigger_status" jdbcType="CHAR" property="triggerStatus"/>
<result column="version_name" jdbcType="VARCHAR" property="versionName" /> <result column="version_name" jdbcType="VARCHAR" property="versionName"/>
<result column="log_id" jdbcType="INTEGER" property="logId" /> <result column="log_id" jdbcType="INTEGER" property="logId"/>
<result column="run_command" jdbcType="VARCHAR" property="runCommand" /> <result column="run_command" jdbcType="VARCHAR" property="runCommand"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskSchedule"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskSchedule">
<result column="run_source" jdbcType="LONGVARCHAR" property="runSource" /> <result column="run_source" jdbcType="LONGVARCHAR" property="runSource"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, node_id, block_strategy, plugin_token, failed_retry_count, flow_id, gateway_token, id, node_id, block_strategy, plugin_token, failed_retry_count, flow_id, gateway_token,
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual, job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param, plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name, run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
log_id, run_command log_id, run_command
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
run_source run_source
</sql> </sql>
<!--查询五秒内将要执行的数据--> <!--查询五秒内将要执行的数据-->
<select id="findJobTaskScheduleByTriggerTimeLessThanEqual" resultMap="ResultMapWithBLOBs"> <select id="findJobTaskScheduleByTriggerTimeLessThanEqual" resultMap="ResultMapWithBLOBs">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List"/>
from job_task_schedule from job_task_schedule
where trigger_time <![CDATA[ <= ]]> #{triggerTime,jdbcType=BIGINT} where trigger_time <![CDATA[ <= ]]> #{triggerTime,jdbcType=BIGINT}
</select> </select>
<select id="findJobTaskScheduleById" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs"> <select id="findJobTaskScheduleById" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List"/>
from job_task_schedule from job_task_schedule
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteById" parameterType="java.lang.Integer"> <delete id="deleteById" parameterType="java.lang.Integer">
delete from job_task_schedule delete from job_task_schedule
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="saveJobTaskSchedule" parameterType="com.byit.model.JobTaskSchedule"> <insert id="saveJobTaskSchedule" parameterType="com.byit.model.JobTaskSchedule">
insert into job_task_schedule insert into job_task_schedule
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
id, id,
</if> </if>
<if test="nodeId != null"> <if test="nodeId != null">
node_id, node_id,
</if> </if>
<if test="blockStrategy != null"> <if test="blockStrategy != null">
block_strategy, block_strategy,
</if> </if>
<if test="pluginToken != null"> <if test="pluginToken != null">
plugin_token, plugin_token,
</if> </if>
<if test="failedRetryCount != null"> <if test="failedRetryCount != null">
failed_retry_count, failed_retry_count,
</if> </if>
<if test="flowId != null"> <if test="flowId != null">
flow_id, flow_id,
</if> </if>
<if test="gatewayToken != null"> <if test="gatewayToken != null">
gateway_token, gateway_token,
</if> </if>
<if test="jobType != null"> <if test="jobType != null">
job_type, job_type,
</if> </if>
<if test="handlerName != null"> <if test="handlerName != null">
handler_name, handler_name,
</if> </if>
<if test="nodeDesc != null"> <if test="nodeDesc != null">
node_desc, node_desc,
</if> </if>
<if test="nodeName != null"> <if test="nodeName != null">
node_name, node_name,
</if> </if>
<if test="mapFlowId != null"> <if test="mapFlowId != null">
map_flow_id, map_flow_id,
</if> </if>
<if test="nodeTimeout != null"> <if test="nodeTimeout != null">
node_timeout, node_timeout,
</if> </if>
<if test="isVirtual != null"> <if test="isVirtual != null">
is_virtual, is_virtual,
</if> </if>
<if test="pluginUrls != null"> <if test="pluginUrls != null">
plugin_urls, plugin_urls,
</if> </if>
<if test="priority != null"> <if test="priority != null">
priority, priority,
</if> </if>
<if test="failedRetryInterval != null"> <if test="failedRetryInterval != null">
failed_retry_interval, failed_retry_interval,
</if> </if>
<if test="routingStrategy != null"> <if test="routingStrategy != null">
routing_strategy, routing_strategy,
</if> </if>
<if test="runId != null"> <if test="runId != null">
run_id, run_id,
</if> </if>
<if test="runParam != null"> <if test="runParam != null">
run_param, run_param,
</if> </if>
<if test="runSourceDesc != null"> <if test="runSourceDesc != null">
run_source_desc, run_source_desc,
</if> </if>
<if test="scriptUrls != null"> <if test="scriptUrls != null">
script_urls, script_urls,
</if> </if>
<if test="sourcePrincipal != null"> <if test="sourcePrincipal != null">
source_principal, source_principal,
</if> </if>
<if test="triggerTime != null"> <if test="triggerTime != null">
trigger_time, trigger_time,
</if> </if>
<if test="triggerStatus != null"> <if test="triggerStatus != null">
trigger_status, trigger_status,
</if> </if>
<if test="versionName != null"> <if test="versionName != null">
version_name, version_name,
</if> </if>
<if test="logId != null"> <if test="logId != null">
log_id, log_id,
</if> </if>
<if test="runCommand != null"> <if test="runCommand != null">
run_command, run_command,
</if> </if>
<if test="runSource != null"> <if test="runSource != null">
run_source, run_source,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
#{id,jdbcType=INTEGER}, #{id,jdbcType=INTEGER},
</if> </if>
<if test="nodeId != null"> <if test="nodeId != null">
#{nodeId,jdbcType=INTEGER}, #{nodeId,jdbcType=INTEGER},
</if> </if>
<if test="blockStrategy != null"> <if test="blockStrategy != null">
#{blockStrategy,jdbcType=VARCHAR}, #{blockStrategy,jdbcType=VARCHAR},
</if> </if>
<if test="pluginToken != null"> <if test="pluginToken != null">
#{pluginToken,jdbcType=VARCHAR}, #{pluginToken,jdbcType=VARCHAR},
</if> </if>
<if test="failedRetryCount != null"> <if test="failedRetryCount != null">
#{failedRetryCount,jdbcType=INTEGER}, #{failedRetryCount,jdbcType=INTEGER},
</if> </if>
<if test="flowId != null"> <if test="flowId != null">
#{flowId,jdbcType=INTEGER}, #{flowId,jdbcType=INTEGER},
</if> </if>
<if test="gatewayToken != null"> <if test="gatewayToken != null">
#{gatewayToken,jdbcType=VARCHAR}, #{gatewayToken,jdbcType=VARCHAR},
</if> </if>
<if test="jobType != null"> <if test="jobType != null">
#{jobType,jdbcType=VARCHAR}, #{jobType,jdbcType=VARCHAR},
</if> </if>
<if test="handlerName != null"> <if test="handlerName != null">
#{handlerName,jdbcType=VARCHAR}, #{handlerName,jdbcType=VARCHAR},
</if> </if>
<if test="nodeDesc != null"> <if test="nodeDesc != null">
#{nodeDesc,jdbcType=VARCHAR}, #{nodeDesc,jdbcType=VARCHAR},
</if> </if>
<if test="nodeName != null"> <if test="nodeName != null">
#{nodeName,jdbcType=VARCHAR}, #{nodeName,jdbcType=VARCHAR},
</if> </if>
<if test="mapFlowId != null"> <if test="mapFlowId != null">
#{mapFlowId,jdbcType=INTEGER}, #{mapFlowId,jdbcType=INTEGER},
</if> </if>
<if test="nodeTimeout != null"> <if test="nodeTimeout != null">
#{nodeTimeout,jdbcType=BIGINT}, #{nodeTimeout,jdbcType=BIGINT},
</if> </if>
<if test="isVirtual != null"> <if test="isVirtual != null">
#{isVirtual,jdbcType=CHAR}, #{isVirtual,jdbcType=CHAR},
</if> </if>
<if test="pluginUrls != null"> <if test="pluginUrls != null">
#{pluginUrls,jdbcType=VARCHAR}, #{pluginUrls,jdbcType=VARCHAR},
</if> </if>
<if test="priority != null"> <if test="priority != null">
#{priority,jdbcType=CHAR}, #{priority,jdbcType=CHAR},
</if> </if>
<if test="failedRetryInterval != null"> <if test="failedRetryInterval != null">
#{failedRetryInterval,jdbcType=BIGINT}, #{failedRetryInterval,jdbcType=BIGINT},
</if> </if>
<if test="routingStrategy != null"> <if test="routingStrategy != null">
#{routingStrategy,jdbcType=VARCHAR}, #{routingStrategy,jdbcType=VARCHAR},
</if> </if>
<if test="runId != null"> <if test="runId != null">
#{runId,jdbcType=VARCHAR}, #{runId,jdbcType=VARCHAR},
</if> </if>
<if test="runParam != null"> <if test="runParam != null">
#{runParam,jdbcType=VARCHAR}, #{runParam,jdbcType=VARCHAR},
</if> </if>
<if test="runSourceDesc != null"> <if test="runSourceDesc != null">
#{runSourceDesc,jdbcType=VARCHAR}, #{runSourceDesc,jdbcType=VARCHAR},
</if> </if>
<if test="scriptUrls != null"> <if test="scriptUrls != null">
#{scriptUrls,jdbcType=VARCHAR}, #{scriptUrls,jdbcType=VARCHAR},
</if> </if>
<if test="sourcePrincipal != null"> <if test="sourcePrincipal != null">
#{sourcePrincipal,jdbcType=VARCHAR}, #{sourcePrincipal,jdbcType=VARCHAR},
</if> </if>
<if test="triggerTime != null"> <if test="triggerTime != null">
#{triggerTime,jdbcType=BIGINT}, #{triggerTime,jdbcType=BIGINT},
</if> </if>
<if test="triggerStatus != null"> <if test="triggerStatus != null">
#{triggerStatus,jdbcType=CHAR}, #{triggerStatus,jdbcType=CHAR},
</if> </if>
<if test="versionName != null"> <if test="versionName != null">
#{versionName,jdbcType=VARCHAR}, #{versionName,jdbcType=VARCHAR},
</if> </if>
<if test="logId != null"> <if test="logId != null">
#{logId,jdbcType=INTEGER}, #{logId,jdbcType=INTEGER},
</if> </if>
<if test="runCommand != null"> <if test="runCommand != null">
#{runCommand,jdbcType=VARCHAR}, #{runCommand,jdbcType=VARCHAR},
</if> </if>
<if test="runSource != null"> <if test="runSource != null">
#{runSource,jdbcType=LONGVARCHAR}, #{runSource,jdbcType=LONGVARCHAR},
</if> </if>
</trim> </trim>
</insert> </insert>
<insert id="saveJobTaskScheduleArray" parameterType="com.byit.model.JobTaskSchedule"> <insert id="saveJobTaskScheduleArray" parameterType="com.byit.model.JobTaskSchedule">
insert into job_task_schedule (id, node_id, block_strategy, insert into job_task_schedule (id, node_id, block_strategy,
plugin_token, failed_retry_count, flow_id, plugin_token, failed_retry_count, flow_id,
gateway_token, job_type, handler_name, gateway_token, job_type, handler_name,
node_desc, node_name, map_flow_id, node_desc, node_name, map_flow_id,
node_timeout, is_virtual, plugin_urls, node_timeout, is_virtual, plugin_urls,
priority, failed_retry_interval, routing_strategy, priority, failed_retry_interval, routing_strategy,
run_id, run_param, run_source_desc, run_id, run_param, run_source_desc,
script_urls, source_principal, trigger_time, script_urls, source_principal, trigger_time,
trigger_status, version_name, log_id, trigger_status, version_name, log_id,
run_command, run_source run_command, run_source
) )
values values
<foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator =","> <foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator=",">
(#{jobTaskSchedule.id,jdbcType=INTEGER}, #{jobTaskSchedule.nodeId,jdbcType=INTEGER}, #{jobTaskSchedule.blockStrategy,jdbcType=VARCHAR}, (
#{jobTaskSchedule.pluginToken,jdbcType=VARCHAR}, #{jobTaskSchedule.failedRetryCount,jdbcType=INTEGER}, #{jobTaskSchedule.flowId,jdbcType=INTEGER}, #{jobTaskSchedule.id,jdbcType=INTEGER}, #{jobTaskSchedule.nodeId,jdbcType=INTEGER},
#{jobTaskSchedule.gatewayToken,jdbcType=VARCHAR}, #{jobTaskSchedule.jobType,jdbcType=VARCHAR}, #{jobTaskSchedule.handlerName,jdbcType=VARCHAR}, #{jobTaskSchedule.blockStrategy,jdbcType=VARCHAR},
#{jobTaskSchedule.nodeDesc,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeName,jdbcType=VARCHAR}, #{jobTaskSchedule.mapFlowId,jdbcType=INTEGER}, #{jobTaskSchedule.pluginToken,jdbcType=VARCHAR}, #{jobTaskSchedule.failedRetryCount,jdbcType=INTEGER},
#{jobTaskSchedule.nodeTimeout,jdbcType=BIGINT}, #{jobTaskSchedule.isVirtual,jdbcType=CHAR}, #{jobTaskSchedule.pluginUrls,jdbcType=VARCHAR}, #{jobTaskSchedule.flowId,jdbcType=INTEGER},
#{jobTaskSchedule.priority,jdbcType=CHAR}, #{jobTaskSchedule.failedRetryInterval,jdbcType=BIGINT}, #{jobTaskSchedule.routingStrategy,jdbcType=VARCHAR}, #{jobTaskSchedule.gatewayToken,jdbcType=VARCHAR}, #{jobTaskSchedule.jobType,jdbcType=VARCHAR},
#{jobTaskSchedule.runId,jdbcType=VARCHAR}, #{jobTaskSchedule.runParam,jdbcType=VARCHAR}, #{jobTaskSchedule.runSourceDesc,jdbcType=VARCHAR}, #{jobTaskSchedule.handlerName,jdbcType=VARCHAR},
#{jobTaskSchedule.scriptUrls,jdbcType=VARCHAR}, #{jobTaskSchedule.sourcePrincipal,jdbcType=VARCHAR}, #{jobTaskSchedule.triggerTime,jdbcType=BIGINT}, #{jobTaskSchedule.nodeDesc,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeName,jdbcType=VARCHAR},
#{jobTaskSchedule.triggerStatus,jdbcType=CHAR}, #{jobTaskSchedule.versionName,jdbcType=VARCHAR}, #{jobTaskSchedule.logId,jdbcType=INTEGER}, #{jobTaskSchedule.mapFlowId,jdbcType=INTEGER},
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR} #{jobTaskSchedule.nodeTimeout,jdbcType=BIGINT}, #{jobTaskSchedule.isVirtual,jdbcType=CHAR},
) #{jobTaskSchedule.pluginUrls,jdbcType=VARCHAR},
</foreach> #{jobTaskSchedule.priority,jdbcType=CHAR}, #{jobTaskSchedule.failedRetryInterval,jdbcType=BIGINT},
</insert> #{jobTaskSchedule.routingStrategy,jdbcType=VARCHAR},
#{jobTaskSchedule.runId,jdbcType=VARCHAR}, #{jobTaskSchedule.runParam,jdbcType=VARCHAR},
#{jobTaskSchedule.runSourceDesc,jdbcType=VARCHAR},
#{jobTaskSchedule.scriptUrls,jdbcType=VARCHAR}, #{jobTaskSchedule.sourcePrincipal,jdbcType=VARCHAR},
#{jobTaskSchedule.triggerTime,jdbcType=BIGINT},
#{jobTaskSchedule.triggerStatus,jdbcType=CHAR}, #{jobTaskSchedule.versionName,jdbcType=VARCHAR},
#{jobTaskSchedule.logId,jdbcType=INTEGER},
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR}
)
</foreach>
</insert>
<update id="updateJobTaskSchedule" parameterType="com.byit.model.JobTaskSchedule"> <update id="updateJobTaskSchedule" parameterType="com.byit.model.JobTaskSchedule">
update job_task_schedule update job_task_schedule
<set> <set>
<if test="nodeId != null"> <if test="nodeId != null">
node_id = #{nodeId,jdbcType=INTEGER}, node_id = #{nodeId,jdbcType=INTEGER},
</if> </if>
<if test="blockStrategy != null"> <if test="blockStrategy != null">
block_strategy = #{blockStrategy,jdbcType=VARCHAR}, block_strategy = #{blockStrategy,jdbcType=VARCHAR},
</if> </if>
<if test="pluginToken != null"> <if test="pluginToken != null">
plugin_token = #{pluginToken,jdbcType=VARCHAR}, plugin_token = #{pluginToken,jdbcType=VARCHAR},
</if> </if>
<if test="failedRetryCount != null"> <if test="failedRetryCount != null">
failed_retry_count = #{failedRetryCount,jdbcType=INTEGER}, failed_retry_count = #{failedRetryCount,jdbcType=INTEGER},
</if> </if>
<if test="flowId != null"> <if test="flowId != null">
flow_id = #{flowId,jdbcType=INTEGER}, flow_id = #{flowId,jdbcType=INTEGER},
</if> </if>
<if test="gatewayToken != null"> <if test="gatewayToken != null">
gateway_token = #{gatewayToken,jdbcType=VARCHAR}, gateway_token = #{gatewayToken,jdbcType=VARCHAR},
</if> </if>
<if test="jobType != null"> <if test="jobType != null">
job_type = #{jobType,jdbcType=VARCHAR}, job_type = #{jobType,jdbcType=VARCHAR},
</if> </if>
<if test="handlerName != null"> <if test="handlerName != null">
handler_name = #{handlerName,jdbcType=VARCHAR}, handler_name = #{handlerName,jdbcType=VARCHAR},
</if> </if>
<if test="nodeDesc != null"> <if test="nodeDesc != null">
node_desc = #{nodeDesc,jdbcType=VARCHAR}, node_desc = #{nodeDesc,jdbcType=VARCHAR},
</if> </if>
<if test="nodeName != null"> <if test="nodeName != null">
node_name = #{nodeName,jdbcType=VARCHAR}, node_name = #{nodeName,jdbcType=VARCHAR},
</if> </if>
<if test="mapFlowId != null"> <if test="mapFlowId != null">
map_flow_id = #{mapFlowId,jdbcType=INTEGER}, map_flow_id = #{mapFlowId,jdbcType=INTEGER},
</if> </if>
<if test="nodeTimeout != null"> <if test="nodeTimeout != null">
node_timeout = #{nodeTimeout,jdbcType=BIGINT}, node_timeout = #{nodeTimeout,jdbcType=BIGINT},
</if> </if>
<if test="isVirtual != null"> <if test="isVirtual != null">
is_virtual = #{isVirtual,jdbcType=CHAR}, is_virtual = #{isVirtual,jdbcType=CHAR},
</if> </if>
<if test="pluginUrls != null"> <if test="pluginUrls != null">
plugin_urls = #{pluginUrls,jdbcType=VARCHAR}, plugin_urls = #{pluginUrls,jdbcType=VARCHAR},
</if> </if>
<if test="priority != null"> <if test="priority != null">
priority = #{priority,jdbcType=CHAR}, priority = #{priority,jdbcType=CHAR},
</if> </if>
<if test="failedRetryInterval != null"> <if test="failedRetryInterval != null">
failed_retry_interval = #{failedRetryInterval,jdbcType=BIGINT}, failed_retry_interval = #{failedRetryInterval,jdbcType=BIGINT},
</if> </if>
<if test="routingStrategy != null"> <if test="routingStrategy != null">
routing_strategy = #{routingStrategy,jdbcType=VARCHAR}, routing_strategy = #{routingStrategy,jdbcType=VARCHAR},
</if> </if>
<if test="runId != null"> <if test="runId != null">
run_id = #{runId,jdbcType=VARCHAR}, run_id = #{runId,jdbcType=VARCHAR},
</if> </if>
<if test="runParam != null"> <if test="runParam != null">
run_param = #{runParam,jdbcType=VARCHAR}, run_param = #{runParam,jdbcType=VARCHAR},
</if> </if>
<if test="runSourceDesc != null"> <if test="runSourceDesc != null">
run_source_desc = #{runSourceDesc,jdbcType=VARCHAR}, run_source_desc = #{runSourceDesc,jdbcType=VARCHAR},
</if> </if>
<if test="scriptUrls != null"> <if test="scriptUrls != null">
script_urls = #{scriptUrls,jdbcType=VARCHAR}, script_urls = #{scriptUrls,jdbcType=VARCHAR},
</if> </if>
<if test="sourcePrincipal != null"> <if test="sourcePrincipal != null">
source_principal = #{sourcePrincipal,jdbcType=VARCHAR}, source_principal = #{sourcePrincipal,jdbcType=VARCHAR},
</if> </if>
<if test="triggerTime != null"> <if test="triggerTime != null">
trigger_time = #{triggerTime,jdbcType=BIGINT}, trigger_time = #{triggerTime,jdbcType=BIGINT},
</if> </if>
<if test="triggerStatus != null"> <if test="triggerStatus != null">
trigger_status = #{triggerStatus,jdbcType=CHAR}, trigger_status = #{triggerStatus,jdbcType=CHAR},
</if> </if>
<if test="versionName != null"> <if test="versionName != null">
version_name = #{versionName,jdbcType=VARCHAR}, version_name = #{versionName,jdbcType=VARCHAR},
</if> </if>
<if test="logId != null"> <if test="logId != null">
log_id = #{logId,jdbcType=INTEGER}, log_id = #{logId,jdbcType=INTEGER},
</if> </if>
<if test="runCommand != null"> <if test="runCommand != null">
run_command = #{runCommand,jdbcType=VARCHAR}, run_command = #{runCommand,jdbcType=VARCHAR},
</if> </if>
<if test="runSource != null"> <if test="runSource != null">
run_source = #{runSource,jdbcType=LONGVARCHAR}, run_source = #{runSource,jdbcType=LONGVARCHAR},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment