Commit da0171a4 by huangfusuper

【代码重构】修改JPA为MyBatsi

parent 286ec10e
package com.byit.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*/
@ApiModel
@Data
public class JobTask implements Serializable {
/**
*/
@ApiModelProperty("主键")
private Integer id;
/**
* 当前版本节点主键
*/
@ApiModelProperty("当前版本节点主键")
private Integer nodeId;
/**
* 当前工作流版本的报警邮箱
*/
@ApiModelProperty("当前工作流版本的报警邮箱")
private String alarmEmail;
/**
* 阻塞策略
*/
@ApiModelProperty("阻塞策略")
private String blockStrategy;
/**
* 调度中心端请求插件时的令牌
*/
@ApiModelProperty("调度中心端请求插件时的令牌")
private String callbackToken;
/**
* 该节点的依赖节点
*/
@ApiModelProperty("该节点的依赖节点")
private String dependencyNodes;
/**
* 当前节点的失败重试次数
*/
@ApiModelProperty("当前节点的失败重试次数")
private Integer failedRetryCount;
/**
* 工作流ID
*/
@ApiModelProperty("工作流ID")
private Integer flowId;
/**
* 是否跟随任务流 1跟随 2不跟随
*/
@ApiModelProperty("是否跟随任务流 1跟随 2不跟随")
private String followTaskFlow;
/**
* 插件端请求调度中心的令牌
*/
@ApiModelProperty("插件端请求调度中心的令牌")
private String gatewayToken;
/**
* 当前任务的类型 java python shell sql script
*/
@ApiModelProperty("当前任务的类型 java python shell sql script")
private String jobType;
/**
* 本地节点(插件方) 的节点的名字
*/
@ApiModelProperty("本地节点(插件方) 的节点的名字")
private String localNodeHandlerName;
/**
* 当前工作流版本的告警的时机
*/
@ApiModelProperty("当前工作流版本的告警的时机")
private String mailAction;
/**
* 这个在设置节点执行时间跟随任务流的时候,他是没用的,但是设置不跟随的时候,节点的执行按照他自己的时间执行
*/
@ApiModelProperty("这个在设置节点执行时间跟随任务流的时候,他是没用的,但是设置不跟随的时候,节点的执行按照他自己的时间执行")
private String nodeCron;
/**
* 节点的说明
*/
@ApiModelProperty("节点的说明")
private String nodeDesc;
/**
* 当前节点的名称
*/
@ApiModelProperty("当前节点的名称")
private String nodeName;
/**
* nodeOfFlowId
*/
@ApiModelProperty("nodeOfFlowId")
private Integer nodeOfFlowId;
/**
* 节点的超时时间 -1不超时
*/
@ApiModelProperty("节点的超时时间 -1不超时")
private Long nodeTimeout;
/**
* 节点的类型 node flow
*/
@ApiModelProperty("节点的类型 node flow")
private String nodeType;
/**
* 插件端的url集合
*/
@ApiModelProperty("插件端的url集合")
private String pluginUrls;
/**
* 设置任务的优先级,1最低 2最高
*/
@ApiModelProperty("设置任务的优先级,1最低 2最高")
private String priority;
/**
* 节点的剩余次数
*/
@ApiModelProperty("节点的剩余次数")
private Integer remainingCount;
/**
* 当前节点总共重复次数
*/
@ApiModelProperty("当前节点总共重复次数")
private Integer repeatCount;
/**
* 重试的间隔
*/
@ApiModelProperty("重试的间隔")
private Long retryInterval;
/**
* 路由策略
*/
@ApiModelProperty("路由策略")
private String routingStrategy;
/**
* 运行标识
*/
@ApiModelProperty("运行标识")
private String runId;
/**
* 节点的参数
*/
@ApiModelProperty("节点的参数")
private String runParam;
/**
* 源码备注
*/
@ApiModelProperty("源码备注")
private String runSourceDesc;
/**
* 脚本的文件服务器路径集
*/
@ApiModelProperty("脚本的文件服务器路径集")
private String scriptUrls;
/**
* 源码负责人
*/
@ApiModelProperty("源码负责人")
private String sourcePrincipal;
/**
* 源码的修改时间
*/
@ApiModelProperty("源码的修改时间")
private Date sourceUpdateTime;
/**
* 当前版本的节点的下次执行时间
*/
@ApiModelProperty("当前版本的节点的下次执行时间")
private Long triggerNextTime;
/**
* 调度状态:0-暂停,1-运行
*/
@ApiModelProperty("调度状态:0-暂停,1-运行")
private String triggerStatus;
/**
* 源码
*/
@ApiModelProperty("源码")
private String runSource;
/**
*/
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.byit.mapper.JobTaskMapper">
<resultMap id="BaseResultMap" type="com.byit.model.JobTask">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="node_id" jdbcType="INTEGER" property="nodeId" />
<result column="alarm_email" jdbcType="VARCHAR" property="alarmEmail" />
<result column="block_strategy" jdbcType="VARCHAR" property="blockStrategy" />
<result column="callback_token" jdbcType="VARCHAR" property="callbackToken" />
<result column="dependency_nodes" jdbcType="VARCHAR" property="dependencyNodes" />
<result column="failed_retry_count" jdbcType="INTEGER" property="failedRetryCount" />
<result column="flow_id" jdbcType="INTEGER" property="flowId" />
<result column="follow_task_flow" jdbcType="CHAR" property="followTaskFlow" />
<result column="gateway_token" jdbcType="VARCHAR" property="gatewayToken" />
<result column="job_type" jdbcType="VARCHAR" property="jobType" />
<result column="local_node_handler_name" jdbcType="VARCHAR" property="localNodeHandlerName" />
<result column="mail_action" jdbcType="CHAR" property="mailAction" />
<result column="node_cron" jdbcType="VARCHAR" property="nodeCron" />
<result column="node_desc" jdbcType="VARCHAR" property="nodeDesc" />
<result column="node_name" jdbcType="VARCHAR" property="nodeName" />
<result column="node_of_flow_id" jdbcType="INTEGER" property="nodeOfFlowId" />
<result column="node_timeout" jdbcType="BIGINT" property="nodeTimeout" />
<result column="node_type" jdbcType="VARCHAR" property="nodeType" />
<result column="plugin_urls" jdbcType="VARCHAR" property="pluginUrls" />
<result column="priority" jdbcType="CHAR" property="priority" />
<result column="remaining_count" jdbcType="INTEGER" property="remainingCount" />
<result column="repeat_count" jdbcType="INTEGER" property="repeatCount" />
<result column="retry_interval" jdbcType="BIGINT" property="retryInterval" />
<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="source_update_time" jdbcType="DATE" property="sourceUpdateTime" />
<result column="trigger_next_time" jdbcType="BIGINT" property="triggerNextTime" />
<result column="trigger_status" jdbcType="CHAR" property="triggerStatus" />
<result column="run_source" jdbcType="LONGVARCHAR" property="runSource" />
</resultMap>
<sql id="Base_Column_List">
id, node_id, alarm_email, block_strategy, callback_token, dependency_nodes, failed_retry_count,
flow_id, follow_task_flow, gateway_token, job_type, local_node_handler_name, mail_action,
node_cron, node_desc, node_name, node_of_flow_id, node_timeout, node_type, plugin_urls,
priority, remaining_count, repeat_count, retry_interval, routing_strategy, run_id,
run_param, run_source_desc, script_urls, source_principal, source_update_time, trigger_next_time,
trigger_status,run_source
</sql>
<!--查询七秒内将要执行的数据-->
<select id="findJobTaskByTriggerNextTimeLessThanEqual" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from job_task
where trigger_next_time <![CDATA[ <= ]]> #{triggerNextTime,jdbcType=BIGINT}
</select>
<!--根据id执行数据-->
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from job_task
where id = #{id,jdbcType=INTEGER}
</select>
<!--根据id删除数据-->
<delete id="deleteById" parameterType="java.lang.Integer">
delete from job_task
where id = #{id,jdbcType=INTEGER}
</delete>
<!--多个删除-->
<delete id="deleteByIds" parameterType="com.byit.model.JobTask">
delete from job_task
where id in
<foreach collection="mythJobTasks" item="mythJobTask" open="(" separator="," close=")">
#{mythJobTask.id}
</foreach>
</delete>
<!--添加一个任务-->
<insert id="insert" parameterType="com.byit.model.JobTask">
insert into job_task (id, node_id, alarm_email,
block_strategy, callback_token, dependency_nodes,
failed_retry_count, flow_id, follow_task_flow,
gateway_token, job_type, local_node_handler_name,
mail_action, node_cron, node_desc,
node_name, node_of_flow_id, node_timeout,
node_type, plugin_urls, priority,
remaining_count, repeat_count, retry_interval,
routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal,
source_update_time, trigger_next_time, trigger_status,
run_source)
values (#{id,jdbcType=INTEGER}, #{nodeId,jdbcType=INTEGER}, #{alarmEmail,jdbcType=VARCHAR},
#{blockStrategy,jdbcType=VARCHAR}, #{callbackToken,jdbcType=VARCHAR}, #{dependencyNodes,jdbcType=VARCHAR},
#{failedRetryCount,jdbcType=INTEGER}, #{flowId,jdbcType=INTEGER}, #{followTaskFlow,jdbcType=CHAR},
#{gatewayToken,jdbcType=VARCHAR}, #{jobType,jdbcType=VARCHAR}, #{localNodeHandlerName,jdbcType=VARCHAR},
#{mailAction,jdbcType=CHAR}, #{nodeCron,jdbcType=VARCHAR}, #{nodeDesc,jdbcType=VARCHAR},
#{nodeName,jdbcType=VARCHAR}, #{nodeOfFlowId,jdbcType=INTEGER}, #{nodeTimeout,jdbcType=BIGINT},
#{nodeType,jdbcType=VARCHAR}, #{pluginUrls,jdbcType=VARCHAR}, #{priority,jdbcType=CHAR},
#{remainingCount,jdbcType=INTEGER}, #{repeatCount,jdbcType=INTEGER}, #{retryInterval,jdbcType=BIGINT},
#{routingStrategy,jdbcType=VARCHAR}, #{runId,jdbcType=VARCHAR}, #{runParam,jdbcType=VARCHAR},
#{runSourceDesc,jdbcType=VARCHAR}, #{scriptUrls,jdbcType=VARCHAR}, #{sourcePrincipal,jdbcType=VARCHAR},
#{sourceUpdateTime,jdbcType=DATE}, #{triggerNextTime,jdbcType=BIGINT}, #{triggerStatus,jdbcType=CHAR},
#{runSource,jdbcType=LONGVARCHAR})
</insert>
<!--动态数据添加-->
<insert id="insertSelective" parameterType="com.byit.model.JobTask">
insert into job_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="nodeId != null">
node_id,
</if>
<if test="alarmEmail != null">
alarm_email,
</if>
<if test="blockStrategy != null">
block_strategy,
</if>
<if test="callbackToken != null">
callback_token,
</if>
<if test="dependencyNodes != null">
dependency_nodes,
</if>
<if test="failedRetryCount != null">
failed_retry_count,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="followTaskFlow != null">
follow_task_flow,
</if>
<if test="gatewayToken != null">
gateway_token,
</if>
<if test="jobType != null">
job_type,
</if>
<if test="localNodeHandlerName != null">
local_node_handler_name,
</if>
<if test="mailAction != null">
mail_action,
</if>
<if test="nodeCron != null">
node_cron,
</if>
<if test="nodeDesc != null">
node_desc,
</if>
<if test="nodeName != null">
node_name,
</if>
<if test="nodeOfFlowId != null">
node_of_flow_id,
</if>
<if test="nodeTimeout != null">
node_timeout,
</if>
<if test="nodeType != null">
node_type,
</if>
<if test="pluginUrls != null">
plugin_urls,
</if>
<if test="priority != null">
priority,
</if>
<if test="remainingCount != null">
remaining_count,
</if>
<if test="repeatCount != null">
repeat_count,
</if>
<if test="retryInterval != null">
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="sourceUpdateTime != null">
source_update_time,
</if>
<if test="triggerNextTime != null">
trigger_next_time,
</if>
<if test="triggerStatus != null">
trigger_status,
</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="alarmEmail != null">
#{alarmEmail,jdbcType=VARCHAR},
</if>
<if test="blockStrategy != null">
#{blockStrategy,jdbcType=VARCHAR},
</if>
<if test="callbackToken != null">
#{callbackToken,jdbcType=VARCHAR},
</if>
<if test="dependencyNodes != null">
#{dependencyNodes,jdbcType=VARCHAR},
</if>
<if test="failedRetryCount != null">
#{failedRetryCount,jdbcType=INTEGER},
</if>
<if test="flowId != null">
#{flowId,jdbcType=INTEGER},
</if>
<if test="followTaskFlow != null">
#{followTaskFlow,jdbcType=CHAR},
</if>
<if test="gatewayToken != null">
#{gatewayToken,jdbcType=VARCHAR},
</if>
<if test="jobType != null">
#{jobType,jdbcType=VARCHAR},
</if>
<if test="localNodeHandlerName != null">
#{localNodeHandlerName,jdbcType=VARCHAR},
</if>
<if test="mailAction != null">
#{mailAction,jdbcType=CHAR},
</if>
<if test="nodeCron != null">
#{nodeCron,jdbcType=VARCHAR},
</if>
<if test="nodeDesc != null">
#{nodeDesc,jdbcType=VARCHAR},
</if>
<if test="nodeName != null">
#{nodeName,jdbcType=VARCHAR},
</if>
<if test="nodeOfFlowId != null">
#{nodeOfFlowId,jdbcType=INTEGER},
</if>
<if test="nodeTimeout != null">
#{nodeTimeout,jdbcType=BIGINT},
</if>
<if test="nodeType != null">
#{nodeType,jdbcType=VARCHAR},
</if>
<if test="pluginUrls != null">
#{pluginUrls,jdbcType=VARCHAR},
</if>
<if test="priority != null">
#{priority,jdbcType=CHAR},
</if>
<if test="remainingCount != null">
#{remainingCount,jdbcType=INTEGER},
</if>
<if test="repeatCount != null">
#{repeatCount,jdbcType=INTEGER},
</if>
<if test="retryInterval != null">
#{retryInterval,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="sourceUpdateTime != null">
#{sourceUpdateTime,jdbcType=DATE},
</if>
<if test="triggerNextTime != null">
#{triggerNextTime,jdbcType=BIGINT},
</if>
<if test="triggerStatus != null">
#{triggerStatus,jdbcType=CHAR},
</if>
<if test="runSource != null">
#{runSource,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<!--动态修改-->
<update id="updateByIdSelective" parameterType="com.byit.model.JobTask">
update job_task
<set>
<if test="nodeId != null">
node_id = #{nodeId,jdbcType=INTEGER},
</if>
<if test="alarmEmail != null">
alarm_email = #{alarmEmail,jdbcType=VARCHAR},
</if>
<if test="blockStrategy != null">
block_strategy = #{blockStrategy,jdbcType=VARCHAR},
</if>
<if test="callbackToken != null">
callback_token = #{callbackToken,jdbcType=VARCHAR},
</if>
<if test="dependencyNodes != null">
dependency_nodes = #{dependencyNodes,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="followTaskFlow != null">
follow_task_flow = #{followTaskFlow,jdbcType=CHAR},
</if>
<if test="gatewayToken != null">
gateway_token = #{gatewayToken,jdbcType=VARCHAR},
</if>
<if test="jobType != null">
job_type = #{jobType,jdbcType=VARCHAR},
</if>
<if test="localNodeHandlerName != null">
local_node_handler_name = #{localNodeHandlerName,jdbcType=VARCHAR},
</if>
<if test="mailAction != null">
mail_action = #{mailAction,jdbcType=CHAR},
</if>
<if test="nodeCron != null">
node_cron = #{nodeCron,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="nodeOfFlowId != null">
node_of_flow_id = #{nodeOfFlowId,jdbcType=INTEGER},
</if>
<if test="nodeTimeout != null">
node_timeout = #{nodeTimeout,jdbcType=BIGINT},
</if>
<if test="nodeType != null">
node_type = #{nodeType,jdbcType=VARCHAR},
</if>
<if test="pluginUrls != null">
plugin_urls = #{pluginUrls,jdbcType=VARCHAR},
</if>
<if test="priority != null">
priority = #{priority,jdbcType=CHAR},
</if>
<if test="remainingCount != null">
remaining_count = #{remainingCount,jdbcType=INTEGER},
</if>
<if test="repeatCount != null">
repeat_count = #{repeatCount,jdbcType=INTEGER},
</if>
<if test="retryInterval != null">
retry_interval = #{retryInterval,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="sourceUpdateTime != null">
source_update_time = #{sourceUpdateTime,jdbcType=DATE},
</if>
<if test="triggerNextTime != null">
trigger_next_time = #{triggerNextTime,jdbcType=BIGINT},
</if>
<if test="triggerStatus != null">
trigger_status = #{triggerStatus,jdbcType=CHAR},
</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
<?xml version="1.0" encoding="UTF-8"?>
<!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="alarm_email" jdbcType="VARCHAR" property="alarmEmail" />
<result column="block_strategy" jdbcType="VARCHAR" property="blockStrategy" />
<result column="callback_token" jdbcType="VARCHAR" property="callbackToken" />
<result column="dependency_nodes" jdbcType="VARCHAR" property="dependencyNodes" />
<result column="failed_retry_count" jdbcType="INTEGER" property="failedRetryCount" />
<result column="flow_id" jdbcType="INTEGER" property="flowId" />
<result column="follow_task_flow" jdbcType="CHAR" property="followTaskFlow" />
<result column="gateway_token" jdbcType="VARCHAR" property="gatewayToken" />
<result column="job_type" jdbcType="VARCHAR" property="jobType" />
<result column="local_node_handler_name" jdbcType="VARCHAR" property="localNodeHandlerName" />
<result column="log_id" jdbcType="INTEGER" property="logId" />
<result column="mail_action" jdbcType="CHAR" property="mailAction" />
<result column="node_cron" jdbcType="VARCHAR" property="nodeCron" />
<result column="node_desc" jdbcType="VARCHAR" property="nodeDesc" />
<result column="node_name" jdbcType="VARCHAR" property="nodeName" />
<result column="node_of_flow_id" jdbcType="INTEGER" property="nodeOfFlowId" />
<result column="node_timeout" jdbcType="BIGINT" property="nodeTimeout" />
<result column="node_type" jdbcType="VARCHAR" property="nodeType" />
<result column="plugin_urls" jdbcType="VARCHAR" property="pluginUrls" />
<result column="priority" jdbcType="CHAR" property="priority" />
<result column="remaining_count" jdbcType="INTEGER" property="remainingCount" />
<result column="repeat_count" jdbcType="INTEGER" property="repeatCount" />
<result column="retry_interval" jdbcType="BIGINT" property="retryInterval" />
<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="source_update_time" jdbcType="DATE" property="sourceUpdateTime" />
<result column="trigger_next_time" jdbcType="BIGINT" property="triggerNextTime" />
<result column="trigger_status" jdbcType="CHAR" property="triggerStatus" />
<result column="run_source" jdbcType="LONGVARCHAR" property="runSource" />
</resultMap>
<sql id="Base_Column_List">
id, node_id, alarm_email, block_strategy, callback_token, dependency_nodes, failed_retry_count,
flow_id, follow_task_flow, gateway_token, job_type, local_node_handler_name, log_id,
mail_action, node_cron, node_desc, node_name, node_of_flow_id, node_timeout, node_type,
plugin_urls, priority, remaining_count, repeat_count, retry_interval, routing_strategy,
run_id, run_param, run_source_desc, script_urls, source_principal, source_update_time,
trigger_next_time, trigger_status,run_source
</sql>
<!--查询五秒内将要执行的数据-->
<select id="findJobTaskScheduleByTriggerNextTimeLessThanEqual" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from job_task_schedule
where trigger_next_time <![CDATA[ <= ]]> #{triggerNextTime,jdbcType=BIGINT}
</select>
<select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from job_task_schedule
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteById" parameterType="java.lang.Integer">
delete from job_task_schedule
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.byit.model.JobTaskSchedule">
insert into job_task_schedule (id, node_id, alarm_email,
block_strategy, callback_token, dependency_nodes,
failed_retry_count, flow_id, follow_task_flow,
gateway_token, job_type, local_node_handler_name,
log_id, mail_action, node_cron,
node_desc, node_name, node_of_flow_id,
node_timeout, node_type, plugin_urls,
priority, remaining_count, repeat_count,
retry_interval, routing_strategy, run_id,
run_param, run_source_desc, script_urls,
source_principal, source_update_time, trigger_next_time,
trigger_status, run_source)
values (#{id,jdbcType=INTEGER}, #{nodeId,jdbcType=INTEGER}, #{alarmEmail,jdbcType=VARCHAR},
#{blockStrategy,jdbcType=VARCHAR}, #{callbackToken,jdbcType=VARCHAR}, #{dependencyNodes,jdbcType=VARCHAR},
#{failedRetryCount,jdbcType=INTEGER}, #{flowId,jdbcType=INTEGER}, #{followTaskFlow,jdbcType=CHAR},
#{gatewayToken,jdbcType=VARCHAR}, #{jobType,jdbcType=VARCHAR}, #{localNodeHandlerName,jdbcType=VARCHAR},
#{logId,jdbcType=INTEGER}, #{mailAction,jdbcType=CHAR}, #{nodeCron,jdbcType=VARCHAR},
#{nodeDesc,jdbcType=VARCHAR}, #{nodeName,jdbcType=VARCHAR}, #{nodeOfFlowId,jdbcType=INTEGER},
#{nodeTimeout,jdbcType=BIGINT}, #{nodeType,jdbcType=VARCHAR}, #{pluginUrls,jdbcType=VARCHAR},
#{priority,jdbcType=CHAR}, #{remainingCount,jdbcType=INTEGER}, #{repeatCount,jdbcType=INTEGER},
#{retryInterval,jdbcType=BIGINT}, #{routingStrategy,jdbcType=VARCHAR}, #{runId,jdbcType=VARCHAR},
#{runParam,jdbcType=VARCHAR}, #{runSourceDesc,jdbcType=VARCHAR}, #{scriptUrls,jdbcType=VARCHAR},
#{sourcePrincipal,jdbcType=VARCHAR}, #{sourceUpdateTime,jdbcType=DATE}, #{triggerNextTime,jdbcType=BIGINT},
#{triggerStatus,jdbcType=CHAR}, #{runSource,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" 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="alarmEmail != null">
alarm_email,
</if>
<if test="blockStrategy != null">
block_strategy,
</if>
<if test="callbackToken != null">
callback_token,
</if>
<if test="dependencyNodes != null">
dependency_nodes,
</if>
<if test="failedRetryCount != null">
failed_retry_count,
</if>
<if test="flowId != null">
flow_id,
</if>
<if test="followTaskFlow != null">
follow_task_flow,
</if>
<if test="gatewayToken != null">
gateway_token,
</if>
<if test="jobType != null">
job_type,
</if>
<if test="localNodeHandlerName != null">
local_node_handler_name,
</if>
<if test="logId != null">
log_id,
</if>
<if test="mailAction != null">
mail_action,
</if>
<if test="nodeCron != null">
node_cron,
</if>
<if test="nodeDesc != null">
node_desc,
</if>
<if test="nodeName != null">
node_name,
</if>
<if test="nodeOfFlowId != null">
node_of_flow_id,
</if>
<if test="nodeTimeout != null">
node_timeout,
</if>
<if test="nodeType != null">
node_type,
</if>
<if test="pluginUrls != null">
plugin_urls,
</if>
<if test="priority != null">
priority,
</if>
<if test="remainingCount != null">
remaining_count,
</if>
<if test="repeatCount != null">
repeat_count,
</if>
<if test="retryInterval != null">
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="sourceUpdateTime != null">
source_update_time,
</if>
<if test="triggerNextTime != null">
trigger_next_time,
</if>
<if test="triggerStatus != null">
trigger_status,
</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="alarmEmail != null">
#{alarmEmail,jdbcType=VARCHAR},
</if>
<if test="blockStrategy != null">
#{blockStrategy,jdbcType=VARCHAR},
</if>
<if test="callbackToken != null">
#{callbackToken,jdbcType=VARCHAR},
</if>
<if test="dependencyNodes != null">
#{dependencyNodes,jdbcType=VARCHAR},
</if>
<if test="failedRetryCount != null">
#{failedRetryCount,jdbcType=INTEGER},
</if>
<if test="flowId != null">
#{flowId,jdbcType=INTEGER},
</if>
<if test="followTaskFlow != null">
#{followTaskFlow,jdbcType=CHAR},
</if>
<if test="gatewayToken != null">
#{gatewayToken,jdbcType=VARCHAR},
</if>
<if test="jobType != null">
#{jobType,jdbcType=VARCHAR},
</if>
<if test="localNodeHandlerName != null">
#{localNodeHandlerName,jdbcType=VARCHAR},
</if>
<if test="logId != null">
#{logId,jdbcType=INTEGER},
</if>
<if test="mailAction != null">
#{mailAction,jdbcType=CHAR},
</if>
<if test="nodeCron != null">
#{nodeCron,jdbcType=VARCHAR},
</if>
<if test="nodeDesc != null">
#{nodeDesc,jdbcType=VARCHAR},
</if>
<if test="nodeName != null">
#{nodeName,jdbcType=VARCHAR},
</if>
<if test="nodeOfFlowId != null">
#{nodeOfFlowId,jdbcType=INTEGER},
</if>
<if test="nodeTimeout != null">
#{nodeTimeout,jdbcType=BIGINT},
</if>
<if test="nodeType != null">
#{nodeType,jdbcType=VARCHAR},
</if>
<if test="pluginUrls != null">
#{pluginUrls,jdbcType=VARCHAR},
</if>
<if test="priority != null">
#{priority,jdbcType=CHAR},
</if>
<if test="remainingCount != null">
#{remainingCount,jdbcType=INTEGER},
</if>
<if test="repeatCount != null">
#{repeatCount,jdbcType=INTEGER},
</if>
<if test="retryInterval != null">
#{retryInterval,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="sourceUpdateTime != null">
#{sourceUpdateTime,jdbcType=DATE},
</if>
<if test="triggerNextTime != null">
#{triggerNextTime,jdbcType=BIGINT},
</if>
<if test="triggerStatus != null">
#{triggerStatus,jdbcType=CHAR},
</if>
<if test="runSource != null">
#{runSource,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<!--批量插入-->
<insert id="insertDataList" parameterType="com.byit.model.JobTaskSchedule">
insert into job_task_schedule (id, node_id, alarm_email,
block_strategy, callback_token, dependency_nodes,
failed_retry_count, flow_id, follow_task_flow,
gateway_token, job_type, local_node_handler_name,
log_id, mail_action, node_cron,
node_desc, node_name, node_of_flow_id,
node_timeout, node_type, plugin_urls,
priority, remaining_count, repeat_count,
retry_interval, routing_strategy, run_id,
run_param, run_source_desc, script_urls,
source_principal, source_update_time, trigger_next_time,
trigger_status, run_source)
values
<foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator =",">
(#{jobTaskSchedule.id,jdbcType=INTEGER}, #{jobTaskSchedule.nodeId,jdbcType=INTEGER}, #{jobTaskSchedule.alarmEmail,jdbcType=VARCHAR},
#{jobTaskSchedule.blockStrategy,jdbcType=VARCHAR}, #{jobTaskSchedule.callbackToken,jdbcType=VARCHAR}, #{jobTaskSchedule.dependencyNodes,jdbcType=VARCHAR},
#{jobTaskSchedule.failedRetryCount,jdbcType=INTEGER}, #{jobTaskSchedule.flowId,jdbcType=INTEGER}, #{jobTaskSchedule.followTaskFlow,jdbcType=CHAR},
#{jobTaskSchedule.gatewayToken,jdbcType=VARCHAR}, #{jobTaskSchedule.jobType,jdbcType=VARCHAR}, #{jobTaskSchedule.localNodeHandlerName,jdbcType=VARCHAR},
#{jobTaskSchedule.logId,jdbcType=INTEGER}, #{jobTaskSchedule.mailAction,jdbcType=CHAR}, #{jobTaskSchedule.nodeCron,jdbcType=VARCHAR},
#{jobTaskSchedule.nodeDesc,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeName,jdbcType=VARCHAR}, #{jobTaskSchedule.nodeOfFlowId,jdbcType=INTEGER},
#{jobTaskSchedule.nodeTimeout,jdbcType=BIGINT}, #{jobTaskSchedule.nodeType,jdbcType=VARCHAR}, #{jobTaskSchedule.pluginUrls,jdbcType=VARCHAR},
#{jobTaskSchedule.priority,jdbcType=CHAR}, #{jobTaskSchedule.remainingCount,jdbcType=INTEGER}, #{jobTaskSchedule.repeatCount,jdbcType=INTEGER},
#{jobTaskSchedule.retryInterval,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.sourceUpdateTime,jdbcType=DATE}, #{jobTaskSchedule.triggerNextTime,jdbcType=BIGINT},
#{jobTaskSchedule.triggerStatus,jdbcType=CHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<update id="updateByIdSelective" parameterType="com.byit.model.JobTaskSchedule">
<!-- generated @mbg.generated date: 2019-12-23 -->
update job_task_schedule
<set>
<if test="nodeId != null">
node_id = #{nodeId,jdbcType=INTEGER},
</if>
<if test="alarmEmail != null">
alarm_email = #{alarmEmail,jdbcType=VARCHAR},
</if>
<if test="blockStrategy != null">
block_strategy = #{blockStrategy,jdbcType=VARCHAR},
</if>
<if test="callbackToken != null">
callback_token = #{callbackToken,jdbcType=VARCHAR},
</if>
<if test="dependencyNodes != null">
dependency_nodes = #{dependencyNodes,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="followTaskFlow != null">
follow_task_flow = #{followTaskFlow,jdbcType=CHAR},
</if>
<if test="gatewayToken != null">
gateway_token = #{gatewayToken,jdbcType=VARCHAR},
</if>
<if test="jobType != null">
job_type = #{jobType,jdbcType=VARCHAR},
</if>
<if test="localNodeHandlerName != null">
local_node_handler_name = #{localNodeHandlerName,jdbcType=VARCHAR},
</if>
<if test="logId != null">
log_id = #{logId,jdbcType=INTEGER},
</if>
<if test="mailAction != null">
mail_action = #{mailAction,jdbcType=CHAR},
</if>
<if test="nodeCron != null">
node_cron = #{nodeCron,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="nodeOfFlowId != null">
node_of_flow_id = #{nodeOfFlowId,jdbcType=INTEGER},
</if>
<if test="nodeTimeout != null">
node_timeout = #{nodeTimeout,jdbcType=BIGINT},
</if>
<if test="nodeType != null">
node_type = #{nodeType,jdbcType=VARCHAR},
</if>
<if test="pluginUrls != null">
plugin_urls = #{pluginUrls,jdbcType=VARCHAR},
</if>
<if test="priority != null">
priority = #{priority,jdbcType=CHAR},
</if>
<if test="remainingCount != null">
remaining_count = #{remainingCount,jdbcType=INTEGER},
</if>
<if test="repeatCount != null">
repeat_count = #{repeatCount,jdbcType=INTEGER},
</if>
<if test="retryInterval != null">
retry_interval = #{retryInterval,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="sourceUpdateTime != null">
source_update_time = #{sourceUpdateTime,jdbcType=DATE},
</if>
<if test="triggerNextTime != null">
trigger_next_time = #{triggerNextTime,jdbcType=BIGINT},
</if>
<if test="triggerStatus != null">
trigger_status = #{triggerStatus,jdbcType=CHAR},
</if>
<if test="runSource != null">
run_source = #{runSource,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.byit.model.JobTaskSchedule">
<!-- generated @mbg.generated date: 2019-12-23 -->
update job_task_schedule
set node_id = #{nodeId,jdbcType=INTEGER},
alarm_email = #{alarmEmail,jdbcType=VARCHAR},
block_strategy = #{blockStrategy,jdbcType=VARCHAR},
callback_token = #{callbackToken,jdbcType=VARCHAR},
dependency_nodes = #{dependencyNodes,jdbcType=VARCHAR},
failed_retry_count = #{failedRetryCount,jdbcType=INTEGER},
flow_id = #{flowId,jdbcType=INTEGER},
follow_task_flow = #{followTaskFlow,jdbcType=CHAR},
gateway_token = #{gatewayToken,jdbcType=VARCHAR},
job_type = #{jobType,jdbcType=VARCHAR},
local_node_handler_name = #{localNodeHandlerName,jdbcType=VARCHAR},
log_id = #{logId,jdbcType=INTEGER},
mail_action = #{mailAction,jdbcType=CHAR},
node_cron = #{nodeCron,jdbcType=VARCHAR},
node_desc = #{nodeDesc,jdbcType=VARCHAR},
node_name = #{nodeName,jdbcType=VARCHAR},
node_of_flow_id = #{nodeOfFlowId,jdbcType=INTEGER},
node_timeout = #{nodeTimeout,jdbcType=BIGINT},
node_type = #{nodeType,jdbcType=VARCHAR},
plugin_urls = #{pluginUrls,jdbcType=VARCHAR},
priority = #{priority,jdbcType=CHAR},
remaining_count = #{remainingCount,jdbcType=INTEGER},
repeat_count = #{repeatCount,jdbcType=INTEGER},
retry_interval = #{retryInterval,jdbcType=BIGINT},
routing_strategy = #{routingStrategy,jdbcType=VARCHAR},
run_id = #{runId,jdbcType=VARCHAR},
run_param = #{runParam,jdbcType=VARCHAR},
run_source_desc = #{runSourceDesc,jdbcType=VARCHAR},
script_urls = #{scriptUrls,jdbcType=VARCHAR},
source_principal = #{sourcePrincipal,jdbcType=VARCHAR},
source_update_time = #{sourceUpdateTime,jdbcType=DATE},
trigger_next_time = #{triggerNextTime,jdbcType=BIGINT},
trigger_status = #{triggerStatus,jdbcType=CHAR},
run_source = #{runSource,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateById" parameterType="com.byit.model.JobTaskSchedule">
<!-- generated @mbg.generated date: 2019-12-23 -->
update job_task_schedule
set node_id = #{nodeId,jdbcType=INTEGER},
alarm_email = #{alarmEmail,jdbcType=VARCHAR},
block_strategy = #{blockStrategy,jdbcType=VARCHAR},
callback_token = #{callbackToken,jdbcType=VARCHAR},
dependency_nodes = #{dependencyNodes,jdbcType=VARCHAR},
failed_retry_count = #{failedRetryCount,jdbcType=INTEGER},
flow_id = #{flowId,jdbcType=INTEGER},
follow_task_flow = #{followTaskFlow,jdbcType=CHAR},
gateway_token = #{gatewayToken,jdbcType=VARCHAR},
job_type = #{jobType,jdbcType=VARCHAR},
local_node_handler_name = #{localNodeHandlerName,jdbcType=VARCHAR},
log_id = #{logId,jdbcType=INTEGER},
mail_action = #{mailAction,jdbcType=CHAR},
node_cron = #{nodeCron,jdbcType=VARCHAR},
node_desc = #{nodeDesc,jdbcType=VARCHAR},
node_name = #{nodeName,jdbcType=VARCHAR},
node_of_flow_id = #{nodeOfFlowId,jdbcType=INTEGER},
node_timeout = #{nodeTimeout,jdbcType=BIGINT},
node_type = #{nodeType,jdbcType=VARCHAR},
plugin_urls = #{pluginUrls,jdbcType=VARCHAR},
priority = #{priority,jdbcType=CHAR},
remaining_count = #{remainingCount,jdbcType=INTEGER},
repeat_count = #{repeatCount,jdbcType=INTEGER},
retry_interval = #{retryInterval,jdbcType=BIGINT},
routing_strategy = #{routingStrategy,jdbcType=VARCHAR},
run_id = #{runId,jdbcType=VARCHAR},
run_param = #{runParam,jdbcType=VARCHAR},
run_source_desc = #{runSourceDesc,jdbcType=VARCHAR},
script_urls = #{scriptUrls,jdbcType=VARCHAR},
source_principal = #{sourcePrincipal,jdbcType=VARCHAR},
source_update_time = #{sourceUpdateTime,jdbcType=DATE},
trigger_next_time = #{triggerNextTime,jdbcType=BIGINT},
trigger_status = #{triggerStatus,jdbcType=CHAR}
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