|
|
@@ -11,7 +11,7 @@ SET FOREIGN_KEY_CHECKS = 0;
|
|
|
drop table if exists sys_org;
|
|
|
create table sys_org
|
|
|
(
|
|
|
- org_id bigint(20) not null comment '组织结构id',
|
|
|
+ org_id bigint(20) not null AUTO_INCREMENT comment '组织结构id',
|
|
|
parent_id bigint(20) default 0 comment '父组织结构id',
|
|
|
ancestors varchar(500) default '' comment '祖级列表',
|
|
|
org_name varchar(30) default '' comment '组织结构名称',
|
|
|
@@ -68,7 +68,7 @@ values (108, 100, '0,100', '海外校友会', 8, '宋', '15888888888', 'vber@iwb
|
|
|
drop table if exists sys_user;
|
|
|
create table sys_user
|
|
|
(
|
|
|
- user_id bigint(20) not null comment '用户ID',
|
|
|
+ user_id bigint(20) not null AUTO_INCREMENT comment '用户ID',
|
|
|
org_id bigint(20) default null comment '组织结构ID',
|
|
|
user_name varchar(30) not null comment '用户账号',
|
|
|
nick_name varchar(30) not null comment '用户昵称',
|
|
|
@@ -82,6 +82,8 @@ create table sys_user
|
|
|
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
|
|
login_ip varchar(128) default '' comment '最后登录IP',
|
|
|
login_date datetime comment '最后登录时间',
|
|
|
+ union_id varchar(50) DEFAULT NULL COMMENT '在WX开放平台的唯一标识符',
|
|
|
+ open_id varchar(50) DEFAULT NULL COMMENT 'WX用户唯一标识',
|
|
|
create_by varchar(64) default '' comment '创建者',
|
|
|
create_time datetime comment '创建时间',
|
|
|
update_by varchar(64) default '' comment '更新者',
|
|
|
@@ -96,21 +98,22 @@ create table sys_user
|
|
|
-- ----------------------------
|
|
|
insert into sys_user
|
|
|
values (1, 100, 'admin', 'Admin', 'sys_user', 'admin@iwbnet.com', '15888888888', '1', '',
|
|
|
- '$2a$10$cIq6acwdCeA4O2us8al1..GznPKoB9Ds1jmutg8JsUupHxtchlQF6', '0', '0', '127.0.0.1', sysdate(), 'admin',
|
|
|
+ '$2a$10$cIq6acwdCeA4O2us8al1..GznPKoB9Ds1jmutg8JsUupHxtchlQF6', '0', '0', '127.0.0.1', sysdate(), null, null,
|
|
|
+ 'admin',
|
|
|
sysdate(), '', null, '管理员');
|
|
|
insert into sys_user
|
|
|
values (2, 100, 'system', 'System', 'sys_user', 'system@iwbnet.com', '15666666666', '1', '',
|
|
|
- '$2a$10$CS9QMV5DdFObCECq.hEcwe9Lv0KzNHmBiUU7B6twemY31qKTRy4O.', '0', '0', '127.0.0.1', sysdate(), 'admin',
|
|
|
+ '$2a$10$CS9QMV5DdFObCECq.hEcwe9Lv0KzNHmBiUU7B6twemY31qKTRy4O.', '0', '0', '127.0.0.1', sysdate(), null, null,
|
|
|
+ 'admin',
|
|
|
sysdate(), '', null, '测试员');
|
|
|
|
|
|
-
|
|
|
-- ----------------------------
|
|
|
-- 3、行业/兴趣分会分会信息表
|
|
|
-- ----------------------------
|
|
|
drop table if exists sys_post;
|
|
|
create table sys_post
|
|
|
(
|
|
|
- post_id bigint(20) not null comment '行业/兴趣分会ID',
|
|
|
+ post_id bigint(20) not null AUTO_INCREMENT comment '行业/兴趣分会ID',
|
|
|
post_type int(4) not null comment '行业/兴趣分会类型(0行业 1兴趣)',
|
|
|
post_name varchar(50) not null comment '行业/兴趣分会名称',
|
|
|
post_sort int(4) not null comment '显示顺序',
|
|
|
@@ -136,7 +139,6 @@ values (3, 1, '乒乓球分会', 3, '0', 'admin', sysdate(), '', null, '');
|
|
|
insert into sys_post
|
|
|
values (4, 1, '羽毛球分会', 4, '0', 'admin', sysdate(), '', null, '');
|
|
|
|
|
|
-
|
|
|
-- ----------------------------
|
|
|
-- 4、角色信息表
|
|
|
-- ----------------------------
|
|
|
@@ -169,14 +171,13 @@ values ('1', '超级管理员', 'admin', 1, 1, 1, 1, '0', '0', 'admin', sysdate(
|
|
|
insert into sys_role
|
|
|
values ('2', '普通角色', 'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, '普通角色');
|
|
|
|
|
|
-
|
|
|
-- ----------------------------
|
|
|
-- 5、菜单权限表
|
|
|
-- ----------------------------
|
|
|
drop table if exists sys_menu;
|
|
|
create table sys_menu
|
|
|
(
|
|
|
- menu_id bigint(20) not null comment '菜单ID',
|
|
|
+ menu_id bigint(20) not null AUTO_INCREMENT comment '菜单ID',
|
|
|
menu_name varchar(50) not null comment '菜单名称',
|
|
|
parent_id bigint(20) default 0 comment '父菜单ID',
|
|
|
order_num int(4) default 0 comment '显示顺序',
|
|
|
@@ -428,13 +429,14 @@ insert into sys_menu
|
|
|
values ('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', '', '',
|
|
|
'admin', sysdate(), '', null, '');
|
|
|
|
|
|
+
|
|
|
-- ----------------------------
|
|
|
-- 6、用户和角色关联表 用户N-1角色
|
|
|
-- ----------------------------
|
|
|
drop table if exists sys_user_role;
|
|
|
create table sys_user_role
|
|
|
(
|
|
|
- user_id bigint(20) not null comment '用户ID',
|
|
|
+ user_id bigint(20) not null AUTO_INCREMENT comment '用户ID',
|
|
|
role_id bigint(20) not null comment '角色ID',
|
|
|
primary key (user_id, role_id)
|
|
|
) engine = innodb comment = '用户和角色关联表';
|
|
|
@@ -669,7 +671,7 @@ values ('2', '2');
|
|
|
drop table if exists sys_oper_log;
|
|
|
create table sys_oper_log
|
|
|
(
|
|
|
- oper_id bigint(20) not null comment '日志主键',
|
|
|
+ oper_id bigint(20) not null AUTO_INCREMENT comment '日志主键',
|
|
|
title varchar(50) default '' comment '模块标题',
|
|
|
business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
|
|
|
method varchar(100) default '' comment '方法名称',
|
|
|
@@ -691,14 +693,13 @@ create table sys_oper_log
|
|
|
key idx_sys_oper_log_ot (oper_time)
|
|
|
) engine = innodb comment = '操作日志记录';
|
|
|
|
|
|
-
|
|
|
-- ----------------------------
|
|
|
-- 11、字典类型表
|
|
|
-- ----------------------------
|
|
|
drop table if exists sys_dict_type;
|
|
|
create table sys_dict_type
|
|
|
(
|
|
|
- dict_id bigint(20) not null comment '字典主键',
|
|
|
+ dict_id bigint(20) not null AUTO_INCREMENT comment '字典主键',
|
|
|
dict_name varchar(100) default '' comment '字典名称',
|
|
|
dict_type varchar(100) default '' comment '字典类型',
|
|
|
status char(1) default '0' comment '状态(0正常 1停用)',
|
|
|
@@ -732,7 +733,8 @@ insert into sys_dict_type
|
|
|
values (11, '分会类型', 'sys_branch_type', '0', 'admin', sysdate(), '', null, '行业/兴趣分会类型');
|
|
|
insert into sys_dict_type
|
|
|
values (12, '校友身份', 'am_alumnus_type', '0', 'admin', sysdate(), '', null, '校友类型');
|
|
|
-
|
|
|
+insert into sys_dict_type
|
|
|
+values (13, '类目名称', 'category_type', '0', 'admin', sysdate(), '', null, '校友类型');
|
|
|
|
|
|
-- ----------------------------
|
|
|
-- 12、字典数据表
|
|
|
@@ -740,7 +742,7 @@ values (12, '校友身份', 'am_alumnus_type', '0', 'admin', sysdate(), '', null
|
|
|
drop table if exists sys_dict_data;
|
|
|
create table sys_dict_data
|
|
|
(
|
|
|
- dict_code bigint(20) not null comment '字典编码',
|
|
|
+ dict_code bigint(20) not null AUTO_INCREMENT comment '字典编码',
|
|
|
dict_sort int(4) default 0 comment '字典排序',
|
|
|
dict_label varchar(100) default '' comment '字典标签',
|
|
|
dict_value varchar(100) default '' comment '字典键值',
|
|
|
@@ -821,6 +823,12 @@ values (35, 3, '校友及教职工', '2', 'am_alumnus_type', '', 'danger', 'N',
|
|
|
'既是校友又是教职工');
|
|
|
insert into sys_dict_data
|
|
|
values (36, 4, '其他', '3', 'am_alumnus_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他人员');
|
|
|
+insert into sys_dict_data
|
|
|
+values (37, 1, '新闻资讯', 'N', 'category_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '新闻资讯');
|
|
|
+insert into sys_dict_data
|
|
|
+values (38, 2, '活动资讯', 'A', 'category_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '活动资讯');
|
|
|
+insert into sys_dict_data
|
|
|
+values (39, 3, '校友互助', 'H', 'category_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '互助信息');
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
@@ -829,7 +837,7 @@ values (36, 4, '其他', '3', 'am_alumnus_type', '', 'info', 'N', '0', 'admin',
|
|
|
drop table if exists sys_config;
|
|
|
create table sys_config
|
|
|
(
|
|
|
- config_id bigint(20) not null comment '参数主键',
|
|
|
+ config_id bigint(20) not null AUTO_INCREMENT comment '参数主键',
|
|
|
config_name varchar(100) default '' comment '参数名称',
|
|
|
config_key varchar(100) default '' comment '参数键名',
|
|
|
config_value varchar(500) default '' comment '参数键值',
|
|
|
@@ -860,7 +868,7 @@ values (3, '账号自助-是否开启用户注册功能', 'sys.account.registerU
|
|
|
drop table if exists sys_logininfor;
|
|
|
create table sys_logininfor
|
|
|
(
|
|
|
- info_id bigint(20) not null comment '访问ID',
|
|
|
+ info_id bigint(20) not null AUTO_INCREMENT comment '访问ID',
|
|
|
user_name varchar(50) default '' comment '用户账号',
|
|
|
ipaddr varchar(128) default '' comment '登录IP地址',
|
|
|
login_location varchar(255) default '' comment '登录地点',
|
|
|
@@ -881,7 +889,7 @@ create table sys_logininfor
|
|
|
drop table if exists sys_notice;
|
|
|
create table sys_notice
|
|
|
(
|
|
|
- notice_id bigint(20) not null comment '公告ID',
|
|
|
+ notice_id bigint(20) not null AUTO_INCREMENT comment '公告ID',
|
|
|
notice_title varchar(50) not null comment '公告标题',
|
|
|
notice_type char(1) not null comment '公告类型(1通知 2公告)',
|
|
|
notice_content longblob default null comment '公告内容',
|
|
|
@@ -902,14 +910,13 @@ values ('1', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内
|
|
|
insert into sys_notice
|
|
|
values ('2', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员');
|
|
|
|
|
|
-
|
|
|
-- ----------------------------
|
|
|
-- 18、代码生成业务表
|
|
|
-- ----------------------------
|
|
|
drop table if exists gen_table;
|
|
|
create table gen_table
|
|
|
(
|
|
|
- table_id bigint(20) not null comment '编号',
|
|
|
+ table_id bigint(20) not null AUTO_INCREMENT comment '编号',
|
|
|
table_name varchar(200) default '' comment '表名称',
|
|
|
table_comment varchar(500) default '' comment '表描述',
|
|
|
sub_table_name varchar(64) default null comment '关联子表的表名',
|
|
|
@@ -939,7 +946,7 @@ create table gen_table
|
|
|
drop table if exists gen_table_column;
|
|
|
create table gen_table_column
|
|
|
(
|
|
|
- column_id bigint(20) not null comment '编号',
|
|
|
+ column_id bigint(20) not null AUTO_INCREMENT comment '编号',
|
|
|
table_id bigint(20) comment '归属表编号',
|
|
|
column_name varchar(200) comment '列名称',
|
|
|
column_comment varchar(500) comment '列描述',
|