You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
5.7 KiB

-- ----------------------------
-- 1、人员区域关系表
-- ----------------------------
drop table if exists dhc_user_area;
create table dhc_user_area (
user_id bigint NOT NULL COMMENT '用户ID',
area_code varchar(32) NOT NULL comment '区域编码',
primary key (user_id,area_code)
) engine=innodb auto_increment=1 comment = '人员区域关系表';
-- ----------------------------
-- 2、人员产品线关系表
-- ----------------------------
drop table if exists dhc_user_product_line;
create table dhc_user_product_line (
user_id bigint NOT NULL COMMENT '用户ID',
product_line_code varchar(32) NOT NULL comment '产品线编码',
primary key (user_id,product_line_code)
) engine=innodb auto_increment=1 comment = '人员产品线关系表';
-- ----------------------------
-- 3、区域表
-- ----------------------------
drop table if exists dhc_area;
create table dhc_area (
area_id bigint(20) not null auto_increment comment '区域id',
parent_id bigint(20) default 0 comment '父区域id',
ancestors varchar(50) default '' comment '祖级列表',
area_code varchar(32) default '' comment '区域编码',
area_name varchar(64) default '' comment '区域名称',
order_num int(4) default 0 comment '显示顺序',
status char(1) default '0' comment '区域状态(0正常 1停用)',
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 (area_id)
) engine=innodb auto_increment=1 comment = '区域表';
-- ----------------------------
-- 4、国家表
-- ----------------------------
drop table if exists dhc_country;
create table dhc_country (
country_id bigint(20) not null auto_increment comment '国家id',
country_code varchar(32) default '' comment '国家编码',
country_name varchar(64) default '' comment '国家名称',
area_id_large bigint(20) comment '销售大区id',
area_name_large varchar(64) default '' comment '销售大区名称',
area_id_small bigint(20) comment '销售小区id',
area_name_small varchar(64) 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 (country_id)
) engine=innodb auto_increment=1 comment = '国家表';
-- ----------------------------
-- 5、生产基地与产品线关系表
-- ----------------------------
drop table if exists dhc_production_base_line;
create table dhc_production_base_line (
product_line_code varchar(32) NOT NULL comment '产品线编码',
production_base_code varchar(32) NOT NULL comment '生成基地编码',
primary key (product_line_code,production_base_code)
) engine=innodb auto_increment=1 comment = '生产基地与产品线关系表';
-- ----------------------------
-- 6、品牌表
-- ----------------------------
drop table if exists dhc_brand;
create table dhc_brand (
brand_id bigint(20) not null auto_increment comment '品牌id',
brand_code varchar(32) default '' comment '品牌编码',
brand_name varchar(64) 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 (brand_id)
) engine=innodb auto_increment=1 comment = '品牌表';
-- ----------------------------
-- 7、供应商信息表
-- ----------------------------
drop table if exists dhc_supplier;
create table dhc_supplier (
supplier_id bigint(20) not null auto_increment comment '供应商id',
supplier_code varchar(32) default '' comment '供应商编码',
supplier_name varchar(64) 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 (supplier_id)
) engine=innodb auto_increment=1 comment = '供应商信息表';