소스 검색

Add 添加Sql

YueYunyun 2 년 전
부모
커밋
b0ff70b4a5
2개의 변경된 파일298개의 추가작업 그리고 1개의 파일을 삭제
  1. 285 0
      SERVER/YanZhongXYH/script/sql/XYHSQL.sql
  2. 13 1
      SERVER/YanZhongXYH/script/sql/YanZhongXYH.sql

+ 285 - 0
SERVER/YanZhongXYH/script/sql/XYHSQL.sql

@@ -0,0 +1,285 @@
+USE `YanZhongXYH`;
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- 1、校友信息
+-- ----------------------------
+drop table if exists am_alumnus;
+create table am_alumnus
+(
+    am_id      bigint(20)   not null    comment '校友id',
+    user_id     bigint(20)  not null  comment  '用户id',
+    name        varchar(30)  not null  comment '姓名',
+    gender       char(1)      not null  comment '性别',
+    birthday     date        not null   comment '出生日期',
+    type       char(1)   defalt 0 comment '校友身份(0校友 1教职工 2校友及教职工 3其他)',
+    enrol_year   char(4)     not null   comment '入学年份',
+    graduate_year char(4)     not null   comment '毕业年份',
+    class        varchar(5)  not null  comment '班级',
+    education    varchar(30)  not null  comment '最高学历',
+    province    varchar(10)  not null  comment '省份',
+    city        varchar(10)  not null  comment '城市',
+    district    varchar(10)  not null  comment '区县',
+    native_place varchar(10) not null  comment '籍贯',
+    mobile       varchar(11)  not null  comment '手机号码',
+    email        varchar(50)  not null  comment '邮箱',
+    qq           varchar(15)  not null  comment 'QQ',
+    wechat       varchar(30)  not null  comment '微信',
+    public      char(1)  default '0' comment '信息公开标志(0不公开 1好友公开 2全部公开)',
+    industry    varchar(10)  default ''  comment '行业',
+    industry_area  varchar(10) default ''  comment '行业领域',
+    work_unit      varchar(50)  default ''  comment '工作单位',
+    position     varchar(30)  default ''  comment '职位',
+    del_flag    char(1)      default '0' comment '删除标志(0代表存在 1代表删除)',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime                  comment '创建时间',
+    update_by   varchar(64)  default '' comment '更新者',
+    update_time datetime comment '更新时间',
+    primary key (am_id)
+) engine = innodb
+  auto_increment = 200 comment = '校友信息表';
+
+-- ----------------------------
+-- 2、校友扩展信息
+-- ----------------------------
+drop table if exists am_alumnus_ex;
+create table am_alumnus_ex
+(
+    am_id      bigint(20)   not null    comment '校友id',
+    user_id    bigint(20)  not null  comment  '用户id',
+    address      varchar(100) default ''  comment '详细地址',
+    work_unit_more varchar(50)  default ''  comment '工作单位介绍',
+    industry_more varchar(500) not null  comment '行业说明',
+    self_introduction  varchar(500) default '' comment '自我介绍',
+    resources   varchar(500) default '' comment '能提供的资源',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (am_id)
+) engine = innodb
+  auto_increment = 200 comment = '校友扩展信息';
+
+-- ----------------------------
+-- 3、学习经历信息
+-- ----------------------------
+drop table if exists am_study;
+create table am_study
+(
+    am_id      bigint(20)   not null    comment '校友id',
+    study   varchar(30)  not null  comment '专业名称',
+    enrol_year   char(4)     not null   comment '入学年份',
+    graduate_year char(4)     not null   comment '毕业年份',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime                  comment '创建时间',
+    primary key (am_id,friend_id)
+) engine = innodb
+  auto_increment = 100 comment = '学习经历信息';
+
+-- ----------------------------
+-- 4、好友信息
+-- ----------------------------
+drop table if exists am_friends;
+create table am_friends
+(
+    am_id      bigint(20)   not null    comment '校友id',
+    friend_id bigint(20)   not null    comment '好友id',
+    status       char(4)   default 0  comment '状态(0好友 1黑名单)',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime                  comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (am_id,friend_id)
+) engine = innodb
+  auto_increment = 100 comment = '好友信息';
+
+-- ----------------------------
+-- 5、好友申请信息
+-- ----------------------------
+drop table if exists am_friends;
+create table am_friends
+(
+    apply_id      bigint(20)   not null    comment 'id',
+    am_id      bigint(20)   not null    comment '校友id',
+    friend_id bigint(20)   not null    comment '好友id',
+    status       char(4)   default 0  comment '状态(0申请中 1通过 2拒绝)',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime                  comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (apply_id)
+) engine = innodb
+  auto_increment = 100 comment = '好友申请信息';
+
+-- ----------------------------
+-- 6、资讯信息
+-- ----------------------------
+drop table if exists am_news;
+create table am_news
+(
+    news_id  char(20)   not null    comment '新闻id',
+    title varchar(50) not null  comment '新闻标题',
+    category  char(5) not null  comment '新闻类别',
+    content text  not null  comment '新闻内容',
+    date datetime not null  comment '发布日期',
+    status       char(4)   default '0'  comment '状态(0草稿 1发布)',
+    isHead       char(1)   default '0'  comment '是否头条(0否 1是)',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime   comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (news_id)
+) engine = innodb comment = '资讯信息';
+
+-- ----------------------------
+-- 7、活动信息
+-- ----------------------------
+drop table if exists am_activit;
+create table am_activity
+(
+    activity_id char(20)   not null    comment '活动id',
+    title varchar(50) not null  comment '活动标题',
+    category  char(5) not null  comment '活动类别',
+    content varchar(500) not null  comment '活动详情',
+    cost varchar(500) not null  comment '活动费用',
+    people_max int(4) default 0  comment '活动人数上限',
+    activity_date datetime not null  comment '活动日期',
+    expiry_date datetime not null  comment '截止日期',
+    area varchar(50) not null  comment '活动区域',
+    address varchar(50) not null  comment '活动地点',
+    status  char(4)   default 0  comment '状态(0草稿 1申请中 2通过 3拒绝)',
+    create_by  varchar(64)  default '' comment '创建者',
+    create_time datetime  comment '创建时间',
+    remark  varchar(500) default null comment '备注',
+    primary key (activity_id)
+) engine = innodb
+  auto_increment = 100 comment = '活动信息';
+
+-- ----------------------------
+-- 8、活动报名信息
+-- ----------------------------
+drop table if exists am_activity_apply;
+create table am_activity_apply
+(
+    apply_id    bigint(20)   not null    comment 'id',
+    activity_id char(20)   not null    comment '活动id',
+    audit_status  char(4)   default 0  comment '状态(1申请中 2通过 3拒绝)',
+    audit_time datetime  comment '创建时间',
+    cost  decimal(18,2) default null  default 0  comment '费用',
+    cost_status  char(4)   default '0'  comment '费用状态(0未支付 1已支付)',
+    cost_time datetime default null  comment '创建时间',
+    create_by  varchar(64)  default '' comment '创建者',
+    create_time datetime  comment '创建时间',
+    remark  varchar(500) default null comment '备注',
+    primary key (apply_id,activity_id)
+) engine = innodb
+  auto_increment = 100 comment = '活动信息';
+
+-- ----------------------------
+-- 9、互助信息
+-- ----------------------------
+drop table if exists am_help;
+create table am_help
+(
+    help_id  char(20) not null comment '互助id',
+    title varchar(50) not null comment '互助标题',
+    category  char(5) not null comment '互助类别',
+    content varchar(500) not null comment '互助详情',
+    expiry_date datetime not null comment '有效日期',
+    area varchar(50) not null  comment '有效区域',
+    status char(4)  default 0  comment '状态(0草稿 1申请中 2通过 3拒绝)',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime                  comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (help_id)
+) engine = innodb comment = '互助信息';
+
+-- ----------------------------
+-- 10、评论信息
+-- ----------------------------
+drop table if exists am_comment;
+create table am_comment
+(
+    comment_id char(20)   not null    comment '附件id',
+    source_id char(20)  not null    comment '源id',
+    source_type char(20) default ''  comment '源类型',
+    parent_id bigint(20)   default 0  comment '父评论id',
+    user_id bigint(20)   not null  comment '评论人id',
+    content text  not null  comment '评论内容',
+    status  char(4) default '0' comment '状态(0正常 1异常)',
+    isHead  char(1) default '0' comment '是否头条(0否 1是)',
+    create_by varchar(64) default '' comment '创建者',
+    create_time datetime comment '创建时间',
+    update_by varchar(64) default '' comment '更新者',
+    update_time datetime comment '更新时间',
+    remark varchar(500) default null comment '备注',
+    primary key (comment_id)
+) engine = innodb comment = '评论信息';
+
+-- ----------------------------
+-- 11、图片附件信息
+-- ----------------------------
+drop table if exists am_attach;
+create table am_attach
+(
+    att_id      bigint(20)  not null    comment '附件id',
+    source_id char(20) not null comment '源id',
+    source_type  char(20)   default ''  comment '源类型',
+    file_type char(1) not null  comment '附件类型(1图片 2视频)',
+    file_path  varchar(255) not null  comment '附件路径',
+    file_name  varchar(255) not null  comment '附件名称',
+    create_by  varchar(64)  default '' comment '创建者',
+    create_time datetime comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (apply_id)
+) engine = innodb
+  auto_increment = 100 comment = '图片附件信息';
+
+-- ----------------------------
+-- 12、统计信息
+-- ----------------------------
+drop table if exists am_statistics;
+create table am_statistics
+(
+    am_id bigint(20) not null comment '校友id',
+    source_id char(20) not null comment '源id',
+    source_type char(20) default ''  comment '源类型',
+    read_status char(1) default '0' comment '阅读状态(0未阅读 1阅读)',
+    star_status char(1) default '0' comment '点赞状态(0未点赞 1点赞)',
+    favorite_status char(1) default '0' comment '收藏状态(0未收藏 1收藏)',
+    create_by  varchar(64)  default '' comment '创建者',
+    create_time datetime comment '创建时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (am_id,source_id)
+) engine = innodb  comment = '统计信息';
+
+-- ----------------------------
+-- 13、关注信息
+-- ----------------------------
+drop table if exists am_follow;
+create table am_follow
+(
+    am_id bigint(20) not null comment '校友id',
+    follow_id bigint(20) not null comment '关注id',
+    status char(1) default '0' comment '关注状态(0未关注 1关注)',
+    follow_time datetime comment '关注时间',
+    remark      varchar(500) default null comment '备注',
+    primary key (am_id,follow_id)
+) engine = innodb  comment = '关注信息';
+
+-- ----------------------------
+-- 14、类别信息
+-- ----------------------------
+drop table if exists sys_category;
+create table sys_category
+(
+    category_id bigint(20) not null comment '类别id',
+    parent_id bigint(20)  default '0' comment '父类别id',
+    category_name varchar(20) not null comment '类别名称',
+    category_type char(4) not null comment '类别类型',
+    status char(1) default '0' comment '类别状态(0禁用 1启用)',
+    remark      varchar(500) default null comment '备注',
+    primary key (category_id)
+) engine = innodb  comment = '类别信息';
+
+
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 13 - 1
SERVER/YanZhongXYH/script/sql/YanZhongXYH.sql

@@ -730,6 +730,9 @@ insert into sys_dict_type
 values (10, '系统状态', 'sys_common_status', '0', 'admin', sysdate(), '', null, '登录状态列表');
 values (10, '系统状态', 'sys_common_status', '0', 'admin', sysdate(), '', null, '登录状态列表');
 insert into sys_dict_type
 insert into sys_dict_type
 values (11, '分会类型', 'sys_branch_type', '0', 'admin', sysdate(), '', null, '行业/兴趣分会类型');
 values (11, '分会类型', 'sys_branch_type', '0', 'admin', sysdate(), '', null, '行业/兴趣分会类型');
+insert into sys_dict_type
+values (12, '校友身份', 'am_alumnus_type', '0', 'admin', sysdate(), '', null, '校友类型');
+
 
 
 -- ----------------------------
 -- ----------------------------
 -- 12、字典数据表
 -- 12、字典数据表
@@ -806,9 +809,18 @@ values (28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'adm
 insert into sys_dict_data
 insert into sys_dict_data
 values (29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
 values (29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
 insert into sys_dict_data
 insert into sys_dict_data
-values (30, 1, '行业分会', '0', 'sys_branch_type', '', 'info', 'Y', '0', 'admin', sysdate(), '', null, '行业分会');
+values (30, 1, '行业分会', '0', 'sys_branch_type', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '行业分会');
 insert into sys_dict_data
 insert into sys_dict_data
 values (31, 2, '兴趣分会', '1', 'sys_branch_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '兴趣分会');
 values (31, 2, '兴趣分会', '1', 'sys_branch_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '兴趣分会');
+insert into sys_dict_data
+values (33, 1, '校友', '0', 'am_alumnus_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '校友');
+insert into sys_dict_data
+values (34, 2, '教职工', '1', 'am_alumnus_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '教师');
+insert into sys_dict_data
+values (35, 3, '校友及教职工', '2', 'am_alumnus_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null,
+        '既是校友又是教职工');
+insert into sys_dict_data
+values (36, 4, '其他', '3', 'am_alumnus_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他人员');
 
 
 
 
 -- ----------------------------
 -- ----------------------------