数据采集提测.sql 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /** 字典表-编码类型表 **/
  2. CREATE TABLE `da_dim_sdt_type` (
  3. `id` varchar(36) NOT NULL COMMENT '主键值为uuid',
  4. `sdt_type_code` varchar(225) DEFAULT '-1' COMMENT '类型编码。',
  5. `sdt_type_name` varchar(100) DEFAULT NULL COMMENT '类型名称',
  6. `sdt_type_desc` text COMMENT '类型描述',
  7. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  8. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  9. PRIMARY KEY (`id`)
  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='编码类型表';
  11. /** 字典表-编码表 **/
  12. CREATE TABLE `da_dim_sdt_code` (
  13. `id` varchar(36) NOT NULL COMMENT '主键值为uuid',
  14. `sdt_type_code` varchar(225) DEFAULT NULL COMMENT '类型编码。',
  15. `sdt_code` varchar(100) DEFAULT NULL COMMENT '编码',
  16. `sdt_name` text COMMENT '编码名称',
  17. `sdt_desc` text COMMENT '编码描述',
  18. `sdt_order` int(11) DEFAULT '-1' COMMENT '排序字段',
  19. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  20. PRIMARY KEY (`id`)
  21. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='编码表';
  22. /** 初始化字段表数据 **/
  23. insert into da_dim_sdt_type (id, sdt_type_code, sdt_type_name, sdt_type_desc, create_time, update_time)
  24. values (uuid(), 'period_type', '周期类型', '周期类型', now(), now());
  25. insert into da_dim_sdt_type (id, sdt_type_code, sdt_type_name, sdt_type_desc, create_time, update_time)
  26. values (uuid(), 'task_status', '任务状态', '任务状态', now(), now());
  27. insert into da_dim_sdt_type (id, sdt_type_code, sdt_type_name, sdt_type_desc, create_time, update_time)
  28. values (uuid(), 'run_status', '运行状态', '运行状态', now(), now());
  29. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  30. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='period_type'), '5', '秒', '秒', '6', now());
  31. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  32. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='period_type'), '4', '分', '分', '5', now());
  33. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  34. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='period_type'), '3', '时', '时', '4', now());
  35. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  36. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='period_type'), '2', '日', '日', '3', now());
  37. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  38. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='period_type'), '1', '月', '月', '2', now());
  39. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  40. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='period_type'), '0', '自定义', '自定义', '1', now());
  41. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  42. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='task_status'), '1', '启用', '启用', '1', now());
  43. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  44. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='task_status'), '2', '停用', '停用', '2', now());
  45. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  46. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='run_status'), '0', '未运行', '未运行', '1', now());
  47. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  48. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='run_status'), '1', '等待运行', '等待运行', '2', now());
  49. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  50. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='run_status'), '2', '运行中', '运行中', '3', now());
  51. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  52. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='run_status'), '3', '运行完成', '运行完成', '4', now());
  53. insert into da_dim_sdt_code (id, sdt_type_code, sdt_code, sdt_name, sdt_desc, sdt_order, create_time)
  54. values (uuid(), (select id from da_dim_sdt_type where sdt_type_code='run_status'), '4', '运行失败', '运行失败', '5', now());
  55. /** 数据采集任务信息表 **/
  56. CREATE TABLE `da_info_data_collection_task` (
  57. `id` varchar(36) NOT NULL COMMENT 'uuid主键,任务id',
  58. `task_name` varchar(50) NOT NULL COMMENT '任务名称',
  59. `period_type` varchar(4) NOT NULL COMMENT '周期类型,0:自定义,1:月,2:日,3:时,4:分,5:秒',
  60. `schedule_offset` varchar(4) NOT NULL DEFAULT '-1' COMMENT '调度偏移量',
  61. `task_status` varchar(4) NOT NULL COMMENT '任务状态,1:启用,2:停用',
  62. `run_status` varchar(4) NOT NULL COMMENT '任务运行状态,0:未运行,1:等待运行,2:运行中,3:运行完成,4:运行失败',
  63. `task_cron` varchar(50) NOT NULL COMMENT '任务定时cron表达式',
  64. `next_run_date` datetime DEFAULT NULL COMMENT '下次运行时间',
  65. `ddl_sql` text NOT NULL COMMENT '数据采集ddl语句',
  66. `source_database_id` varchar(36) NOT NULL COMMENT '外键,源库id',
  67. `source_table_id` varchar(50) NOT NULL COMMENT '源表id',
  68. `source_table_name` varchar(50) NOT NULL COMMENT '源库表名',
  69. `target_database_id` varchar(36) NOT NULL COMMENT '外键,目标库id',
  70. `target_table_id` varchar(50) NOT NULL COMMENT '目标表id',
  71. `target_table_name` varchar(50) NOT NULL COMMENT '目标库表名',
  72. `user_id` varchar(30) NOT NULL COMMENT '操作人id',
  73. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  74. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  75. PRIMARY KEY (`id`)
  76. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据采集任务信息表';