数字人管理平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

556 lines
37 KiB

  1. CREATE DATABASE IF NOT EXISTS `xy-cloud1` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
  2. SET NAMES utf8mb4;
  3. SET FOREIGN_KEY_CHECKS = 0;
  4. #
  5. USE `xy-cloud1`;
  6. SET NAMES utf8mb4;
  7. -- ----------------------------
  8. -- 1、部门表
  9. -- ----------------------------
  10. drop table if exists sys_dept;
  11. create table sys_dept (
  12. id bigint not null comment '部门id',
  13. parent_id bigint default 0 comment '父部门id',
  14. code varchar(64) default null comment '部门编码',
  15. name varchar(30) default '' comment '部门名称',
  16. level int not null comment '树层级',
  17. ancestors varchar(500) default '' comment '祖级列表',
  18. leader varchar(20) default '' comment '负责人',
  19. phone varchar(11) default '' comment '联系电话',
  20. email varchar(50) default '' comment '邮箱',
  21. sort int unsigned not null default 0 comment '显示顺序',
  22. status char(1) not null default '0' comment '状态(0正常 1停用)',
  23. remark varchar(200) default null comment '备注',
  24. create_by bigint default null comment '创建者',
  25. create_time datetime default current_timestamp comment '创建时间',
  26. update_by bigint default null comment '更新者',
  27. update_time datetime on update current_timestamp comment '更新时间',
  28. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  29. tenant_id bigint not null comment '租户Id',
  30. primary key (id)
  31. ) engine = innodb comment = '部门信息表';
  32. -- ----------------------------
  33. -- 初始化-部门表数据
  34. -- ----------------------------
  35. insert into sys_dept (id, code, parent_id, level, ancestors, name, tenant_id)
  36. values (99, '99', 0, 1, '0', '雪忆科技', 1),
  37. (100, '100', 0, 1, '0', '雪忆科技', 2),
  38. (101, '101', 100, 2, '0,100', '深圳总公司', 2),
  39. (102, '102', 100, 2, '0,100', '长沙分公司', 2),
  40. (103, '103', 101, 3, '0,100,101', '研发部门', 2),
  41. (104, '104', 101, 3, '0,100,101', '市场部门', 2),
  42. (105, '105', 101, 3, '0,100,101', '测试部门', 2),
  43. (106, '106', 101, 3, '0,100,101', '财务部门', 2),
  44. (107, '107', 101, 3, '0,100,101', '运维部门', 2),
  45. (108, '108', 102, 3, '0,100,102', '市场部门', 2),
  46. (109, '109', 102, 3, '0,100,102', '财务部门', 2);
  47. -- ----------------------------
  48. -- 2、岗位信息表
  49. -- ----------------------------
  50. drop table if exists sys_post;
  51. create table sys_post (
  52. id bigint not null comment '岗位Id',
  53. dept_id bigint not null comment '部门Id',
  54. code varchar(64) default null comment '岗位编码',
  55. name varchar(50) not null comment '岗位名称',
  56. sort int unsigned not null default 0 comment '显示顺序',
  57. status char(1) not null default '0' comment '状态(0正常 1停用)',
  58. remark varchar(200) default null comment '备注',
  59. create_by bigint default null comment '创建者',
  60. create_time datetime default current_timestamp comment '创建时间',
  61. update_by bigint default null comment '更新者',
  62. update_time datetime on update current_timestamp comment '更新时间',
  63. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  64. tenant_id bigint not null comment '租户Id',
  65. primary key (id)
  66. ) engine = innodb comment = '岗位信息表';
  67. -- ----------------------------
  68. -- 初始化-岗位信息表数据
  69. -- ----------------------------
  70. insert into sys_post (id, dept_id, code, name, tenant_id)
  71. values (1, 99, 'ceo', '超级管理员', 1),
  72. (2, 100, 'ceo', '董事长', 2),
  73. (3, 100, 'se', '项目经理', 2),
  74. (4, 100, 'hr', '人力资源', 2),
  75. (5, 100, 'user', '普通员工', 2);
  76. -- ----------------------------
  77. -- 3、用户信息表
  78. -- ----------------------------
  79. drop table if exists sys_user;
  80. create table sys_user (
  81. id bigint not null comment '用户Id',
  82. code varchar(64) default null comment '用户编码',
  83. user_name varchar(30) not null comment '用户账号',
  84. nick_name varchar(30) not null comment '用户昵称',
  85. user_type varchar(2) default '01' comment '用户类型(00超管用户 01普通用户)',
  86. phone varchar(11) default '' comment '手机号码',
  87. email varchar(50) default '' comment '用户邮箱',
  88. sex char(1) default '2' comment '用户性别(0男 1女 2保密)',
  89. avatar varchar(100) default '' comment '头像地址',
  90. profile varchar(100) default '这个人很懒,暂未留下什么' comment '个人简介',
  91. password varchar(100) default '' comment '密码',
  92. login_ip varchar(128) default '' comment '最后登录IP',
  93. login_date datetime comment '最后登录时间',
  94. sort int unsigned not null default 0 comment '显示顺序',
  95. status char(1) not null default '0' comment '状态(0正常 1停用)',
  96. remark varchar(200) default null comment '备注',
  97. create_by bigint default null comment '创建者',
  98. create_time datetime default current_timestamp comment '创建时间',
  99. update_by bigint default null comment '更新者',
  100. update_time datetime on update current_timestamp comment '更新时间',
  101. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  102. tenant_id bigint not null comment '租户Id',
  103. primary key (id)
  104. ) engine = innodb comment = '用户信息表';
  105. -- ----------------------------
  106. -- 初始化-用户信息表数据
  107. -- ----------------------------
  108. insert into sys_user (id, code, user_name, nick_name,user_type, avatar, password, remark, tenant_id)
  109. values (1, '001', 'admin', 'admin', '00', 'https://images.gitee.com/uploads/images/2021/1101/141155_f3dfce1d_7382127.jpeg', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '超级管理员', 1),
  110. (2, '001', 'admin', 'admin', '00', 'https://images.gitee.com/uploads/images/2021/1101/141155_f3dfce1d_7382127.jpeg', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '系统管理员', 2),
  111. (3, '002', 'xy', 'xy', '01', 'https://images.gitee.com/uploads/images/2021/1101/141155_f3dfce1d_7382127.jpeg', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '管理员', 2);
  112. -- ----------------------------
  113. -- 4、用户-岗位关联表
  114. -- ----------------------------
  115. drop table if exists sys_user_post_merge;
  116. create table sys_user_post_merge (
  117. id bigint not null comment 'id',
  118. user_id bigint not null comment '用户Id',
  119. post_id bigint not null comment '职位Id',
  120. tenant_id bigint not null comment '租户Id',
  121. primary key (id),
  122. unique (user_id, post_id)
  123. ) engine = innodb comment = '用户-岗位关联表';
  124. -- ----------------------------
  125. -- 初始化-用户-岗位关联表数据
  126. -- ----------------------------
  127. insert into sys_user_post_merge (id, user_id, post_id, tenant_id)
  128. values (1, 1, 1, 1),
  129. (2, 2, 2, 2),
  130. (3, 3, 3, 2);
  131. -- ----------------------------
  132. -- 5、角色信息表
  133. -- ----------------------------
  134. drop table if exists sys_role;
  135. create table sys_role (
  136. id bigint not null comment '角色Id',
  137. code varchar(64) default null comment '角色编码',
  138. name varchar(30) not null comment '角色名称',
  139. role_key varchar(100) default null comment '角色权限字符串',
  140. data_scope char(1) default '1' comment '数据范围(1全部数据权限 2自定数据权限 3本部门数据权限 4本部门及以下数据权限 5本岗位数据权限 6仅本人数据权限)',
  141. sort int unsigned not null default 0 comment '显示顺序',
  142. status char(1) not null default '0' comment '状态(0正常 1停用)',
  143. remark varchar(200) default null comment '备注',
  144. create_by bigint default null comment '创建者',
  145. create_time datetime default current_timestamp comment '创建时间',
  146. update_by bigint default null comment '更新者',
  147. update_time datetime on update current_timestamp comment '更新时间',
  148. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  149. tenant_id bigint not null comment '租户Id',
  150. primary key (id)
  151. ) engine = innodb comment = '角色信息表';
  152. -- ----------------------------
  153. -- 初始化-角色信息表数据
  154. -- ----------------------------
  155. insert into sys_role (id, tenant_id, code, name, role_key, remark)
  156. values (1, 1, '001', '超级管理员', 'admin', '超级管理员'),
  157. (2, 1, '002', '管理员', 'common', '普通角色');
  158. -- ----------------------------
  159. -- 6、租户和模块关联表
  160. -- ----------------------------
  161. drop table if exists sys_tenant_module_merge;
  162. create table sys_tenant_module_merge (
  163. id bigint not null comment 'id',
  164. module_id bigint not null comment '模块Id',
  165. tenant_id bigint not null comment '租户Id',
  166. primary key (id),
  167. unique (module_id, tenant_id)
  168. ) engine = innodb comment = '租户和模块关联表';
  169. -- ----------------------------
  170. -- 初始化-租户和模块关联表数据
  171. -- ----------------------------
  172. insert into sys_tenant_module_merge (id, module_id, tenant_id)
  173. values (1501811101547732994, 1, 2);
  174. -- ----------------------------
  175. -- 7、租户和菜单关联表
  176. -- ----------------------------
  177. drop table if exists sys_tenant_menu_merge;
  178. create table sys_tenant_menu_merge (
  179. id bigint not null comment 'id',
  180. menu_id bigint not null comment '菜单Id',
  181. tenant_id bigint not null comment '租户Id',
  182. primary key (id),
  183. unique (menu_id, tenant_id)
  184. ) engine = innodb comment = '租户和菜单关联表';
  185. -- ----------------------------
  186. -- 初始化-租户和菜单关联表数据
  187. -- ----------------------------
  188. insert into sys_tenant_menu_merge (id, menu_id, tenant_id)
  189. values (1501811101614841858, 13000000, 2),
  190. (1501811101614841863, 13010000, 2),
  191. (1501811101614841873, 13010100, 2),
  192. (1501811101614841874, 13010200, 2),
  193. (1501811101614841875, 13010300, 2),
  194. (1501811101614841876, 13010400, 2),
  195. (1501811101614841877, 13010500, 2),
  196. (1501811101614841878, 13010600, 2),
  197. (1501811101614841879, 13010700, 2),
  198. (1501811101614841864, 13020000, 2),
  199. (1501811101614841880, 13020100, 2),
  200. (1501811101614841881, 13020200, 2),
  201. (1501811101614841882, 13020300, 2),
  202. (1501811101614841883, 13020400, 2),
  203. (1501811101614841884, 13020500, 2),
  204. (1501811101614841885, 13020600, 2),
  205. (1501811101614841886, 13020700, 2),
  206. (1501811101614841865, 13030000, 2),
  207. (1501811101614841887, 13030100, 2),
  208. (1501811101614841888, 13030200, 2),
  209. (1501811101614841889, 13030300, 2),
  210. (1501811101614841890, 13030400, 2),
  211. (1501811101614841891, 13030500, 2),
  212. (1501811101614841892, 13030600, 2),
  213. (1501811101614841893, 13030700, 2),
  214. (1501811101614841859, 14000000, 2),
  215. (1501811101614841866, 14010000, 2),
  216. (1501811101614841894, 14010100, 2),
  217. (1501811101614841895, 14010200, 2),
  218. (1501811101614841896, 14010300, 2),
  219. (1501811101614841897, 14010400, 2),
  220. (1501811101614841898, 14010500, 2),
  221. (1501811101614841899, 14010600, 2),
  222. (1501811101614841900, 14010700, 2),
  223. (1501811101614841867, 14020000, 2),
  224. (1501811101614841901, 14020100, 2),
  225. (1501811101614841902, 14020200, 2),
  226. (1501811101614841903, 14020300, 2),
  227. (1501811101614841904, 14020400, 2),
  228. (1501811101614841905, 14020500, 2),
  229. (1501811101614841906, 14020600, 2),
  230. (1501811101614841907, 14020700, 2),
  231. (1501811101614841868, 14030000, 2),
  232. (1501811101614841908, 14030100, 2),
  233. (1501811101614841909, 14030200, 2),
  234. (1501811101614841910, 14030300, 2),
  235. (1501811101614841911, 14030400, 2),
  236. (1501811101614841912, 14030500, 2),
  237. (1501811101614841913, 14030600, 2),
  238. (1501811101614841914, 14030700, 2),
  239. (1501811101614841915, 14030800, 2),
  240. (1501811101614841860, 15000000, 2),
  241. (1501811101614841869, 15010000, 2),
  242. (1501811101614841916, 15010100, 2),
  243. (1501811101614841917, 15010200, 2),
  244. (1501811101614841918, 15010300, 2),
  245. (1501811101614841919, 15010400, 2),
  246. (1501811101614841920, 15010500, 2),
  247. (1501811101614841921, 15010600, 2),
  248. (1501811101614841922, 15010700, 2),
  249. (1501811101614841861, 16000000, 2),
  250. (1501811101614841870, 16010000, 2),
  251. (1501811101614841923, 16010100, 2),
  252. (1501811101614841924, 16010200, 2),
  253. (1501811101614841925, 16010300, 2),
  254. (1501811101614841926, 16010400, 2),
  255. (1501811101614841927, 16010500, 2),
  256. (1501811101614841928, 16010600, 2),
  257. (1501811101614841929, 16010700, 2),
  258. (1501811101614841930, 16010800, 2),
  259. (1501811101614841862, 17000000, 2),
  260. (1501811101614841871, 17010000, 2),
  261. (1501811101614841931, 17010100, 2),
  262. (1501811101614841872, 17020000, 2),
  263. (1501811101614841932, 17020100, 2),
  264. (1501811101614841937, 17020101, 2),
  265. (1501811101614841938, 17020102, 2),
  266. (1501811101614841933, 17020200, 2),
  267. (1501811101614841934, 17020201, 2),
  268. (1501811101614841935, 17020202, 2),
  269. (1501811101614841936, 17020203, 2);
  270. -- ----------------------------
  271. -- 8、角色和模块关联表
  272. -- ----------------------------
  273. drop table if exists sys_role_module_merge;
  274. create table sys_role_module_merge (
  275. id bigint not null comment 'id',
  276. role_id bigint not null comment '角色Id',
  277. module_id bigint not null comment '模块Id',
  278. tenant_id bigint not null comment '租户Id',
  279. primary key (id),
  280. unique (role_id, module_id)
  281. ) engine = innodb comment = '角色和模块关联表';
  282. -- ----------------------------
  283. -- 9、角色和菜单关联表
  284. -- ----------------------------
  285. drop table if exists sys_role_menu_merge;
  286. create table sys_role_menu_merge (
  287. id bigint not null comment 'id',
  288. role_id bigint not null comment '角色Id',
  289. menu_id bigint not null comment '菜单Id',
  290. tenant_id bigint not null comment '租户Id',
  291. primary key (id),
  292. unique (role_id, menu_id)
  293. ) engine = innodb comment = '角色和菜单关联表';
  294. -- ----------------------------
  295. -- 10、角色和部门关联表(权限范围)
  296. -- ----------------------------
  297. drop table if exists sys_role_dept_merge;
  298. create table sys_role_dept_merge (
  299. id bigint not null comment 'id',
  300. role_id bigint not null comment '角色Id',
  301. dept_id bigint not null comment '部门Id',
  302. tenant_id bigint not null comment '租户Id',
  303. primary key(id),
  304. unique (role_id, dept_id)
  305. ) engine = innodb comment = '角色和部门-岗位关联表';
  306. -- ----------------------------
  307. -- 11、角色和岗位关联表(权限范围)
  308. -- ----------------------------
  309. drop table if exists sys_role_post_merge;
  310. create table sys_role_post_merge (
  311. id bigint not null comment 'id',
  312. role_id bigint not null comment '角色Id',
  313. post_id bigint not null comment '岗位Id',
  314. tenant_id bigint not null comment '租户Id',
  315. primary key(id),
  316. unique (role_id, post_id)
  317. ) engine = innodb comment = '角色和部门-岗位关联表';
  318. -- ----------------------------
  319. -- 12、组织和角色关联表(角色绑定)
  320. -- ----------------------------
  321. drop table if exists sys_organize_role_merge;
  322. create table sys_organize_role_merge (
  323. id bigint not null auto_increment comment 'id',
  324. dept_id bigint default null comment '部门id',
  325. post_id bigint default null comment '岗位id',
  326. user_id bigint default null comment '用户id',
  327. role_id bigint not null comment '角色Id',
  328. tenant_id bigint not null comment '租户Id',
  329. primary key(id),
  330. unique (dept_id, post_id, user_id, role_id)
  331. ) engine = innodb auto_increment=1 comment = '组织和角色关联表';
  332. -- ----------------------------
  333. -- 13、素材信息表|管理素材信息
  334. -- ----------------------------
  335. drop table if exists xy_material;
  336. create table xy_material (
  337. id bigint not null comment '素材Id',
  338. folder_id bigint not null default 0 comment '分类Id',
  339. nick varchar(100) not null comment '素材昵称',
  340. name varchar(100) not null comment '素材名称',
  341. original_name varchar(100) not null comment '原图名称',
  342. url varchar(200) not null comment '素材地址',
  343. original_url varchar(200) not null comment '原图地址',
  344. size decimal(8,4) not null comment '素材大小',
  345. type char(1) not null default '0' comment '素材类型(0默认素材 1系统素材)',
  346. sort int unsigned not null default 0 comment '显示顺序',
  347. status char(1) not null default '0' comment '状态(0正常 1停用)',
  348. create_by bigint default null comment '创建者',
  349. create_time datetime default current_timestamp comment '创建时间',
  350. update_by bigint default null comment '更新者',
  351. update_time datetime on update current_timestamp comment '更新时间',
  352. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  353. tenant_id bigint not null comment '租户Id',
  354. primary key (id)
  355. ) engine = innodb comment = '素材信息表';
  356. -- ----------------------------
  357. -- 14、素材分类信息表
  358. -- ----------------------------
  359. drop table if exists xy_material_folder;
  360. create table xy_material_folder (
  361. id bigint not null comment '分类Id',
  362. parent_id bigint not null default 0 comment '父类Id',
  363. name varchar(100) not null comment '分类名称',
  364. level int not null comment '树层级',
  365. ancestors varchar(500) default '' comment '祖级列表',
  366. type char(1) not null default '0' comment '分类类型(0默认文件夹 1系统文件夹)',
  367. sort int unsigned not null default 0 comment '显示顺序',
  368. status char(1) not null default '0' comment '状态(0正常 1停用)',
  369. create_by bigint default null comment '创建者',
  370. create_time datetime default current_timestamp comment '创建时间',
  371. update_by bigint default null comment '更新者',
  372. update_time datetime on update current_timestamp comment '更新时间',
  373. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  374. tenant_id bigint not null comment '租户Id',
  375. primary key (id)
  376. ) engine = innodb comment = '素材分类信息表';
  377. -- ----------------------------
  378. -- 15、操作日志记录
  379. -- ----------------------------
  380. drop table if exists sys_operate_log;
  381. create table sys_operate_log (
  382. id bigint not null auto_increment comment '日志主键',
  383. title varchar(50) default '' comment '模块标题',
  384. business_type char(2) default '00' comment '业务类型(0其它 1新增 2修改 3删除)',
  385. method varchar(100) default '' comment '方法名称',
  386. request_method varchar(10) default '' comment '请求方式',
  387. operate_type char(2) default '00' comment '操作类别(00其它 01后台 02手机端)',
  388. user_id bigint not null default -2 comment '操作人员',
  389. user_name varchar(50) default null comment '操作人员账号',
  390. user_nick varchar(50) default null comment '操作人员名称',
  391. url varchar(255) default '' comment '请求URL',
  392. ip varchar(128) default '' comment '主机地址',
  393. param varchar(2000) default '' comment '请求参数',
  394. location varchar(255) default '' comment '操作地点',
  395. json_result varchar(2000) default '' comment '返回参数',
  396. status char(1) default 0 comment '操作状态(0正常 1异常)',
  397. error_msg varchar(2000) default '' comment '错误消息',
  398. cost_time bigint default 0 comment '消耗时间',
  399. operate_time datetime default current_timestamp comment '操作时间',
  400. del_time datetime on update current_timestamp comment '删除时间',
  401. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  402. tenant_id bigint not null comment '租户Id',
  403. primary key (id),
  404. key idx_sys_operate_log_bt (business_type),
  405. key idx_sys_operate_log_s (status),
  406. key idx_sys_operate_log_ot (operate_time)
  407. ) engine = innodb auto_increment=100 comment = '操作日志记录';
  408. -- ----------------------------
  409. -- 16、系统访问记录
  410. -- ----------------------------
  411. drop table if exists sys_login_log;
  412. create table sys_login_log (
  413. id bigint not null auto_increment comment '访问Id',
  414. enterprise_name varchar(50) default '' comment '企业账号',
  415. user_id bigint not null default -2 comment '用户Id',
  416. user_name varchar(50) default '' comment '用户账号',
  417. user_nick varchar(50) default '' comment '用户名称',
  418. ipaddr varchar(128) default '' comment '登录IP地址',
  419. status char(1) default '0' comment '登录状态(0成功 1失败)',
  420. msg varchar(255) default '' comment '提示信息',
  421. access_time datetime default current_timestamp comment '访问时间',
  422. del_time datetime on update current_timestamp comment '删除时间',
  423. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  424. tenant_id bigint not null comment '租户Id',
  425. primary key (id),
  426. key idx_sys_login_log_s (status),
  427. key idx_sys_login_log_lt (access_time)
  428. ) engine = innodb auto_increment=100 comment = '系统访问记录';
  429. -- ----------------------------
  430. -- 17、通知公告表
  431. -- ----------------------------
  432. drop table if exists sys_notice;
  433. create table sys_notice (
  434. id bigint not null comment '公告Id',
  435. name varchar(50) not null comment '公告标题',
  436. type char(1) not null default '0' comment '公告类型(0通知 1公告)',
  437. content longblob default null comment '公告内容',
  438. status char(1) default '0' comment '公告状态(0待发送 1已发送 2已关闭 3发送失败 4发送异常)',
  439. remark varchar(200) default null comment '备注',
  440. create_by bigint default null comment '创建者',
  441. create_time datetime default current_timestamp comment '创建时间',
  442. update_by bigint default null comment '更新者',
  443. update_time datetime on update current_timestamp comment '更新时间',
  444. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  445. tenant_id bigint not null comment '租户Id',
  446. primary key (id)
  447. ) engine = innodb comment = '通知公告表';
  448. -- ----------------------------
  449. -- 18、通知公告记录表
  450. -- ----------------------------
  451. drop table if exists sys_notice_log;
  452. create table sys_notice_log (
  453. id bigint not null comment 'id',
  454. notice_id bigint not null comment '公告Id',
  455. user_id bigint not null comment '用户Id',
  456. receive_status char(1) not null comment '发送状态(0成功 1失败)',
  457. status char(1) default '0' comment '阅读状态(0未读 1已读)',
  458. remark varchar(200) default null comment '备注',
  459. create_time datetime default current_timestamp comment '创建时间',
  460. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  461. tenant_id bigint not null comment '租户Id',
  462. primary key (id)
  463. ) engine = innodb comment = '通知公告记录表';
  464. -- ----------------------------
  465. -- 19、定时任务调度日志表
  466. -- ----------------------------
  467. drop table if exists sys_job_log;
  468. create table sys_job_log (
  469. id bigint not null auto_increment comment '任务日志Id',
  470. job_id bigint not null comment '任务Id',
  471. name varchar(64) not null comment '任务名称',
  472. job_group varchar(64) not null comment '任务组名',
  473. invoke_target varchar(500) not null comment '调用目标字符串',
  474. invoke_tenant varchar(500) not null comment '调用租户字符串',
  475. job_message varchar(500) comment '日志信息',
  476. status char(1) not null default '0' comment '执行状态(0正常 1失败)',
  477. exception_info varchar(2000) default '' comment '异常信息',
  478. create_time datetime default current_timestamp comment '创建时间',
  479. del_time datetime on update current_timestamp comment '删除时间',
  480. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  481. tenant_id bigint not null comment '租户Id',
  482. primary key (id)
  483. ) engine = innodb comment = '定时任务调度日志表';
  484. -- ----------------------------
  485. -- 20、文件信息表
  486. -- ----------------------------
  487. drop table if exists sys_file;
  488. create table sys_file (
  489. id bigint not null comment '文件Id',
  490. folder_id bigint not null default 0 comment '分类Id',
  491. name varchar(100) not null comment '文件名称',
  492. nick varchar(100) default null comment '文件别名',
  493. url varchar(500) not null comment '文件地址',
  494. size bigint not null default 0 comment '文件大小',
  495. type char(1) not null default '0' comment '文件类型(0默认 1系统)',
  496. sort int unsigned not null default 0 comment '显示顺序',
  497. status char(1) not null default '0' comment '状态(0正常 1停用)',
  498. create_by bigint default null comment '创建者',
  499. create_time datetime default current_timestamp comment '创建时间',
  500. update_by bigint default null comment '更新者',
  501. update_time datetime on update current_timestamp comment '更新时间',
  502. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  503. tenant_id bigint not null comment '租户Id',
  504. primary key (id)
  505. ) engine = innodb comment = '文件信息表';
  506. -- ----------------------------
  507. -- 21、文件分类信息表
  508. -- ----------------------------
  509. drop table if exists sys_file_folder;
  510. create table sys_file_folder (
  511. id bigint not null comment '分类Id',
  512. parent_id bigint not null default 0 comment '父分类Id',
  513. name varchar(100) not null comment '分类名称',
  514. level int not null comment '树层级',
  515. ancestors varchar(500) default '' comment '祖级列表',
  516. type char(1) not null default '0' comment '分类类型(0默认文件夹 1系统文件夹)',
  517. sort int unsigned not null default 0 comment '显示顺序',
  518. status char(1) not null default '0' comment '状态(0正常 1停用)',
  519. create_by bigint default null comment '创建者',
  520. create_time datetime default current_timestamp comment '创建时间',
  521. update_by bigint default null comment '更新者',
  522. update_time datetime on update current_timestamp comment '更新时间',
  523. del_flag tinyint not null default 0 comment '删除标志(0正常 1删除)',
  524. tenant_id bigint not null comment '租户Id',
  525. primary key (id)
  526. ) engine = innodb comment = '文件分类信息表';