数据库加库、加表
数据库:wiki 表名:tb_address_tag、tb_qualification、tb_short_enings、tb_wiki_credit_report、tb_wiki_credit_report_request
sql:
create database wiki;
use wiki;
create table tb_address_tag
(
id int auto_increment
primary key,
company_name_digest varchar(255) default '' not null
comment 'digest',
province varchar(255) default '' not null
comment '省',
province_tmp varchar(255) default '' not null
comment '省备份',
city varchar(255) default '' not null
comment '市',
city_tmp varchar(255) default '' not null
comment '市备份',
district varchar(255) default '' not null
comment '区',
district_tmp varchar(255) default '' not null
comment '区备份',
local varchar(255) default '' not null
comment '详细地址',
local_tmp varchar(255) default '' not null
comment '详细地址备份',
status tinyint default '1' not null
comment '状态默认1,1表示待审核,2表示审核通过,3表示不通过,4表示更新废弃',
msg varchar(500) default '' not null
comment '审核信息',
operation varchar(255) default '' not null
comment '审核操作人',
create_time timestamp default CURRENT_TIMESTAMP not null,
last_update_time timestamp default CURRENT_TIMESTAMP not null
on update CURRENT_TIMESTAMP
)
comment '地址标记表';
create index tb_address_tag_digest
on tb_address_tag (company_name_digest);
create table tb_qualification
(
id int auto_increment
primary key,
uid int not null
comment '用户id',
company_name_digest varchar(32) not null,
name varchar(255) not null
comment '资质名称',
number varchar(255) not null
comment '证书编号',
enable_date varchar(255) not null
comment '证书有效期',
institutions varchar(255) not null
comment '发证机构',
information varchar(1000) not null
comment '资质范围',
address varchar(255) not null
comment '证书核验网站地址或公示网站地址',
path varchar(255) not null
comment '资质证书图片',
status tinyint(1) default '1' not null
comment '1待审核,2审核通过,3审核不通过,9删除',
audit_time timestamp null
comment '审核时间',
audit_operation varchar(255) null
comment '审核人员',
audit_info varchar(255) null
comment '审核信息',
add_time timestamp default CURRENT_TIMESTAMP not null,
lastupdatetime timestamp default CURRENT_TIMESTAMP not null
on update CURRENT_TIMESTAMP
);
create index company_name_digest
on tb_qualification (company_name_digest);
create index uid
on tb_qualification (uid);
create table tb_short_enings
(
id int auto_increment
primary key,
uid int not null
comment '用户id',
company_name_digest varchar(32) not null,
short_ening varchar(255) not null
comment '短词',
status tinyint(1) default '1' not null
comment '状态:1待审核,2审核通过,3审核不通过',
info varchar(255) null
comment '审核信息',
audit_time datetime null
comment '审核时间',
audit_operation varchar(255) null,
add_time timestamp default CURRENT_TIMESTAMP not null,
lastupdatetime timestamp default CURRENT_TIMESTAMP not null
on update CURRENT_TIMESTAMP
);
create index digest_short
on tb_short_enings (company_name_digest, short_ening);
create index uid
on tb_short_enings (uid);
create table tb_wiki_credit_report
(
id int auto_increment
primary key,
company_name varchar(255) default '' not null
comment '公司名',
company_name_digest varchar(255) default '' not null
comment 'digest',
create_report varchar(50) default '0' null
comment '生成报告的时间',
api_download_url varchar(1000) default '' not null
comment 'api接口的下载地址',
our_download_url varchar(1000) default '' not null
comment '我们服务器的下载地址',
count int default '0' not null
comment '历史记录中的下载次数',
create_time timestamp default CURRENT_TIMESTAMP not null,
last_update_time timestamp default CURRENT_TIMESTAMP not null
on update CURRENT_TIMESTAMP
)
comment '可信百科信用报告-报告记录表';
create index tb_wiki_credit_report_company_name
on tb_wiki_credit_report (company_name);
create index tb_wiki_credit_report_digest
on tb_wiki_credit_report (company_name_digest);
create table tb_wiki_credit_report_request
(
id int auto_increment
primary key,
user_id int default '0' not null
comment '用户id',
person_type tinyint(1) default '1' not null
comment '用户身份,1个人,2公司',
person_company_name varchar(255) default '' not null
comment '申请人的公司名',
person_why varchar(1000) default '' not null
comment '申请理由',
person_contact varchar(100) default '' not null
comment '申请人联系方式',
company_name varchar(255) default '' not null
comment '公司名',
company_name_digest varchar(255) default '' not null
comment 'digest',
create_report varchar(50) default '0' null
comment '这份报告的生成时间(针对报告)',
our_download_url varchar(1000) default '' not null
comment '我们服务器的下载地址',
status tinyint default '1' not null
comment '状态默认1,1表示等待公司审核,2表示公司审核通过,3表示不通过,4表示生成报告中,4表示报告生成成功',
create_time timestamp default CURRENT_TIMESTAMP not null,
last_update_time timestamp default CURRENT_TIMESTAMP not null
on update CURRENT_TIMESTAMP
)
comment '可信百科信用报告-报告申请表';
create index tb_wiki_credit_report_request_company_name
on tb_wiki_credit_report_request (company_name);
create index tb_wiki_credit_report_request_digest
on tb_wiki_credit_report_request (company_name_digest);
create index tb_wiki_credit_report_request_user_id
on tb_wiki_credit_report_request (user_id);