-- ---------------------------- -- 15、定时任务调度表 -- ---------------------------- drop table if exists sys_job; create table sys_job ( job_id bigserial primary key, -- 使用 bigserial 实现自增 job_name varchar(64) default '', -- 任务名称 job_group varchar(64) default 'DEFAULT', -- 任务组名 invoke_target varchar(500) not null, -- 调用目标字符串 cron_expression varchar(255) default '', -- cron执行表达式 misfire_policy varchar(20) default '3', -- 计划执行错误策略(1立即执行 2执行一次 3放弃执行) concurrent char(1) default '1', -- 是否并发执行(0允许 1禁止) status char(1) default '0', -- 状态(0正常 1暂停) create_by varchar(64) default '', -- 创建者 create_time timestamp, -- 创建时间 update_by varchar(64) default '', -- 更新者 update_time timestamp, -- 更新时间 remark varchar(500) default '' -- 备注信息 ); -- 表注释 comment on table sys_job is '定时任务调度表'; -- 字段注释 comment on column sys_job.job_id is '任务ID'; comment on column sys_job.job_name is '任务名称'; comment on column sys_job.job_group is '任务组名'; comment on column sys_job.invoke_target is '调用目标字符串'; comment on column sys_job.cron_expression is 'cron执行表达式'; comment on column sys_job.misfire_policy is '计划执行错误策略(1立即执行 2执行一次 3放弃执行)'; comment on column sys_job.concurrent is '是否并发执行(0允许 1禁止)'; comment on column sys_job.status is '状态(0正常 1暂停)'; comment on column sys_job.create_by is '创建者'; comment on column sys_job.create_time is '创建时间'; comment on column sys_job.update_by is '更新者'; comment on column sys_job.update_time is '更新时间'; comment on column sys_job.remark is '备注信息'; -- 插入数据 insert into sys_job (job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, update_by, update_time, remark) values ('系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', current_timestamp, '', null, ''), ('系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', current_timestamp, '', null, ''), ('系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', current_timestamp, '', null, '');