Commit 680f9c0e by guominglei

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

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