Pre Merge pull request !67 from dhb52/feature/batch-insert-update-split

This commit is contained in:
dhb52 2024-03-31 08:15:39 +00:00 committed by Gitee
commit 5447901543
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
19 changed files with 1235 additions and 1093 deletions

View File

@ -33,6 +33,7 @@ CREATE TABLE group_config
namespace_id VARCHAR2(64) DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
group_name VARCHAR2(64) NOT NULL,
description VARCHAR2(256) DEFAULT '',
token VARCHAR2(64) DEFAULT 'ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT',
group_status SMALLINT DEFAULT 0,
version INT NOT NULL,
group_partition INT NOT NULL,
@ -50,6 +51,7 @@ COMMENT ON COLUMN group_config.id IS '主键';
COMMENT ON COLUMN group_config.namespace_id IS '命名空间';
COMMENT ON COLUMN group_config.group_name IS '组名称';
COMMENT ON COLUMN group_config.description IS '组描述';
COMMENT ON COLUMN group_config.token IS 'token';
COMMENT ON COLUMN group_config.group_status IS '组状态 0、未启用 1、启用';
COMMENT ON COLUMN group_config.version IS '版本号';
COMMENT ON COLUMN group_config.group_partition IS '分区';

View File

@ -11,7 +11,7 @@ CREATE TABLE namespace
deleted SMALLINT NOT NULL DEFAULT 0
);
CREATE UNIQUE INDEX uk_namespace_unique_id ON "namespace" (unique_id);
CREATE UNIQUE INDEX uk_namespace_unique_id ON namespace (unique_id);
COMMENT ON COLUMN namespace.id IS '主键';
COMMENT ON COLUMN namespace.name IS '名称';
@ -31,6 +31,7 @@ CREATE TABLE group_config
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
group_name VARCHAR(64) NOT NULL,
description VARCHAR(256) DEFAULT '',
token VARCHAR(64) DEFAULT 'ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT',
group_status SMALLINT NOT NULL DEFAULT 0,
version INT NOT NULL,
group_partition INT NOT NULL,
@ -41,21 +42,22 @@ CREATE TABLE group_config
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_namespace_id_group_name_group_config" ON "group_config" ("namespace_id", "group_name");
CREATE UNIQUE INDEX uk_namespace_id_group_name_group_config ON group_config (namespace_id, group_name);
COMMENT ON COLUMN "group_config"."id" IS '主键';
COMMENT ON COLUMN "group_config"."namespace_id" IS '命名空间';
COMMENT ON COLUMN "group_config"."group_name" IS '组名称';
COMMENT ON COLUMN "group_config"."description" IS '组描述';
COMMENT ON COLUMN "group_config"."group_status" IS '组状态 0、未启用 1、启用';
COMMENT ON COLUMN "group_config"."version" IS '版本号';
COMMENT ON COLUMN "group_config"."group_partition" IS '分区';
COMMENT ON COLUMN "group_config"."id_generator_mode" IS '唯一id生成模式 默认号段模式';
COMMENT ON COLUMN "group_config"."init_scene" IS '是否初始化场景 0:否 1:是';
COMMENT ON COLUMN "group_config"."bucket_index" IS 'bucket';
COMMENT ON COLUMN "group_config"."create_dt" IS '创建时间';
COMMENT ON COLUMN "group_config"."update_dt" IS '修改时间';
COMMENT ON TABLE "group_config" IS '组配置';
COMMENT ON COLUMN group_config.id IS '主键';
COMMENT ON COLUMN group_config.namespace_id IS '命名空间';
COMMENT ON COLUMN group_config.group_name IS '组名称';
COMMENT ON COLUMN group_config.description IS '组描述';
COMMENT ON COLUMN group_config.token IS 'token';
COMMENT ON COLUMN group_config.group_status IS '组状态 0、未启用 1、启用';
COMMENT ON COLUMN group_config.version IS '版本号';
COMMENT ON COLUMN group_config.group_partition IS '分区';
COMMENT ON COLUMN group_config.id_generator_mode IS '唯一id生成模式 默认号段模式';
COMMENT ON COLUMN group_config.init_scene IS '是否初始化场景 0:否 1:是';
COMMENT ON COLUMN group_config.bucket_index IS 'bucket';
COMMENT ON COLUMN group_config.create_dt IS '创建时间';
COMMENT ON COLUMN group_config.update_dt IS '修改时间';
COMMENT ON TABLE group_config IS '组配置';
CREATE TABLE notify_config
(
@ -77,21 +79,21 @@ CREATE TABLE notify_config
CREATE INDEX idx_namespace_id_group_name_notify_config ON notify_config (namespace_id, group_name);
COMMENT ON COLUMN "notify_config"."id" IS '主键';
COMMENT ON COLUMN "notify_config"."group_name" IS '组名称';
COMMENT ON COLUMN "notify_config"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "notify_config"."scene_name" IS '场景名称';
COMMENT ON COLUMN "notify_config"."notify_status" IS '通知状态 0、未启用 1、启用';
COMMENT ON COLUMN "notify_config"."notify_type" IS '通知类型 1、钉钉 2、邮件 3、企业微信';
COMMENT ON COLUMN "notify_config"."notify_attribute" IS '配置属性';
COMMENT ON COLUMN "notify_config"."notify_threshold" IS '通知阈值';
COMMENT ON COLUMN "notify_config"."notify_scene" IS '通知场景';
COMMENT ON COLUMN "notify_config"."rate_limiter_status" IS '限流状态 0、未启用 1、启用';
COMMENT ON COLUMN "notify_config"."rate_limiter_threshold" IS '每秒限流阈值';
COMMENT ON COLUMN "notify_config"."description" IS '描述';
COMMENT ON COLUMN "notify_config"."create_dt" IS '创建时间';
COMMENT ON COLUMN "notify_config"."update_dt" IS '修改时间';
COMMENT ON TABLE "notify_config" IS '通知配置';
COMMENT ON COLUMN notify_config.id IS '主键';
COMMENT ON COLUMN notify_config.group_name IS '组名称';
COMMENT ON COLUMN notify_config.namespace_id IS '命名空间id';
COMMENT ON COLUMN notify_config.scene_name IS '场景名称';
COMMENT ON COLUMN notify_config.notify_status IS '通知状态 0、未启用 1、启用';
COMMENT ON COLUMN notify_config.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信';
COMMENT ON COLUMN notify_config.notify_attribute IS '配置属性';
COMMENT ON COLUMN notify_config.notify_threshold IS '通知阈值';
COMMENT ON COLUMN notify_config.notify_scene IS '通知场景';
COMMENT ON COLUMN notify_config.rate_limiter_status IS '限流状态 0、未启用 1、启用';
COMMENT ON COLUMN notify_config.rate_limiter_threshold IS '每秒限流阈值';
COMMENT ON COLUMN notify_config.description IS '描述';
COMMENT ON COLUMN notify_config.create_dt IS '创建时间';
COMMENT ON COLUMN notify_config.update_dt IS '修改时间';
COMMENT ON TABLE notify_config IS '通知配置';
CREATE TABLE retry_dead_letter_0
@ -110,25 +112,25 @@ CREATE TABLE retry_dead_letter_0
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_namespace_id_group_name_unique_id_retry_dead_letter" ON "retry_dead_letter_0" ("namespace_id", "group_name", "unique_id");
CREATE INDEX "idx_namespace_id_group_name_scene_name_retry_dead_letter" ON "retry_dead_letter_0" ("namespace_id", "group_name", "scene_name");
CREATE INDEX "idx_idempotent_id_retry_dead_letter" ON "retry_dead_letter_0" ("idempotent_id");
CREATE INDEX "idx_biz_no_retry_dead_letter" ON "retry_dead_letter_0" ("biz_no");
CREATE INDEX "idx_create_dt_retry_dead_letter" ON "retry_dead_letter_0" ("create_dt");
CREATE UNIQUE INDEX uk_namespace_id_group_name_unique_id_retry_dead_letter ON retry_dead_letter_0 (namespace_id, group_name, unique_id);
CREATE INDEX idx_namespace_id_group_name_scene_name_retry_dead_letter ON retry_dead_letter_0 (namespace_id, group_name, scene_name);
CREATE INDEX idx_idempotent_id_retry_dead_letter ON retry_dead_letter_0 (idempotent_id);
CREATE INDEX idx_biz_no_retry_dead_letter ON retry_dead_letter_0 (biz_no);
CREATE INDEX idx_create_dt_retry_dead_letter ON retry_dead_letter_0 (create_dt);
COMMENT ON COLUMN "retry_dead_letter_0"."id" IS '主键';
COMMENT ON COLUMN "retry_dead_letter_0"."unique_id" IS '同组下id唯一';
COMMENT ON COLUMN "retry_dead_letter_0"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "retry_dead_letter_0"."group_name" IS '组名称';
COMMENT ON COLUMN "retry_dead_letter_0"."scene_name" IS '场景名称';
COMMENT ON COLUMN "retry_dead_letter_0"."idempotent_id" IS '幂等id';
COMMENT ON COLUMN "retry_dead_letter_0"."biz_no" IS '业务编号';
COMMENT ON COLUMN "retry_dead_letter_0"."executor_name" IS '执行器名称';
COMMENT ON COLUMN "retry_dead_letter_0"."args_str" IS '执行方法参数';
COMMENT ON COLUMN "retry_dead_letter_0"."ext_attrs" IS '扩展字段';
COMMENT ON COLUMN "retry_dead_letter_0"."task_type" IS '任务类型 1、重试数据 2、回调数据';
COMMENT ON COLUMN "retry_dead_letter_0"."create_dt" IS '创建时间';
COMMENT ON TABLE "retry_dead_letter_0" IS '死信队列表';
COMMENT ON COLUMN retry_dead_letter_0.id IS '主键';
COMMENT ON COLUMN retry_dead_letter_0.unique_id IS '同组下id唯一';
COMMENT ON COLUMN retry_dead_letter_0.namespace_id IS '命名空间id';
COMMENT ON COLUMN retry_dead_letter_0.group_name IS '组名称';
COMMENT ON COLUMN retry_dead_letter_0.scene_name IS '场景名称';
COMMENT ON COLUMN retry_dead_letter_0.idempotent_id IS '幂等id';
COMMENT ON COLUMN retry_dead_letter_0.biz_no IS '业务编号';
COMMENT ON COLUMN retry_dead_letter_0.executor_name IS '执行器名称';
COMMENT ON COLUMN retry_dead_letter_0.args_str IS '执行方法参数';
COMMENT ON COLUMN retry_dead_letter_0.ext_attrs IS '扩展字段';
COMMENT ON COLUMN retry_dead_letter_0.task_type IS '任务类型 1、重试数据 2、回调数据';
COMMENT ON COLUMN retry_dead_letter_0.create_dt IS '创建时间';
COMMENT ON TABLE retry_dead_letter_0 IS '死信队列表';
CREATE TABLE retry_task_0
(
@ -150,30 +152,30 @@ CREATE TABLE retry_task_0
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_name_unique_id_retry_task" ON "retry_task_0" ("namespace_id", "group_name", "unique_id");
CREATE INDEX "idx_namespace_id_group_name_scene_name_retry_task" ON "retry_task_0" ("namespace_id", "group_name", "scene_name");
CREATE INDEX "idx_namespace_id_group_name_retry_status_retry_task" ON "retry_task_0" (namespace_id, group_name, "retry_status");
CREATE INDEX "idx_idempotent_id_retry_task" ON "retry_task_0" ("idempotent_id");
CREATE INDEX "idx_biz_no_retry_task" ON "retry_task_0" ("biz_no");
CREATE INDEX "idx_create_dt_retry_task" ON "retry_task_0" ("create_dt");
CREATE UNIQUE INDEX uk_name_unique_id_retry_task ON retry_task_0 (namespace_id, group_name, unique_id);
CREATE INDEX idx_namespace_id_group_name_scene_name_retry_task ON retry_task_0 (namespace_id, group_name, scene_name);
CREATE INDEX idx_namespace_id_group_name_retry_status_retry_task ON retry_task_0 (namespace_id, group_name, retry_status);
CREATE INDEX idx_idempotent_id_retry_task ON retry_task_0 (idempotent_id);
CREATE INDEX idx_biz_no_retry_task ON retry_task_0 (biz_no);
CREATE INDEX idx_create_dt_retry_task ON retry_task_0 (create_dt);
COMMENT ON COLUMN "retry_task_0"."id" IS '主键';
COMMENT ON COLUMN "retry_task_0"."unique_id" IS '同组下id唯一';
COMMENT ON COLUMN "retry_task_0"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "retry_task_0"."group_name" IS '组名称';
COMMENT ON COLUMN "retry_task_0"."scene_name" IS '场景名称';
COMMENT ON COLUMN "retry_task_0"."idempotent_id" IS '幂等id';
COMMENT ON COLUMN "retry_task_0"."biz_no" IS '业务编号';
COMMENT ON COLUMN "retry_task_0"."executor_name" IS '执行器名称';
COMMENT ON COLUMN "retry_task_0"."args_str" IS '执行方法参数';
COMMENT ON COLUMN "retry_task_0"."ext_attrs" IS '扩展字段';
COMMENT ON COLUMN "retry_task_0"."next_trigger_at" IS '下次触发时间';
COMMENT ON COLUMN "retry_task_0"."retry_count" IS '重试次数';
COMMENT ON COLUMN "retry_task_0"."retry_status" IS '重试状态 0、重试中 1、成功 2、最大重试次数';
COMMENT ON COLUMN "retry_task_0"."task_type" IS '任务类型 1、重试数据 2、回调数据';
COMMENT ON COLUMN "retry_task_0"."create_dt" IS '创建时间';
COMMENT ON COLUMN "retry_task_0"."update_dt" IS '修改时间';
COMMENT ON TABLE "retry_task_0" IS '任务表';
COMMENT ON COLUMN retry_task_0.id IS '主键';
COMMENT ON COLUMN retry_task_0.unique_id IS '同组下id唯一';
COMMENT ON COLUMN retry_task_0.namespace_id IS '命名空间id';
COMMENT ON COLUMN retry_task_0.group_name IS '组名称';
COMMENT ON COLUMN retry_task_0.scene_name IS '场景名称';
COMMENT ON COLUMN retry_task_0.idempotent_id IS '幂等id';
COMMENT ON COLUMN retry_task_0.biz_no IS '业务编号';
COMMENT ON COLUMN retry_task_0.executor_name IS '执行器名称';
COMMENT ON COLUMN retry_task_0.args_str IS '执行方法参数';
COMMENT ON COLUMN retry_task_0.ext_attrs IS '扩展字段';
COMMENT ON COLUMN retry_task_0.next_trigger_at IS '下次触发时间';
COMMENT ON COLUMN retry_task_0.retry_count IS '重试次数';
COMMENT ON COLUMN retry_task_0.retry_status IS '重试状态 0、重试中 1、成功 2、最大重试次数';
COMMENT ON COLUMN retry_task_0.task_type IS '任务类型 1、重试数据 2、回调数据';
COMMENT ON COLUMN retry_task_0.create_dt IS '创建时间';
COMMENT ON COLUMN retry_task_0.update_dt IS '修改时间';
COMMENT ON TABLE retry_task_0 IS '任务表';
CREATE TABLE retry_task_log
(
@ -194,28 +196,28 @@ CREATE TABLE retry_task_log
);
CREATE INDEX "idx_group_name_scene_name_retry_task_log" ON "retry_task_log" ("namespace_id", "group_name", "scene_name");
CREATE INDEX "idx_retry_status_retry_task_log" ON "retry_task_log" ("retry_status");
CREATE INDEX "idx_idempotent_id_retry_task_log" ON "retry_task_log" ("idempotent_id");
CREATE INDEX "idx_unique_id" ON "retry_task_log" ("namespace_id", "group_name", "unique_id");
CREATE INDEX "idx_biz_no_retry_task_log" ON "retry_task_log" ("biz_no");
CREATE INDEX "idx_create_dt_retry_task_log" ON "retry_task_log" ("create_dt");
CREATE INDEX idx_group_name_scene_name_retry_task_log ON retry_task_log (namespace_id, group_name, scene_name);
CREATE INDEX idx_retry_status_retry_task_log ON retry_task_log (retry_status);
CREATE INDEX idx_idempotent_id_retry_task_log ON retry_task_log (idempotent_id);
CREATE INDEX idx_unique_id ON retry_task_log (namespace_id, group_name, unique_id);
CREATE INDEX idx_biz_no_retry_task_log ON retry_task_log (biz_no);
CREATE INDEX idx_create_dt_retry_task_log ON retry_task_log (create_dt);
COMMENT ON COLUMN "retry_task_log"."id" IS '主键';
COMMENT ON COLUMN "retry_task_log"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "retry_task_log"."unique_id" IS '同组下id唯一';
COMMENT ON COLUMN "retry_task_log"."group_name" IS '组名称';
COMMENT ON COLUMN "retry_task_log"."scene_name" IS '场景名称';
COMMENT ON COLUMN "retry_task_log"."idempotent_id" IS '幂等id';
COMMENT ON COLUMN "retry_task_log"."biz_no" IS '业务编号';
COMMENT ON COLUMN "retry_task_log"."executor_name" IS '执行器名称';
COMMENT ON COLUMN "retry_task_log"."args_str" IS '执行方法参数';
COMMENT ON COLUMN "retry_task_log"."ext_attrs" IS '扩展字段';
COMMENT ON COLUMN "retry_task_log"."retry_status" IS '重试状态 0、重试中 1、成功 2、最大次数';
COMMENT ON COLUMN "retry_task_log"."task_type" IS '任务类型 1、重试数据 2、回调数据';
COMMENT ON COLUMN "retry_task_log"."create_dt" IS '创建时间';
COMMENT ON COLUMN "retry_task_log"."update_dt" IS '修改时间';
COMMENT ON TABLE "retry_task_log" IS '任务日志基础信息表';
COMMENT ON COLUMN retry_task_log.id IS '主键';
COMMENT ON COLUMN retry_task_log.namespace_id IS '命名空间id';
COMMENT ON COLUMN retry_task_log.unique_id IS '同组下id唯一';
COMMENT ON COLUMN retry_task_log.group_name IS '组名称';
COMMENT ON COLUMN retry_task_log.scene_name IS '场景名称';
COMMENT ON COLUMN retry_task_log.idempotent_id IS '幂等id';
COMMENT ON COLUMN retry_task_log.biz_no IS '业务编号';
COMMENT ON COLUMN retry_task_log.executor_name IS '执行器名称';
COMMENT ON COLUMN retry_task_log.args_str IS '执行方法参数';
COMMENT ON COLUMN retry_task_log.ext_attrs IS '扩展字段';
COMMENT ON COLUMN retry_task_log.retry_status IS '重试状态 0、重试中 1、成功 2、最大次数';
COMMENT ON COLUMN retry_task_log.task_type IS '任务类型 1、重试数据 2、回调数据';
COMMENT ON COLUMN retry_task_log.create_dt IS '创建时间';
COMMENT ON COLUMN retry_task_log.update_dt IS '修改时间';
COMMENT ON TABLE retry_task_log IS '任务日志基础信息表';
CREATE TABLE retry_task_log_message
(
@ -228,16 +230,16 @@ CREATE TABLE retry_task_log_message
client_info VARCHAR(128) DEFAULT NULL
);
CREATE INDEX "idx_namespace_id_group_name_unique_id" ON "retry_task_log_message" ("namespace_id", "group_name", "unique_id");
CREATE INDEX "idx_create_dt" ON "retry_task_log_message" ("create_dt");
COMMENT ON COLUMN "retry_task_log_message"."id" IS '主键';
COMMENT ON COLUMN "retry_task_log_message"."namespace_id" IS '命名空间';
COMMENT ON COLUMN "retry_task_log_message"."group_name" IS '组名称';
COMMENT ON COLUMN "retry_task_log_message"."unique_id" IS '同组下id唯一';
COMMENT ON COLUMN "retry_task_log_message"."create_dt" IS '创建时间';
COMMENT ON COLUMN "retry_task_log_message"."message" IS '异常信息';
COMMENT ON COLUMN "retry_task_log_message"."client_info" IS '客户端地址 clientId#ip:port';
COMMENT ON TABLE "retry_task_log_message" IS '任务调度日志信息记录表';
CREATE INDEX idx_namespace_id_group_name_unique_id ON retry_task_log_message (namespace_id, group_name, unique_id);
CREATE INDEX idx_create_dt ON retry_task_log_message (create_dt);
COMMENT ON COLUMN retry_task_log_message.id IS '主键';
COMMENT ON COLUMN retry_task_log_message.namespace_id IS '命名空间';
COMMENT ON COLUMN retry_task_log_message.group_name IS '组名称';
COMMENT ON COLUMN retry_task_log_message.unique_id IS '同组下id唯一';
COMMENT ON COLUMN retry_task_log_message.create_dt IS '创建时间';
COMMENT ON COLUMN retry_task_log_message.message IS '异常信息';
COMMENT ON COLUMN retry_task_log_message.client_info IS '客户端地址 clientId#ip:port';
COMMENT ON TABLE retry_task_log_message IS '任务调度日志信息记录表';
CREATE TABLE scene_config
(
@ -257,22 +259,22 @@ CREATE TABLE scene_config
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_namespace_id_group_name_scene_name" ON "scene_config" ("namespace_id", "group_name", "scene_name");
COMMENT ON COLUMN "scene_config"."id" IS '主键';
COMMENT ON COLUMN "scene_config"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "scene_config"."scene_name" IS '场景名称';
COMMENT ON COLUMN "scene_config"."group_name" IS '组名称';
COMMENT ON COLUMN "scene_config"."scene_status" IS '组状态 0、未启用 1、启用';
COMMENT ON COLUMN "scene_config"."max_retry_count" IS '最大重试次数';
COMMENT ON COLUMN "scene_config"."back_off" IS '1、默认等级 2、固定间隔时间 3、CRON 表达式';
COMMENT ON COLUMN "scene_config"."trigger_interval" IS '间隔时长';
COMMENT ON COLUMN "scene_config"."deadline_request" IS 'Deadline Request 调用链超时 单位毫秒';
COMMENT ON COLUMN "scene_config"."description" IS '描述';
COMMENT ON COLUMN "scene_config"."route_key" IS '路由策略';
COMMENT ON COLUMN "scene_config"."executor_timeout" IS '超时时间';
COMMENT ON COLUMN "scene_config"."create_dt" IS '创建时间';
COMMENT ON COLUMN "scene_config"."update_dt" IS '修改时间';
COMMENT ON TABLE "scene_config" IS '场景配置';
CREATE UNIQUE INDEX uk_namespace_id_group_name_scene_name ON scene_config (namespace_id, group_name, scene_name);
COMMENT ON COLUMN scene_config.id IS '主键';
COMMENT ON COLUMN scene_config.namespace_id IS '命名空间id';
COMMENT ON COLUMN scene_config.scene_name IS '场景名称';
COMMENT ON COLUMN scene_config.group_name IS '组名称';
COMMENT ON COLUMN scene_config.scene_status IS '组状态 0、未启用 1、启用';
COMMENT ON COLUMN scene_config.max_retry_count IS '最大重试次数';
COMMENT ON COLUMN scene_config.back_off IS '1、默认等级 2、固定间隔时间 3、CRON 表达式';
COMMENT ON COLUMN scene_config.trigger_interval IS '间隔时长';
COMMENT ON COLUMN scene_config.deadline_request IS 'Deadline Request 调用链超时 单位毫秒';
COMMENT ON COLUMN scene_config.description IS '描述';
COMMENT ON COLUMN scene_config.route_key IS '路由策略';
COMMENT ON COLUMN scene_config.executor_timeout IS '超时时间';
COMMENT ON COLUMN scene_config.create_dt IS '创建时间';
COMMENT ON COLUMN scene_config.update_dt IS '修改时间';
COMMENT ON TABLE scene_config IS '场景配置';
CREATE TABLE server_node
(
@ -290,23 +292,23 @@ CREATE TABLE server_node
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_host_id_host_ip" ON "server_node" ("host_id", "host_ip");
CREATE INDEX "idx_expire_at_node_type" ON "server_node" ("expire_at", "node_type");
CREATE INDEX "idx_namespace_id_group_name_server_node" ON "server_node" ("namespace_id", "group_name");
CREATE UNIQUE INDEX uk_host_id_host_ip ON server_node (host_id, host_ip);
CREATE INDEX idx_expire_at_node_type ON server_node (expire_at, node_type);
CREATE INDEX idx_namespace_id_group_name_server_node ON server_node (namespace_id, group_name);
COMMENT ON COLUMN "server_node"."id" IS '主键';
COMMENT ON COLUMN "server_node"."group_name" IS '组名称';
COMMENT ON COLUMN "server_node"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "server_node"."host_id" IS '主机id';
COMMENT ON COLUMN "server_node"."host_ip" IS '机器ip';
COMMENT ON COLUMN "server_node"."context_path" IS '客户端上下文路径 server.servlet.context-path';
COMMENT ON COLUMN "server_node"."host_port" IS '机器端口';
COMMENT ON COLUMN "server_node"."expire_at" IS '过期时间';
COMMENT ON COLUMN "server_node"."node_type" IS '节点类型 1、客户端 2、是服务端';
COMMENT ON COLUMN "server_node"."ext_attrs" IS '扩展字段';
COMMENT ON COLUMN "server_node"."create_dt" IS '创建时间';
COMMENT ON COLUMN "server_node"."update_dt" IS '修改时间';
COMMENT ON TABLE "server_node" IS '服务器节点';
COMMENT ON COLUMN server_node.id IS '主键';
COMMENT ON COLUMN server_node.group_name IS '组名称';
COMMENT ON COLUMN server_node.namespace_id IS '命名空间id';
COMMENT ON COLUMN server_node.host_id IS '主机id';
COMMENT ON COLUMN server_node.host_ip IS '机器ip';
COMMENT ON COLUMN server_node.context_path IS '客户端上下文路径 server.servlet.context-path';
COMMENT ON COLUMN server_node.host_port IS '机器端口';
COMMENT ON COLUMN server_node.expire_at IS '过期时间';
COMMENT ON COLUMN server_node.node_type IS '节点类型 1、客户端 2、是服务端';
COMMENT ON COLUMN server_node.ext_attrs IS '扩展字段';
COMMENT ON COLUMN server_node.create_dt IS '创建时间';
COMMENT ON COLUMN server_node.update_dt IS '修改时间';
COMMENT ON TABLE server_node IS '服务器节点';
CREATE TABLE distributed_lock
(
@ -322,14 +324,14 @@ CREATE TABLE distributed_lock
ALTER TABLE distributed_lock
ADD CONSTRAINT uk_name UNIQUE (name);
COMMENT ON COLUMN "distributed_lock"."id" IS '主键';
COMMENT ON COLUMN "distributed_lock"."name" IS '锁名称';
COMMENT ON COLUMN "distributed_lock"."lock_until" IS '锁定时长';
COMMENT ON COLUMN "distributed_lock"."locked_at" IS '锁定时间';
COMMENT ON COLUMN "distributed_lock"."locked_by" IS '锁定者';
COMMENT ON COLUMN "distributed_lock"."create_dt" IS '创建时间';
COMMENT ON COLUMN "distributed_lock"."update_dt" IS '修改时间';
COMMENT ON TABLE "distributed_lock" IS '锁定表';
COMMENT ON COLUMN distributed_lock.id IS '主键';
COMMENT ON COLUMN distributed_lock.name IS '锁名称';
COMMENT ON COLUMN distributed_lock.lock_until IS '锁定时长';
COMMENT ON COLUMN distributed_lock.locked_at IS '锁定时间';
COMMENT ON COLUMN distributed_lock.locked_by IS '锁定者';
COMMENT ON COLUMN distributed_lock.create_dt IS '创建时间';
COMMENT ON COLUMN distributed_lock.update_dt IS '修改时间';
COMMENT ON TABLE distributed_lock IS '锁定表';
CREATE TABLE system_user
@ -342,14 +344,14 @@ CREATE TABLE system_user
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_username" ON "system_user" ("username");
COMMENT ON COLUMN "system_user"."id" IS '主键';
COMMENT ON COLUMN "system_user"."username" IS '账号';
COMMENT ON COLUMN "system_user"."password" IS '密码';
COMMENT ON COLUMN "system_user"."role" IS '角色1-普通用户、2-管理员';
COMMENT ON COLUMN "system_user"."create_dt" IS '创建时间';
COMMENT ON COLUMN "system_user"."update_dt" IS '修改时间';
COMMENT ON TABLE "system_user" IS '系统用户表';
CREATE UNIQUE INDEX uk_username ON system_user (username);
COMMENT ON COLUMN system_user.id IS '主键';
COMMENT ON COLUMN system_user.username IS '账号';
COMMENT ON COLUMN system_user.password IS '密码';
COMMENT ON COLUMN system_user.role IS '角色1-普通用户、2-管理员';
COMMENT ON COLUMN system_user.create_dt IS '创建时间';
COMMENT ON COLUMN system_user.update_dt IS '修改时间';
COMMENT ON TABLE system_user IS '系统用户表';
-- pwd: admin
INSERT INTO system_user (username, password, role)
@ -365,14 +367,14 @@ CREATE TABLE system_user_permission
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_namespace_id_group_name_system_user_id" ON "system_user_permission" ("namespace_id", "group_name", "system_user_id");
COMMENT ON COLUMN "system_user_permission"."id" IS '主键';
COMMENT ON COLUMN "system_user_permission"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "system_user_permission"."group_name" IS '组名称';
COMMENT ON COLUMN "system_user_permission"."system_user_id" IS '系统用户id';
COMMENT ON COLUMN "system_user_permission"."create_dt" IS '创建时间';
COMMENT ON COLUMN "system_user_permission"."update_dt" IS '修改时间';
COMMENT ON TABLE "system_user_permission" IS '系统用户权限表';
CREATE UNIQUE INDEX uk_namespace_id_group_name_system_user_id ON system_user_permission (namespace_id, group_name, system_user_id);
COMMENT ON COLUMN system_user_permission.id IS '主键';
COMMENT ON COLUMN system_user_permission.namespace_id IS '命名空间id';
COMMENT ON COLUMN system_user_permission.group_name IS '组名称';
COMMENT ON COLUMN system_user_permission.system_user_id IS '系统用户id';
COMMENT ON COLUMN system_user_permission.create_dt IS '创建时间';
COMMENT ON COLUMN system_user_permission.update_dt IS '修改时间';
COMMENT ON TABLE system_user_permission IS '系统用户权限表';
CREATE TABLE sequence_alloc
@ -385,15 +387,15 @@ CREATE TABLE sequence_alloc
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX "uk_namespace_id_group_name" ON "sequence_alloc" ("namespace_id", "group_name");
CREATE UNIQUE INDEX uk_namespace_id_group_name ON sequence_alloc (namespace_id, group_name);
COMMENT ON COLUMN "sequence_alloc"."id" IS '主键';
COMMENT ON COLUMN "sequence_alloc"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "sequence_alloc"."group_name" IS '组名称';
COMMENT ON COLUMN "sequence_alloc"."max_id" IS '最大id';
COMMENT ON COLUMN "sequence_alloc"."step" IS '步长';
COMMENT ON COLUMN "sequence_alloc"."update_dt" IS '更新时间';
COMMENT ON TABLE "sequence_alloc" IS '号段模式序号ID分配表';
COMMENT ON COLUMN sequence_alloc.id IS '主键';
COMMENT ON COLUMN sequence_alloc.namespace_id IS '命名空间id';
COMMENT ON COLUMN sequence_alloc.group_name IS '组名称';
COMMENT ON COLUMN sequence_alloc.max_id IS '最大id';
COMMENT ON COLUMN sequence_alloc.step IS '步长';
COMMENT ON COLUMN sequence_alloc.update_dt IS '更新时间';
COMMENT ON TABLE sequence_alloc IS '号段模式序号ID分配表';
-- 分布式调度DDL
CREATE TABLE job
@ -426,37 +428,37 @@ CREATE TABLE job
deleted SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX "idx_namespace_id_group_name_job" ON "job" ("namespace_id", "group_name");
CREATE INDEX "idx_job_status_bucket_index_job" ON "job" ("job_status", "bucket_index");
CREATE INDEX "idx_create_dt_job" ON "job" ("create_dt");
CREATE INDEX idx_namespace_id_group_name_job ON job (namespace_id, group_name);
CREATE INDEX idx_job_status_bucket_index_job ON job (job_status, bucket_index);
CREATE INDEX idx_create_dt_job ON job (create_dt);
COMMENT ON COLUMN "job"."id" IS '主键';
COMMENT ON COLUMN "job"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "job"."group_name" IS '组名称';
COMMENT ON COLUMN "job"."job_name" IS '名称';
COMMENT ON COLUMN "job"."args_str" IS '执行方法参数';
COMMENT ON COLUMN "job"."args_type" IS '参数类型';
COMMENT ON COLUMN "job"."next_trigger_at" IS '下次触发时间';
COMMENT ON COLUMN "job"."job_status" IS '重试状态 0、关闭、1、开启';
COMMENT ON COLUMN "job"."task_type" IS '任务类型 1、集群 2、广播 3、切片';
COMMENT ON COLUMN "job"."route_key" IS '路由策略';
COMMENT ON COLUMN "job"."executor_type" IS '执行器类型';
COMMENT ON COLUMN "job"."executor_info" IS '执行器名称';
COMMENT ON COLUMN "job"."trigger_type" IS '触发类型 1.CRON 表达式 2. 固定时间';
COMMENT ON COLUMN "job"."trigger_interval" IS '间隔时长';
COMMENT ON COLUMN "job"."block_strategy" IS '阻塞策略 1、丢弃 2、覆盖 3、并行';
COMMENT ON COLUMN "job"."executor_timeout" IS '任务执行超时时间,单位秒';
COMMENT ON COLUMN "job"."max_retry_times" IS '最大重试次数';
COMMENT ON COLUMN "job"."parallel_num" IS '并行数';
COMMENT ON COLUMN "job"."retry_interval" IS '更新重试间隔(s)';
COMMENT ON COLUMN "job"."bucket_index" IS 'bucket';
COMMENT ON COLUMN "job"."resident" IS '是否是常驻任务';
COMMENT ON COLUMN "job"."description" IS '描述';
COMMENT ON COLUMN "job"."ext_attrs" IS '扩展字段';
COMMENT ON COLUMN "job"."create_dt" IS '创建时间';
COMMENT ON COLUMN "job"."deleted" IS '逻辑删除 1、删除';
COMMENT ON COLUMN "job"."update_dt" IS '更新时间';
COMMENT ON TABLE "job" IS '任务信息';
COMMENT ON COLUMN job.id IS '主键';
COMMENT ON COLUMN job.namespace_id IS '命名空间id';
COMMENT ON COLUMN job.group_name IS '组名称';
COMMENT ON COLUMN job.job_name IS '名称';
COMMENT ON COLUMN job.args_str IS '执行方法参数';
COMMENT ON COLUMN job.args_type IS '参数类型';
COMMENT ON COLUMN job.next_trigger_at IS '下次触发时间';
COMMENT ON COLUMN job.job_status IS '重试状态 0、关闭、1、开启';
COMMENT ON COLUMN job.task_type IS '任务类型 1、集群 2、广播 3、切片';
COMMENT ON COLUMN job.route_key IS '路由策略';
COMMENT ON COLUMN job.executor_type IS '执行器类型';
COMMENT ON COLUMN job.executor_info IS '执行器名称';
COMMENT ON COLUMN job.trigger_type IS '触发类型 1.CRON 表达式 2. 固定时间';
COMMENT ON COLUMN job.trigger_interval IS '间隔时长';
COMMENT ON COLUMN job.block_strategy IS '阻塞策略 1、丢弃 2、覆盖 3、并行';
COMMENT ON COLUMN job.executor_timeout IS '任务执行超时时间,单位秒';
COMMENT ON COLUMN job.max_retry_times IS '最大重试次数';
COMMENT ON COLUMN job.parallel_num IS '并行数';
COMMENT ON COLUMN job.retry_interval IS '更新重试间隔(s)';
COMMENT ON COLUMN job.bucket_index IS 'bucket';
COMMENT ON COLUMN job.resident IS '是否是常驻任务';
COMMENT ON COLUMN job.description IS '描述';
COMMENT ON COLUMN job.ext_attrs IS '扩展字段';
COMMENT ON COLUMN job.create_dt IS '创建时间';
COMMENT ON COLUMN job.deleted IS '逻辑删除 1、删除';
COMMENT ON COLUMN job.update_dt IS '更新时间';
COMMENT ON TABLE job IS '任务信息';
CREATE TABLE job_log_message
(
@ -473,22 +475,22 @@ CREATE TABLE job_log_message
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX "idx_namespace_id_group_name_to_job_log_message" ON "job_log_message" ("namespace_id", "group_name");
CREATE INDEX "idx_task_batch_id_task_id_to_job_log_message" ON "job_log_message" ("task_batch_id", "task_id");
CREATE INDEX "idx_create_dt_to_job_log_message" ON "job_log_message" ("create_dt");
CREATE INDEX idx_namespace_id_group_name_to_job_log_message ON job_log_message (namespace_id, group_name);
CREATE INDEX idx_task_batch_id_task_id_to_job_log_message ON job_log_message (task_batch_id, task_id);
CREATE INDEX idx_create_dt_to_job_log_message ON job_log_message (create_dt);
COMMENT ON COLUMN "job_log_message"."id" IS '主键';
COMMENT ON COLUMN "job_log_message"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "job_log_message"."group_name" IS '组名称';
COMMENT ON COLUMN "job_log_message"."job_id" IS '任务信息id';
COMMENT ON COLUMN "job_log_message"."task_batch_id" IS '任务批次id';
COMMENT ON COLUMN "job_log_message"."task_id" IS '调度任务id';
COMMENT ON COLUMN "job_log_message"."message" IS '调度信息';
COMMENT ON COLUMN "job_log_message"."log_num" IS '日志序号';
COMMENT ON COLUMN "job_log_message"."real_time" IS '实际时间';
COMMENT ON COLUMN "job_log_message"."create_dt" IS '创建时间';
COMMENT ON COLUMN "job_log_message"."ext_attrs" IS '扩展字段';
COMMENT ON TABLE "job_log_message" IS '调度日志';
COMMENT ON COLUMN job_log_message.id IS '主键';
COMMENT ON COLUMN job_log_message.namespace_id IS '命名空间id';
COMMENT ON COLUMN job_log_message.group_name IS '组名称';
COMMENT ON COLUMN job_log_message.job_id IS '任务信息id';
COMMENT ON COLUMN job_log_message.task_batch_id IS '任务批次id';
COMMENT ON COLUMN job_log_message.task_id IS '调度任务id';
COMMENT ON COLUMN job_log_message.message IS '调度信息';
COMMENT ON COLUMN job_log_message.log_num IS '日志序号';
COMMENT ON COLUMN job_log_message.real_time IS '实际时间';
COMMENT ON COLUMN job_log_message.create_dt IS '创建时间';
COMMENT ON COLUMN job_log_message.ext_attrs IS '扩展字段';
COMMENT ON TABLE job_log_message IS '调度日志';
CREATE TABLE job_task
(
@ -510,25 +512,25 @@ CREATE TABLE job_task
);
CREATE INDEX "idx_namespace_id_group_name_to_job_task" ON "job_task" ("namespace_id", "group_name");
CREATE INDEX "idx_task_batch_id_task_status_to_job_task" ON "job_task" ("task_batch_id", "task_status");
CREATE INDEX "idx_create_dt_to_job_task" ON "job_task" ("create_dt");
COMMENT ON COLUMN "job_task"."id" IS '主键';
COMMENT ON COLUMN "job_task"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "job_task"."group_name" IS '组名称';
COMMENT ON COLUMN "job_task"."job_id" IS '任务信息id';
COMMENT ON COLUMN "job_task"."task_batch_id" IS '任务批次id';
COMMENT ON COLUMN "job_task"."parent_id" IS '父执行器id';
COMMENT ON COLUMN "job_task"."task_status" IS '执行的状态 0、失败 1、成功';
COMMENT ON COLUMN "job_task"."retry_count" IS '重试次数';
COMMENT ON COLUMN "job_task"."client_info" IS '客户端地址 clientId#ip:port';
COMMENT ON COLUMN "job_task"."result_message" IS '调度信息';
COMMENT ON COLUMN "job_task"."args_str" IS '执行方法参数';
COMMENT ON COLUMN "job_task"."args_type" IS '参数类型';
COMMENT ON COLUMN "job_task"."create_dt" IS '创建时间';
COMMENT ON COLUMN "job_task"."update_dt" IS '创建时间';
COMMENT ON COLUMN "job_task"."ext_attrs" IS '扩展字段';
COMMENT ON TABLE "job_task" IS '任务实例';
CREATE INDEX idx_namespace_id_group_name_to_job_task ON job_task (namespace_id, group_name);
CREATE INDEX idx_task_batch_id_task_status_to_job_task ON job_task (task_batch_id, task_status);
CREATE INDEX idx_create_dt_to_job_task ON job_task (create_dt);
COMMENT ON COLUMN job_task.id IS '主键';
COMMENT ON COLUMN job_task.namespace_id IS '命名空间id';
COMMENT ON COLUMN job_task.group_name IS '组名称';
COMMENT ON COLUMN job_task.job_id IS '任务信息id';
COMMENT ON COLUMN job_task.task_batch_id IS '任务批次id';
COMMENT ON COLUMN job_task.parent_id IS '父执行器id';
COMMENT ON COLUMN job_task.task_status IS '执行的状态 0、失败 1、成功';
COMMENT ON COLUMN job_task.retry_count IS '重试次数';
COMMENT ON COLUMN job_task.client_info IS '客户端地址 clientId#ip:port';
COMMENT ON COLUMN job_task.result_message IS '调度信息';
COMMENT ON COLUMN job_task.args_str IS '执行方法参数';
COMMENT ON COLUMN job_task.args_type IS '参数类型';
COMMENT ON COLUMN job_task.create_dt IS '创建时间';
COMMENT ON COLUMN job_task.update_dt IS '创建时间';
COMMENT ON COLUMN job_task.ext_attrs IS '扩展字段';
COMMENT ON TABLE job_task IS '任务实例';
CREATE TABLE job_task_batch
(
@ -550,28 +552,28 @@ CREATE TABLE job_task_batch
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX "idx_namespace_id_group_name_to_job_task_batch" ON "job_task_batch" ("namespace_id", "group_name");
CREATE INDEX "idx_job_id_task_batch_status_to_job_task_batch" ON "job_task_batch" ("job_id", "task_batch_status");
CREATE INDEX "idx_create_dt_to_job_task_batch" ON "job_task_batch" ("create_dt");
CREATE INDEX "idx_workflow_task_batch_id_workflow_node_id" ON "job_task_batch" ("workflow_task_batch_id", "workflow_node_id");
CREATE INDEX idx_namespace_id_group_name_to_job_task_batch ON job_task_batch (namespace_id, group_name);
CREATE INDEX idx_job_id_task_batch_status_to_job_task_batch ON job_task_batch (job_id, task_batch_status);
CREATE INDEX idx_create_dt_to_job_task_batch ON job_task_batch (create_dt);
CREATE INDEX idx_workflow_task_batch_id_workflow_node_id ON job_task_batch (workflow_task_batch_id, workflow_node_id);
COMMENT ON COLUMN "job_task_batch"."id" IS '主键';
COMMENT ON COLUMN "job_task_batch"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "job_task_batch"."group_name" IS '组名称';
COMMENT ON COLUMN "job_task_batch"."job_id" IS '任务信息id';
COMMENT ON COLUMN "job_task_batch"."task_batch_status" IS '任务批次状态 0、失败 1、成功';
COMMENT ON COLUMN "job_task_batch"."operation_reason" IS '操作原因';
COMMENT ON COLUMN "job_task_batch"."workflow_node_id" IS '工作流节点id';
COMMENT ON COLUMN "job_task_batch"."parent_workflow_node_id" IS '父节点';
COMMENT ON COLUMN "job_task_batch"."workflow_task_batch_id" IS '任务批次id';
COMMENT ON COLUMN "job_task_batch"."system_task_type" IS '任务类型 0、系统任务 1、业务任务';
COMMENT ON COLUMN "job_task_batch"."execution_at" IS '任务执行时间';
COMMENT ON COLUMN "job_task_batch"."parent_id" IS '父节点';
COMMENT ON COLUMN "job_task_batch"."deleted" IS '逻辑删除 1、删除';
COMMENT ON COLUMN "job_task_batch"."create_dt" IS '创建时间';
COMMENT ON COLUMN "job_task_batch"."update_dt" IS '创建时间';
COMMENT ON COLUMN "job_task_batch"."ext_attrs" IS '扩展字段';
COMMENT ON TABLE "job_task_batch" IS '任务批次';
COMMENT ON COLUMN job_task_batch.id IS '主键';
COMMENT ON COLUMN job_task_batch.namespace_id IS '命名空间id';
COMMENT ON COLUMN job_task_batch.group_name IS '组名称';
COMMENT ON COLUMN job_task_batch.job_id IS '任务信息id';
COMMENT ON COLUMN job_task_batch.task_batch_status IS '任务批次状态 0、失败 1、成功';
COMMENT ON COLUMN job_task_batch.operation_reason IS '操作原因';
COMMENT ON COLUMN job_task_batch.workflow_node_id IS '工作流节点id';
COMMENT ON COLUMN job_task_batch.parent_workflow_node_id IS '父节点';
COMMENT ON COLUMN job_task_batch.workflow_task_batch_id IS '任务批次id';
COMMENT ON COLUMN job_task_batch.system_task_type IS '任务类型 0、系统任务 1、业务任务';
COMMENT ON COLUMN job_task_batch.execution_at IS '任务执行时间';
COMMENT ON COLUMN job_task_batch.parent_id IS '父节点';
COMMENT ON COLUMN job_task_batch.deleted IS '逻辑删除 1、删除';
COMMENT ON COLUMN job_task_batch.create_dt IS '创建时间';
COMMENT ON COLUMN job_task_batch.update_dt IS '创建时间';
COMMENT ON COLUMN job_task_batch.ext_attrs IS '扩展字段';
COMMENT ON TABLE job_task_batch IS '任务批次';
CREATE TABLE job_notify_config
(
@ -593,21 +595,21 @@ CREATE TABLE job_notify_config
CREATE INDEX idx_namespace_id_group_name_job_id_job_notify_config ON job_notify_config (namespace_id, group_name, job_id);
COMMENT ON COLUMN "job_notify_config"."id" IS '主键';
COMMENT ON COLUMN "job_notify_config"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "job_notify_config"."group_name" IS '组名称';
COMMENT ON COLUMN "job_notify_config"."job_id" IS '任务信息id';
COMMENT ON COLUMN "job_notify_config"."notify_status" IS '通知状态 0、未启用 1、启用';
COMMENT ON COLUMN "job_notify_config"."notify_type" IS '通知类型 1、钉钉 2、邮件 3、企业微信';
COMMENT ON COLUMN "job_notify_config"."notify_attribute" IS '配置属性';
COMMENT ON COLUMN "job_notify_config"."notify_threshold" IS '通知阈值';
COMMENT ON COLUMN "job_notify_config"."notify_scene" IS '通知场景';
COMMENT ON COLUMN "job_notify_config"."rate_limiter_status" IS '限流状态 0、未启用 1、启用';
COMMENT ON COLUMN "job_notify_config"."rate_limiter_threshold" IS '每秒限流阈值';
COMMENT ON COLUMN "job_notify_config"."description" IS '描述';
COMMENT ON COLUMN "job_notify_config"."create_dt" IS '创建时间';
COMMENT ON COLUMN "job_notify_config"."update_dt" IS '修改时间';
COMMENT ON TABLE "job_notify_config" IS '通知配置';
COMMENT ON COLUMN job_notify_config.id IS '主键';
COMMENT ON COLUMN job_notify_config.namespace_id IS '命名空间id';
COMMENT ON COLUMN job_notify_config.group_name IS '组名称';
COMMENT ON COLUMN job_notify_config.job_id IS '任务信息id';
COMMENT ON COLUMN job_notify_config.notify_status IS '通知状态 0、未启用 1、启用';
COMMENT ON COLUMN job_notify_config.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信';
COMMENT ON COLUMN job_notify_config.notify_attribute IS '配置属性';
COMMENT ON COLUMN job_notify_config.notify_threshold IS '通知阈值';
COMMENT ON COLUMN job_notify_config.notify_scene IS '通知场景';
COMMENT ON COLUMN job_notify_config.rate_limiter_status IS '限流状态 0、未启用 1、启用';
COMMENT ON COLUMN job_notify_config.rate_limiter_threshold IS '每秒限流阈值';
COMMENT ON COLUMN job_notify_config.description IS '描述';
COMMENT ON COLUMN job_notify_config.create_dt IS '创建时间';
COMMENT ON COLUMN job_notify_config.update_dt IS '修改时间';
COMMENT ON TABLE job_notify_config IS '通知配置';
CREATE TABLE retry_summary
(
@ -624,20 +626,20 @@ CREATE TABLE retry_summary
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX uk_scene_name_trigger_at ON retry_summary ("namespace_id", "group_name", "scene_name", "trigger_at");
CREATE UNIQUE INDEX uk_scene_name_trigger_at ON retry_summary (namespace_id, group_name, scene_name, trigger_at);
COMMENT ON COLUMN "retry_summary"."id" IS '主键';
COMMENT ON COLUMN "retry_summary"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "retry_summary"."group_name" IS '组名称';
COMMENT ON COLUMN "retry_summary"."scene_name" IS '场景名称';
COMMENT ON COLUMN "retry_summary"."trigger_at" IS '统计时间';
COMMENT ON COLUMN "retry_summary"."running_num" IS '重试中-日志数量';
COMMENT ON COLUMN "retry_summary"."finish_num" IS '重试完成-日志数量';
COMMENT ON COLUMN "retry_summary"."max_count_num" IS '重试到达最大次数-日志数量';
COMMENT ON COLUMN "retry_summary"."suspend_num" IS '暂停重试-日志数量';
COMMENT ON COLUMN "retry_summary"."create_dt" IS '创建时间';
COMMENT ON COLUMN "retry_summary"."update_dt" IS '修改时间';
COMMENT ON TABLE "retry_summary" IS 'DashBoard_Retry';
COMMENT ON COLUMN retry_summary.id IS '主键';
COMMENT ON COLUMN retry_summary.namespace_id IS '命名空间id';
COMMENT ON COLUMN retry_summary.group_name IS '组名称';
COMMENT ON COLUMN retry_summary.scene_name IS '场景名称';
COMMENT ON COLUMN retry_summary.trigger_at IS '统计时间';
COMMENT ON COLUMN retry_summary.running_num IS '重试中-日志数量';
COMMENT ON COLUMN retry_summary.finish_num IS '重试完成-日志数量';
COMMENT ON COLUMN retry_summary.max_count_num IS '重试到达最大次数-日志数量';
COMMENT ON COLUMN retry_summary.suspend_num IS '暂停重试-日志数量';
COMMENT ON COLUMN retry_summary.create_dt IS '创建时间';
COMMENT ON COLUMN retry_summary.update_dt IS '修改时间';
COMMENT ON TABLE retry_summary IS 'DashBoard_Retry';
CREATE TABLE job_summary
(
@ -658,23 +660,23 @@ CREATE TABLE job_summary
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX uk_job_id_trigger_at ON job_summary ("business_id", "trigger_at");
CREATE INDEX idx_namespace_id_group_name_job_id ON job_summary ("namespace_id", "group_name", "business_id");
CREATE UNIQUE INDEX uk_job_id_trigger_at ON job_summary (business_id, trigger_at);
CREATE INDEX idx_namespace_id_group_name_job_id ON job_summary (namespace_id, group_name, business_id);
COMMENT ON COLUMN "job_summary"."id" IS '主键';
COMMENT ON COLUMN "job_summary"."namespace_id" IS '命名空间id';
COMMENT ON COLUMN "job_summary"."group_name" IS '组名称';
COMMENT ON COLUMN "job_summary"."business_id" IS '业务id (job_id或workflow_id)';
COMMENT ON COLUMN "job_summary"."system_task_type" IS '任务类型 3、JOB任务 4、WORKFLOW任务';
COMMENT ON COLUMN "job_summary"."trigger_at" IS '统计时间';
COMMENT ON COLUMN "job_summary"."success_num" IS '执行成功-日志数量';
COMMENT ON COLUMN "job_summary"."fail_num" IS '执行失败-日志数量';
COMMENT ON COLUMN "job_summary"."fail_reason" IS '失败原因';
COMMENT ON COLUMN "job_summary"."stop_num" IS '执行失败-日志数量';
COMMENT ON COLUMN "job_summary"."stop_reason" IS '失败原因';
COMMENT ON COLUMN "job_summary"."cancel_num" IS '执行失败-日志数量';
COMMENT ON COLUMN "job_summary"."cancel_reason" IS '失败原因';
COMMENT ON TABLE "job_summary" IS 'DashBoard_Job';
COMMENT ON COLUMN job_summary.id IS '主键';
COMMENT ON COLUMN job_summary.namespace_id IS '命名空间id';
COMMENT ON COLUMN job_summary.group_name IS '组名称';
COMMENT ON COLUMN job_summary.business_id IS '业务id (job_id或workflow_id)';
COMMENT ON COLUMN job_summary.system_task_type IS '任务类型 3、JOB任务 4、WORKFLOW任务';
COMMENT ON COLUMN job_summary.trigger_at IS '统计时间';
COMMENT ON COLUMN job_summary.success_num IS '执行成功-日志数量';
COMMENT ON COLUMN job_summary.fail_num IS '执行失败-日志数量';
COMMENT ON COLUMN job_summary.fail_reason IS '失败原因';
COMMENT ON COLUMN job_summary.stop_num IS '执行失败-日志数量';
COMMENT ON COLUMN job_summary.stop_reason IS '失败原因';
COMMENT ON COLUMN job_summary.cancel_num IS '执行失败-日志数量';
COMMENT ON COLUMN job_summary.cancel_reason IS '失败原因';
COMMENT ON TABLE job_summary IS 'DashBoard_Job';
CREATE TABLE workflow
(

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,9 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO
job_summary (namespace_id, group_name, business_id, trigger_at,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
VALUES
<foreach collection="list" item="item" separator=",">
(
@ -40,26 +39,46 @@
#{item.cancelReason}
)
</foreach>
ON DUPLICATE KEY UPDATE
success_num = values(`success_num`),
fail_num = values(`fail_num`),
fail_reason = values(`fail_reason`),
stop_num = values(`stop_num`),
stop_reason = values(`stop_reason`),
cancel_num = values(`cancel_num`),
cancel_reason = values(`cancel_reason`)
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE job_summary rt,
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason,
#{item.triggerAt} AS trigger_at,
#{item.businessId} AS business_id
</foreach>
) tt
SET
rt.success_num = tt.success_num,
rt.fail_num = tt.fail_num,
rt.fail_reason = tt.fail_reason,
rt.stop_num = tt.stop_num,
rt.stop_reason = tt.stop_reason,
rt.cancel_num = tt.cancel_num,
rt.cancel_reason = tt.cancel_reason
WHERE rt.trigger_at = tt.trigger_at
AND rt.business_id = tt.business_id
</update>
<select id="jobLineList"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardLineResponseDO">
SELECT
DATE_FORMAT(trigger_at, #{dateFormat}) AS createDt,
ifnull(SUM(success_num), 0) AS success,
ifnull(SUM(fail_num), 0) AS failNum,
ifnull(SUM(stop_num), 0) AS stop,
ifnull(SUM(cancel_num), 0) AS cancel,
ifnull(SUM(fail_num + stop_num + cancel_num), 0) AS fail,
ifnull(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
DATE_FORMAT(trigger_at, #{dateFormat}) AS createDt,
IFNULL(SUM(success_num), 0) AS success,
IFNULL(SUM(fail_num), 0) AS failNum,
IFNULL(SUM(stop_num), 0) AS stop,
IFNULL(SUM(cancel_num), 0) AS cancel,
IFNULL(SUM(fail_num + stop_num + cancel_num), 0) AS fail,
IFNULL(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
FROM job_summary
${ew.customSqlSegment}
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
@ -67,11 +86,11 @@
<select id="toJobTask"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$JobTask">
SELECT ifnull(sum(success_num), 0) AS successNum,
ifnull(sum(stop_num), 0) AS stopNum,
ifnull(sum(cancel_num), 0) AS cancelNum,
ifnull(sum(fail_num), 0) AS failNum,
ifnull(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
SELECT IFNULL(sum(success_num), 0) AS successNum,
IFNULL(sum(stop_num), 0) AS stopNum,
IFNULL(sum(cancel_num), 0) AS cancelNum,
IFNULL(sum(fail_num), 0) AS failNum,
IFNULL(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
FROM job_summary
${ew.customSqlSegment}
</select>

View File

@ -15,30 +15,49 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO
retry_summary (namespace_id, group_name, scene_name, trigger_at, running_num, finish_num, max_count_num,
suspend_num)
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO retry_summary (namespace_id, group_name, scene_name, trigger_at,
running_num, finish_num, max_count_num, suspend_num)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
ON DUPLICATE KEY UPDATE
running_num = values(`running_num`),
finish_num = values(`finish_num`),
max_count_num = values(`max_count_num`),
suspend_num = values(`suspend_num`)
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE retry_summary rt,
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.runningNum} AS running_num,
#{item.finishNum} AS finish_num,
#{item.maxCountNum} AS max_count_num,
#{item.suspendNum} AS suspend_num,
#{item.triggerAt} AS trigger_at,
#{item.sceneName} AS scene_name,
#{item.namespaceId} AS namespace_id,
#{item.groupName} AS group_name
</foreach>
) tt
SET rt.running_num = tt.running_num,
rt.finish_num = tt.finish_num,
rt.max_count_num = tt.max_count_num,
rt.suspend_num = tt.suspend_num
WHERE rt.trigger_at = tt.trigger_at
AND rt.group_name = tt.group_name
AND rt.namespace_id = tt.namespace_id
AND rt.scene_name = tt.scene_name
</update>
<select id="retryTask"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$RetryTask">
SELECT ifnull(sum(running_num), 0) AS runningNum,

View File

@ -17,18 +17,43 @@
<sql id="Base_Column_List">
id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
</sql>
<insert id="insertOrUpdate" parameterType="com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode" useGeneratedKeys="true" keyProperty="id">
insert into server_node (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
values
<foreach collection="records" item="item" index="index" separator=",">
(#{item.namespaceId,jdbcType=VARCHAR}, #{item.groupName,jdbcType=VARCHAR}, #{item.hostId,jdbcType=VARCHAR}, #{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER}, #{item.expireAt,jdbcType=TIMESTAMP}, #{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR}, #{item.contextPath,jdbcType=VARCHAR}, #{item.createDt,jdbcType=TIMESTAMP})
</foreach>
ON DUPLICATE KEY UPDATE
expire_at = values(`expire_at`)
</insert>
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO server_node (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
VALUES
<foreach collection="records" item="item" index="index" separator=",">
(
#{item.namespaceId,jdbcType=VARCHAR},
#{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR},
#{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP},
#{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR},
#{item.createDt,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
<update id="batchUpdateExpireAt" parameterType="java.util.List">
UPDATE server_node rt,
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.expireAt} AS expire_at,
#{item.contextPath} AS context_path,
#{item.hostId} AS host_id,
#{item.hostIp} AS host_ip
</foreach>
) tt
SET rt.expire_at = tt.expire_at,
rt.context_path = tt.context_path
WHERE rt.host_id = tt.host_id and rt.host_ip = tt.host_ip
</update>
<select id="countActivePod" resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
SELECT node_type as nodeType, count(*) as total
from server_node

View File

@ -40,31 +40,32 @@
)
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE job_summary rt,
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason,
#{item.triggerAt} AS trigger_at,
#{item.businessId} AS business_id
</foreach>
) tt
SET
rt.success_num = tt.success_num,
rt.fail_num = tt.fail_num,
rt.fail_reason = tt.fail_reason,
rt.stop_num = tt.stop_num,
rt.stop_reason = tt.stop_reason,
rt.cancel_num = tt.cancel_num,
rt.cancel_reason = tt.cancel_reason
WHERE rt.trigger_at = tt.trigger_at and rt.business_id = tt.business_id
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason,
#{item.triggerAt} AS trigger_at,
#{item.businessId} AS business_id
</foreach>
) tt
SET rt.success_num = tt.success_num,
rt.fail_num = tt.fail_num,
rt.fail_reason = tt.fail_reason,
rt.stop_num = tt.stop_num,
rt.stop_reason = tt.stop_reason,
rt.cancel_num = tt.cancel_num,
rt.cancel_reason = tt.cancel_reason
WHERE rt.trigger_at = tt.trigger_at
AND rt.business_id = tt.business_id
</update>
<select id="jobLineList"

View File

@ -20,43 +20,43 @@
retry_summary (namespace_id, group_name, scene_name, trigger_at, running_num, finish_num, max_count_num,
suspend_num)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE retry_summary rt,
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.runningNum} AS running_num,
#{item.finishNum} AS finish_num,
#{item.maxCountNum} AS max_count_num,
#{item.suspendNum} AS suspend_num,
#{item.triggerAt} AS trigger_at,
#{item.sceneName} AS scene_name,
#{item.namespaceId} AS namespace_id,
#{item.groupName} AS group_name
</foreach>
) tt
SET
rt.running_num = tt.running_num,
rt.finish_num = tt.finish_num,
rt.max_count_num = tt.max_count_num,
rt.suspend_num = tt.suspend_num
WHERE rt.trigger_at = tt.trigger_at
and rt.group_name = tt.group_name
and rt.namespace_id = tt.namespace_id
and rt.scene_name = tt.scene_name
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.runningNum} AS running_num,
#{item.finishNum} AS finish_num,
#{item.maxCountNum} AS max_count_num,
#{item.suspendNum} AS suspend_num,
#{item.triggerAt} AS trigger_at,
#{item.sceneName} AS scene_name,
#{item.namespaceId} AS namespace_id,
#{item.groupName} AS group_name
</foreach>
) tt
SET rt.running_num = tt.running_num,
rt.finish_num = tt.finish_num,
rt.max_count_num = tt.max_count_num,
rt.suspend_num = tt.suspend_num
WHERE rt.trigger_at = tt.trigger_at
AND rt.group_name = tt.group_name
AND rt.namespace_id = tt.namespace_id
AND rt.scene_name = tt.scene_name
</update>
<select id="retryTask"

View File

@ -17,47 +17,52 @@
</resultMap>
<sql id="Base_Column_List">
id
, namespace_id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
id, namespace_id, group_name, context_path, host_id, host_ip, host_port,
expire_at, node_type,create_dt,update_dt
</sql>
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO server_node (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
expire_at, node_type, ext_attrs, context_path, create_dt)
VALUES
<foreach collection="records" item="item" index="index" separator=",">
(
#{item.namespaceId,jdbcType=VARCHAR},
#{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR},
#{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP},
#{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR},
#{item.createDt,jdbcType=TIMESTAMP}
)
</foreach>
<foreach collection="records" item="item" index="index" separator=",">
(
#{item.namespaceId,jdbcType=VARCHAR},
#{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR},
#{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP},
#{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR},
#{item.createDt,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
<update id="batchUpdateExpireAt" parameterType="java.util.List">
UPDATE server_node rt,
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.expireAt} AS expire_at,
#{item.contextPath} AS context_path,
#{item.hostId} AS host_id,
#{item.hostIp} AS host_ip
</foreach>
) tt
SET rt.expire_at = tt.expire_at, rt.context_path = tt.context_path,
WHERE rt.host_id = tt.host_id and rt.host_ip = tt.host_ip
(
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.expireAt} AS expire_at,
#{item.contextPath} AS context_path,
#{item.hostId} AS host_id,
#{item.hostIp} AS host_ip
</foreach>
) tt
SET rt.expire_at = tt.expire_at,
rt.context_path = tt.context_path
WHERE rt.host_id = tt.host_id
AND rt.host_ip = tt.host_ip
</update>
<select id="countActivePod"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
SELECT node_type AS nodeType,
COUNT(*) AS total
FROM server_node ${ew.customSqlSegment}
FROM server_node
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -19,58 +19,42 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
MERGE INTO job_summary dest
USING (
<foreach collection="list" item="item" separator=" UNION ALL ">
SELECT
#{item.namespaceId} AS namespace_id,
#{item.groupName} AS group_name,
#{item.businessId} AS business_id,
#{item.triggerAt} AS trigger_at,
#{item.systemTaskType} AS system_task_type,
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason
FROM DUAL
</foreach>
) src
ON (dest.job_id = src.job_id AND dest.trigger_at = src.trigger_at AND dest.system_task_type = src.system_task_type)
WHEN MATCHED THEN
UPDATE SET
dest.success_num = src.success_num,
dest.fail_num = src.fail_num,
dest.fail_reason = src.fail_reason,
dest.stop_num = src.stop_num,
dest.stop_reason = src.stop_reason,
dest.cancel_num = src.cancel_num,
dest.cancel_reason = src.cancel_reason
WHEN NOT MATCHED THEN
INSERT (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.jobId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
)
</foreach>
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
INSERT INTO job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
<foreach collection="list" item="item" separator=" UNION ALL ">
SELECT
#{item.namespaceId},
#{item.groupName},
#{item.businessId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
FROM DUAL
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
UPDATE job_summary
SET success_num = #{item.successNum},
fail_num = #{item.failNum},
fail_reason = #{item.failReason},
stop_num = #{item.stopNum},
stop_reason = #{item.stopReason},
cancel_num = #{item.cancelNum},
cancel_reason = #{item.cancelReason}
WHERE trigger_at = #{item.triggerAt}
AND business_id = #{item.businessId}
</foreach>
</update>
<select id="jobLineList"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardLineResponseDO">
SELECT

View File

@ -15,50 +15,37 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
MERGE INTO retry_summary dest
USING (
<foreach collection="list" item="item" separator=" UNION ALL ">
SELECT
#{item.namespaceId} AS namespace_id,
#{item.groupName} AS group_name,
#{item.sceneName} AS scene_name,
#{item.triggerAt} AS trigger_at,
#{item.runningNum} AS running_num,
#{item.finishNum} AS finish_num,
#{item.maxCountNum} AS max_count_num,
#{item.suspendNum AS suspend_num}
FROM DUAL
</foreach>
) src
ON (dest.namespace_id = src.namespace_id
AND dest.group_name = src.group_name
AND dest.scene_name = src.scene_name
AND dest.trigger_at = src.trigger_at)
WHEN MATCHED THEN
UPDATE SET
dest.running_num = src.running_num,
dest.finish_num = src.finish_num,
dest.max_count_num = src.max_count_num,
dest.suspend_num = src.suspend_num
WHEN NOT MATCHED THEN
INSERT (namespace_id, group_name, scene_name, trigger_at,
running_num, finish_num, max_count_num, suspend_num)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
INSERT INTO retry_summary (namespace_id, group_name, scene_name, trigger_at,
running_num, finish_num, max_count_num, suspend_num)
<foreach collection="list" item="item" separator="UNION ALL">
SELECT
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
FROM DUAL
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
UPDATE retry_summary
SET running_num = #{item.runningNum},
finish_num = #{item.finishNum},
max_count_num = #{item.maxCountNum},
suspend_num = #{item.suspendNum}
WHERE trigger_at = #{item.triggerAt}
AND group_name = #{item.groupName}
AND namespace_id = #{item.namespaceId}
AND scene_name = #{item.sceneName}
</foreach>
</update>
<select id="retryTask"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$RetryTask">
SELECT COALESCE(sum(running_num), 0) AS runningNum,
@ -75,8 +62,7 @@
SELECT *
FROM
(
SELECT
trigger_at, running_num, finish_num, max_count_num, suspend_num
SELECT trigger_at, running_num, finish_num, max_count_num, suspend_num
FROM retry_summary
${ew.customSqlSegment}
)

View File

@ -19,40 +19,36 @@
id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
</sql>
<insert id="insertOrUpdate" parameterType="com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode"
useGeneratedKeys="false" keyProperty="id">
MERGE INTO server_node dest
USING(
<foreach collection="records" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.namespaceId,jdbcType=VARCHAR} AS namespace_id,
#{item.groupName,jdbcType=VARCHAR} AS group_name,
#{item.hostId,jdbcType=VARCHAR} AS host_id,
#{item.hostIp,jdbcType=VARCHAR} AS host_ip,
#{item.hostPort,jdbcType=INTEGER} AS host_port,
#{item.expireAt,jdbcType=TIMESTAMP} AS expire_at,
#{item.nodeType,jdbcType=TINYINT} AS node_type,
#{item.extAttrs,jdbcType=VARCHAR} AS ext_attrs,
#{item.contextPath,jdbcType=VARCHAR} AS context_path,
#{item.createDt,jdbcType=TIMESTAMP} AS create_dt
FROM DUAL
</foreach>
) src
ON( dest.host_id = src.host_id AND dest.host_ip = src.host_ip)
WHEN MATCHED THEN
UPDATE SET expire_at = src.expire_at
WHEN NOT MATCHED THEN
INSERT (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
VALUES
<foreach collection="records" item="item" index="index" separator=",">
(#{item.namespaceId,jdbcType=VARCHAR}, #{item.groupName,jdbcType=VARCHAR}, #{item.hostId,jdbcType=VARCHAR}, #{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER}, #{item.expireAt,jdbcType=TIMESTAMP}, #{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR}, #{item.contextPath,jdbcType=VARCHAR}, #{item.createDt,jdbcType=TIMESTAMP})
</foreach>
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
<!-- useGeneratedKeys="false" 否则报错ORA-00933: SQL command not properly ended -->
INSERT INTO server_node (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
<foreach collection="records" item="item" index="index" separator=" UNION ">
SELECT
#{item.namespaceId,jdbcType=VARCHAR},
#{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR},
#{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP},
#{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR},
#{item.createDt,jdbcType=TIMESTAMP}
FROM DUAL
</foreach>
</insert>
<update id="batchUpdateExpireAt" parameterType="java.util.List">
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
UPDATE server_node
SET expire_at = #{item.expireAt},
context_path = #{item.contextPath}
WHERE host_id = #{item.hostId}
AND host_ip = #{item.hostIp}
</foreach>
</update>
<select id="countActivePod"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
SELECT

View File

@ -19,37 +19,55 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO
job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.businessId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
)
</foreach>
ON CONFLICT (business_id, trigger_at, system_task_type) DO UPDATE
SET success_num = EXCLUDED.success_num,
fail_num = EXCLUDED.fail_num,
fail_reason = EXCLUDED.fail_reason,
stop_num = EXCLUDED.stop_num,
stop_reason = EXCLUDED.stop_reason,
cancel_num = EXCLUDED.cancel_num,
cancel_reason = EXCLUDED.cancel_reason
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.businessId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
)
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE job_summary AS rt
SET success_num = tt.success_num,
fail_num = tt.fail_num,
fail_reason = tt.fail_reason,
stop_num = tt.stop_num,
stop_reason = tt.stop_reason,
cancel_num = tt.cancel_num,
cancel_reason = tt.cancel_reason
FROM (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason,
#{item.triggerAt} AS trigger_at,
#{item.businessId} AS business_id
</foreach>
) AS tt
WHERE rt.trigger_at = tt.trigger_at
AND rt.business_id = tt.business_id
</update>
<select id="jobLineList"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardLineResponseDO">
SELECT

View File

@ -15,30 +15,49 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO
retry_summary (namespace_id, group_name, scene_name, trigger_at, running_num, finish_num, max_count_num,
suspend_num)
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO retry_summary (namespace_id, group_name, scene_name, trigger_at,
running_num, finish_num, max_count_num, suspend_num)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
ON CONFLICT (namespace_id, group_name, scene_name, trigger_at) DO UPDATE
SET running_num = EXCLUDED.running_num,
finish_num = EXCLUDED.finish_num,
max_count_num = EXCLUDED.max_count_num,
suspend_num = EXCLUDED.suspend_num
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE retry_summary AS rt
SET running_num = tt.running_num,
finish_num = tt.finish_num,
max_count_num = tt.max_count_num,
suspend_num = tt.suspend_num
FROM (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.runningNum} AS running_num,
#{item.finishNum} AS finish_num,
#{item.maxCountNum} AS max_count_num,
#{item.suspendNum} AS suspend_num,
#{item.triggerAt} AS trigger_at,
#{item.sceneName} AS scene_name,
#{item.namespaceId} AS namespace_id,
#{item.groupName} AS group_name
</foreach>
) AS tt
WHERE rt.trigger_at = tt.trigger_at
AND rt.group_name = tt.group_name
AND rt.namespace_id = tt.namespace_id
AND rt.scene_name = tt.scene_name
</update>
<select id="retryTask"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$RetryTask">
SELECT COALESCE(sum(running_num), 0) AS runningNum,

View File

@ -17,19 +17,44 @@
<sql id="Base_Column_List">
id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
</sql>
<insert id="insertOrUpdate" parameterType="com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode"
useGeneratedKeys="true" keyProperty="id">
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO server_node (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
VALUES
<foreach collection="records" item="item" index="index" separator=",">
(#{item.namespaceId,jdbcType=VARCHAR}, #{item.groupName,jdbcType=VARCHAR}, #{item.hostId,jdbcType=VARCHAR}, #{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER}, #{item.expireAt,jdbcType=TIMESTAMP}, #{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR}, #{item.contextPath,jdbcType=VARCHAR}, #{item.createDt,jdbcType=TIMESTAMP})
</foreach>
ON CONFLICT (host_id, host_ip) DO UPDATE SET expire_at = EXCLUDED.expire_at
<foreach collection="records" item="item" index="index" separator=",">
(
#{item.namespaceId,jdbcType=VARCHAR},
#{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR},
#{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP},
#{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR},
#{item.createDt,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
<update id="batchUpdateExpireAt" parameterType="java.util.List">
UPDATE server_node AS rt
SET expire_at = tt.expire_at,
context_path = tt.context_path
FROM (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.expireAt} AS expire_at,
#{item.contextPath} AS context_path,
#{item.hostId} AS host_id,
#{item.hostIp} AS host_ip
</foreach>
) AS tt
WHERE rt.host_id = tt.host_id
AND rt.host_ip = tt.host_ip
</update>
<select id="countActivePod"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
SELECT node_type as nodeType, count(*) as total

View File

@ -28,14 +28,15 @@
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
UPDATE job
SET job.next_trigger_at = src.next_trigger_at
FROM job
JOIN (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.nextTriggerAt} AS next_trigger_at,
#{item.id} AS id
</foreach>
) AS src ON job.id = src.id;
SET next_trigger_at = src.next_trigger_at
FROM job AS dest
JOIN (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.nextTriggerAt} AS next_trigger_at,
#{item.id} AS id
</foreach>
) AS src
ON (dest.id = src.id)
</update>
</mapper>

View File

@ -19,47 +19,55 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
MERGE INTO job_summary AS target
USING (
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.businessId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
)
</foreach>
) AS source (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num, fail_num, fail_reason, stop_num, stop_reason, cancel_num, cancel_reason)
ON target.namespace_id = source.namespace_id
AND target.business_id = source.business_id
WHEN MATCHED THEN
UPDATE SET
target.success_num = source.success_num,
target.fail_num = source.fail_num,
target.fail_reason = source.fail_reason,
target.stop_num = source.stop_num,
target.stop_reason = source.stop_reason,
target.cancel_num = source.cancel_num,
target.cancel_reason = source.cancel_reason
WHEN NOT MATCHED THEN
INSERT (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num, fail_num, fail_reason, stop_num, stop_reason, cancel_num, cancel_reason)
VALUES (source.namespace_id, source.group_name, source.business_id, source.trigger_at, source.system_task_type,
source.success_num, source.fail_num, source.fail_reason, source.stop_num, source.stop_reason,
source.cancel_num, source.cancel_reason);
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.businessId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
)
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE job_summary
SET success_num = src.success_num,
fail_num = src.fail_num,
fail_reason = src.fail_reason,
stop_num = src.stop_num,
stop_reason = src.stop_reason,
cancel_num = src.cancel_num,
cancel_reason = src.cancel_reason
FROM job_summary AS dest
JOIN (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason,
#{item.triggerAt} AS trigger_at,
#{item.businessId} AS business_id
</foreach>
) AS src
ON (dest.trigger_at = src.trigger_at AND dest.business_id = src.business_id)
</update>
<select id="jobLineList"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardLineResponseDO">
SELECT

View File

@ -15,41 +15,55 @@
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
</resultMap>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
MERGE INTO retry_summary AS target
USING (
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.sceneName},
#{item.triggerAt},
#{item.runningNum},
#{item.finishNum},
#{item.maxCountNum},
#{item.suspendNum}
)
</foreach>
) AS source (namespace_id, group_name, scene_name, trigger_at,
running_num, finish_num, max_count_num, suspend_num)
ON target.namespace_id = source.namespace_id
AND target.group_name = source.group_name
AND target.scene_name = source.scene_name
AND target.trigger_at = source.trigger_at
WHEN MATCHED THEN
UPDATE SET
target.running_num = source.running_num,
target.finish_num = source.finish_num,
target.max_count_num = source.max_count_num,
target.suspend_num = source.suspend_num
WHEN NOT MATCHED THEN
INSERT (namespace_id, group_name, scene_name, trigger_at,
running_num, finish_num, max_count_num, suspend_num)
VALUES (source.namespace_id, source.group_name, source.scene_name, source.trigger_at,
source.running_num, source.finish_num, source.max_count_num, source.suspend_num);
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.namespaceId},
#{item.groupName},
#{item.businessId},
#{item.triggerAt},
#{item.systemTaskType},
#{item.successNum},
#{item.failNum},
#{item.failReason},
#{item.stopNum},
#{item.stopReason},
#{item.cancelNum},
#{item.cancelReason}
)
</foreach>
</insert>
<update id="batchUpdate" parameterType="java.util.List">
UPDATE job_summary
SET success_num = src.success_num,
fail_num = src.fail_num,
fail_reason = src.fail_reason,
stop_num = src.stop_num,
stop_reason = src.stop_reason,
cancel_num = src.cancel_num,
cancel_reason = src.cancel_reason
FROM job_summary AS dest
JOIN (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.successNum} AS success_num,
#{item.failNum} AS fail_num,
#{item.failReason} AS fail_reason,
#{item.stopNum} AS stop_num,
#{item.stopReason} AS stop_reason,
#{item.cancelNum} AS cancel_num,
#{item.cancelReason} AS cancel_reason,
#{item.triggerAt} AS trigger_at,
#{item.businessId} AS business_id
</foreach>
) AS src
ON (dest.trigger_at = src.trigger_at AND dest.business_id = src.business_id)
</update>
<select id="retryTask"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$RetryTask">
SELECT

View File

@ -20,33 +20,43 @@
id, namespace_id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
</sql>
<insert id="insertOrUpdate" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
MERGE INTO server_node AS target
USING (
VALUES
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO server_node (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
VALUES
<foreach collection="records" item="item" index="index" separator=",">
(
#{item.namespaceId,jdbcType=VARCHAR}, #{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR}, #{item.hostIp,jdbcType=VARCHAR}, #{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP}, #{item.nodeType,jdbcType=TINYINT}, #{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR}, #{item.createDt,jdbcType=TIMESTAMP}
#{item.namespaceId,jdbcType=VARCHAR},
#{item.groupName,jdbcType=VARCHAR},
#{item.hostId,jdbcType=VARCHAR},
#{item.hostIp,jdbcType=VARCHAR},
#{item.hostPort,jdbcType=INTEGER},
#{item.expireAt,jdbcType=TIMESTAMP},
#{item.nodeType,jdbcType=TINYINT},
#{item.extAttrs,jdbcType=VARCHAR},
#{item.contextPath,jdbcType=VARCHAR},
#{item.createDt,jdbcType=TIMESTAMP}
)
</foreach>
) AS source (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt)
ON target.namespace_id = source.namespace_id
AND target.group_name = source.group_name
AND target.host_id = source.host_id
WHEN MATCHED THEN
UPDATE SET
target.expire_at = source.expire_at, target.update_dt = GETDATE()
WHEN NOT MATCHED THEN
INSERT (namespace_id, group_name, host_id, host_ip, host_port,
expire_at, node_type, ext_attrs, context_path, create_dt, update_dt)
VALUES (source.namespace_id, source.group_name, source.host_id, source.host_ip, source.host_port,
source.expire_at, source.node_type, source.ext_attrs, source.context_path, source.create_dt, GETDATE());
</insert>
<update id="batchUpdateExpireAt" parameterType="java.util.List">
UPDATE server_node
SET expire_at = src.expire_at,
context_path = src.context_path
FROM server_node AS dest
JOIN (
<foreach collection="list" item="item" index="index" separator=" UNION ALL ">
SELECT
#{item.expireAt} AS expire_at,
#{item.contextPath} AS context_path,
#{item.hostId} AS host_id,
#{item.hostIp} AS host_ip
</foreach>
) AS src
ON (dest.host_id = src.host_id AND dest.host_ip = src.host_ip)
</update>
<select id="countActivePod"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
SELECT