You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

4.0 KiB

drop table if exists rcs_task_biz;
create table rcs_task_biz
(
  biz_task_id           bigint      not null,
  biz_type              varchar(10) not null comment '任务类型' default 'carry',
  lpn                   varchar(50) not null comment '托盘ID',
  priority              integer     not null comment '任务优先级',
  task_from             varchar(50) not null comment '任务起始点',
  task_to               varchar(50) not null comment '任务目标点',
  allocated_executor_id varchar(50)                             default 'N/A' comment '系统分配的执行器ID',
  biz_task_payload      varchar(3000) comment '任务负载信息',
  biz_task_error_info   varchar(500)                            default 'N/A' comment '异常提示信息',
  biz_task_description  varchar(500)                            default 'N/A' comment '任务描述',
  biz_task_status       varchar(10)                             default 'pending' comment '任务状态',
  create_at             timestamp    not null comment '创建时间',
  create_by             varchar(50) not null comment '创建人',
  update_at             timestamp    not null comment '更新时间',
  update_by             varchar(50) not null comment '更新人',
  primary key (biz_task_id)
);

drop table if exists rcs_task_plan;
create table rcs_task_plan
(
  plan_task_id          bigint        not null comment '规划ID',
  biz_task_id           bigint        not null comment '业务任务ID',
  plan_type             varchar(10)   not null comment '规划类型' default 'carry',
  executor_id           varchar(50)   not null comment '执行器ID',
  seq                   integer       not null comment '规划序号',
  plan_task_payload     varchar(3000) not null                    default 'N/A' comment '任务负载信息',
  plan_task_status      varchar(10)   not null                    default 'N/A' comment '规划状态',
  plan_task_error_info  varchar(500)  not null                    default 'N/A' comment '异常提示信息',
  plan_task_description varchar(500)  not null                    default 'N/A' comment '任务描述',
  create_at             timestamp     not null comment '创建时间',
  create_by             varchar(50)   not null comment '创建人',
  update_at             timestamp     not null comment '更新时间',
  update_by             varchar(50)   not null comment '更新人',
  primary key (plan_task_id)
);
create index idx_task_plan_biz_task_id on rcs_task_plan (biz_task_id);

drop table if exists rcs_task_device;
create table rcs_task_device
(
  device_task_id          bigint        not null comment '设备任务ID',
  plan_task_id            bigint        not null comment '规划ID',
  biz_task_id             bigint        not null comment '业务任务ID',
  device_type             varchar(50)   not null comment '设备类型',
  device_item_id          varchar(50)   not null comment '执行器ID',
  seq                     integer       not null comment '执行序号',
  packet_type             varchar(10)   not null comment '报文类型',
  packet_end_point        varchar(50)   not null comment '报文目标点',
  packet_payload          varchar(50)   not null comment '报文内容',
  device_task_payload     varchar(3000) not null default 'N/A' comment '任务负载信息',
  device_task_status      varchar(10)   not null default 'N/A' comment '执行状态',
  device_task_error_info  varchar(500)  not null default 'N/A' comment '异常提示信息',
  device_task_description varchar(500)  not null default 'N/A' comment '任务描述',
  create_at               timestamp     not null comment '创建时间',
  create_by               varchar(50)   not null comment '创建人',
  update_at               timestamp     not null comment '更新时间',
  update_by               varchar(50)   not null comment '更新人',
  primary key (device_task_id)
);
create index idx_rcs_task_device1 on rcs_task_device (biz_task_id);
create index idx_rcs_task_device2 on rcs_task_device (plan_task_id);