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.
 
 
 

219 lines
19 KiB

-- ----------------------------
-- 1、滚动计划头表
-- ----------------------------
drop table if exists dhc_roll_plan_title;
create table dhc_roll_plan_title (
roll_plan_id bigint(20) not null auto_increment comment '滚动计划id',
product_line varchar(32) default '' comment '产品线编码',
product_line_name varchar(64) default '' comment '产品线名称',
area_code_large varchar(32) default '' comment '销售大区编码',
area_name_large varchar(64) default '' comment '销售大区名称',
area_code_small varchar(32) default '' comment '销售小区编码',
area_name_small varchar(64) default '' comment '销售小区名称',
plan_year int default 0 comment '提报年',
plan_week int default 0 comment '提报周',
lock_weeks int default 0 comment '锁定周',
status char(1) default '0' comment '滚动计划状态(0初始化 1已提交 2已审核 3评审版已发布 4.正式版已发布)',
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 (roll_plan_id)
) engine=innodb auto_increment=1 comment = '滚动计划头表';
-- ----------------------------
-- 2、滚动计划明细表
-- ----------------------------
drop table if exists dhc_roll_plan_detail;
create table dhc_roll_plan_detail (
roll_plan_detail_id bigint(20) not null auto_increment comment '滚动计划明细id',
roll_plan_id bigint(20) not null comment '滚动计划id',
roll_plan_num varchar(64) default '' comment '滚动计划号',
roll_plan_no varchar(64) default '' comment '滚动计划序号',
complete_machine_code varchar(64) default '' comment '整机编码',
plan_version varchar(32) default '' comment '计划版本(排产计划导入的)',
plan_inout varchar(2) default '' comment '计划内/计划外(Y/N)',
country_code varchar(32) default '' comment '国家编码',
country_name varchar(64) default '' comment '国家名称',
dealer_code varchar(32) default '' comment '客户编码',
dealer_name varchar(32) default '' comment '客户名称',
area_code_large varchar(32) default '' comment '销售大区编码',
area_name_large varchar(64) default '' comment '销售大区名称',
area_code_small varchar(32) default '' comment '销售小区编码',
area_name_small varchar(64) default '' comment '销售小区名称',
dept_emp_code varchar(32) default '' comment '业务线负责人编号',
dept_emp_name varchar(32) default '' comment '业务线负责人名称',
Internal_model varchar(32) default '' comment '内部型号',
customer_model varchar(32) default '' comment '客户型号',
plan_quantity bigint(20) comment '计划数量',
plan_quantity_pre bigint(20) comment '计划数量(N-1周)',
formal_plan_quantity bigint(20) comment '正式版计划数量',
product_category_large varchar(32) default '' comment '产品大类编码',
product_category_middle varchar(32) default '' comment '产品中类编码',
product_category_small varchar(32) default '' comment '产品小类编码',
product_category varchar(32) default '' comment '产品品类',
product_size varchar(64) default '' comment '尺寸',
production_base_code varchar(32) default '' comment '生成基地编码',
production_base_name varchar(64) default '' comment '生成基地名称',
pack_way_code varchar(32) default '' comment '包装方式编码',
pack_way_name varchar(64) default '' comment '包装方式名称',
contract_num varchar(32) default '' comment '合同号',
brand_code varchar(32) default '' comment '品牌编码',
brand_name varchar(64) default '' comment '品牌名称',
production_date date comment '生产日期',
production_year int default 0 comment '生产年',
production_week int default 0 comment '生产周',
delivery_date date comment '交货日期',
delivery_date_pre date comment '交货日期(N-1周)',
delivery_year int default 0 comment '交货年',
delivery_week int default 0 comment '交货周',
formal_delivery_date date comment '正式版交货日期',
ord_plan_date date comment '排定日期',
sales_assistant_code varchar(32) default '' comment '销售协调编码',
sales_assistant_name varchar(64) default '' comment '销售协调名称',
pm_code varchar(32) default '' comment '项目经理编码',
pm_name varchar(64) default '' comment '项目经理名称',
is_first_order char(1) default '0' comment '是否首单(0.否 1.是)',
is_PLAN_ZERO char(1) default '0' comment '是否零号计划(0.否 1.是)',
is_straight char(1) default '0' comment '是否直发(0.否 1.是)',
production_mothod char(1) default '0' comment '生产方式(0.自制 1.ODM)',
supplier_code varchar(32) default '' comment '供应商编码',
supplier_name varchar(64) default '' comment '供应商名称',
order_stage varchar(128) default '' comment '订单阶段',
order_type varchar(64) default '' comment '订单类别(A,B,C)',
abnormal_info varchar(256) default '' comment '异常信息',
abnormal_spec varchar(256) default '' comment '异常信息说明',
shelf_material varchar(512) default '' comment '当地自制物料',
feedback_market varchar(512) default '' comment '市场反馈',
detail_status char(1) default '0' comment '计划明细状态(0初始化 1已提交 2已审核 3评审版已发布 4.正式版已发布 5.待市场反馈 6.已应答不满足)',
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 (rolling_plan_detail_id)
) engine=innodb auto_increment=1 comment = '滚动计划明细表';
-- ----------------------------
-- 3、滚动计划头历史记录表
-- ----------------------------
drop table if exists dhc_roll_plan_title_record;
create table dhc_roll_plan_title_record (
roll_plan_record_id bigint(20) not null auto_increment comment '滚动计划头历史记录id',
roll_plan_id bigint(20) not null comment '滚动计划id',
product_line varchar(32) default '' comment '产品线编码',
product_line_name varchar(64) default '' comment '产品线名称',
area_code_large varchar(32) default '' comment '销售大区编码',
area_name_large varchar(64) default '' comment '销售大区名称',
area_code_small varchar(32) default '' comment '销售小区编码',
area_name_small varchar(64) default '' comment '销售小区名称',
plan_year int default 0 comment '提报年',
plan_week int default 0 comment '提报周',
lock_weeks int default 0 comment '锁定周',
status char(1) default '0' comment '滚动计划状态(0初始化 1已提交 2已审核 3评审版已发布 4.正式版已发布)',
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 (roll_plan_record_id)
) engine=innodb auto_increment=1 comment = '滚动计划头历史记录表';
-- ----------------------------
-- 4、滚动计划明细历史记录表
-- ----------------------------
drop table if exists dhc_roll_plan_detail_record;
create table dhc_roll_plan_detail_record (
roll_plan_detail_record_id bigint(20) not null auto_increment comment '滚动计划明细历史记录id',
roll_plan_detail_id bigint(20) not null comment '滚动计划明细id',
roll_plan_id bigint(20) not null comment '滚动计划id',
roll_plan_num varchar(64) default '' comment '滚动计划号',
roll_plan_no varchar(64) default '' comment '滚动计划序号',
complete_machine_code varchar(64) default '' comment '整机编码',
plan_version varchar(32) default '' comment '计划版本(排产计划导入的)',
plan_inout varchar(2) default '' comment '计划内/计划外(Y/N)',
country_code varchar(32) default '' comment '国家编码',
country_name varchar(64) default '' comment '国家名称',
dealer_code varchar(32) default '' comment '客户编码',
dealer_name varchar(32) default '' comment '客户名称',
area_code_large varchar(32) default '' comment '销售大区编码',
area_name_large varchar(64) default '' comment '销售大区名称',
area_code_small varchar(32) default '' comment '销售小区编码',
area_name_small varchar(64) default '' comment '销售小区名称',
dept_emp_code varchar(32) default '' comment '业务线负责人编号',
dept_emp_name varchar(32) default '' comment '业务线负责人名称',
Internal_model varchar(32) default '' comment '内部型号',
customer_model varchar(32) default '' comment '客户型号',
plan_quantity bigint(20) comment '计划数量',
plan_quantity_pre bigint(20) comment '计划数量(N-1周)',
formal_plan_quantity bigint(20) comment '正式版计划数量',
product_category_large varchar(32) default '' comment '产品大类编码',
product_category_middle varchar(32) default '' comment '产品中类编码',
product_category_small varchar(32) default '' comment '产品小类编码',
product_category varchar(32) default '' comment '产品品类',
product_size varchar(64) default '' comment '尺寸',
production_base_code varchar(32) default '' comment '生产基地编码',
production_base_name varchar(64) default '' comment '生产基地名称',
pack_way_code varchar(32) default '' comment '包装方式编码',
pack_way_name varchar(64) default '' comment '包装方式名称',
contract_num varchar(32) default '' comment '合同号',
brand_code varchar(32) default '' comment '品牌编码',
brand_name varchar(64) default '' comment '品牌名称',
production_date date comment '生产日期',
production_year int default 0 comment '生产年',
production_week int default 0 comment '生产周',
delivery_date date comment '交货日期',
delivery_date_pre date comment '交货日期(N-1周)',
delivery_year int default 0 comment '交货年',
delivery_week int default 0 comment '交货周',
formal_delivery_date date comment '正式版交货日期',
ord_plan_date date comment '排定日期',
sales_assistant_code varchar(32) default '' comment '销售协调编码',
sales_assistant_name varchar(64) default '' comment '销售协调名称',
pm_code varchar(32) default '' comment '项目经理编码',
pm_name varchar(64) default '' comment '项目经理名称',
is_first_order char(1) default '0' comment '是否首单(0.否 1.是)',
is_PLAN_ZERO char(1) default '0' comment '是否零号计划(0.否 1.是)',
is_straight char(1) default '0' comment '是否直发(0.否 1.是)',
production_mothod char(1) default '0' comment '生产方式(0.自制 1.ODM)',
supplier_code varchar(32) default '' comment '供应商编码',
supplier_name varchar(64) default '' comment '供应商名称',
order_stage varchar(128) default '' comment '订单阶段',
order_type varchar(64) default '' comment '订单类别(A,B,C)',
abnormal_info varchar(256) default '' comment '异常信息',
abnormal_spec varchar(256) default '' comment '异常信息说明',
shelf_material varchar(512) default '' comment '当地自制物料',
feedback_market varchar(512) default '' comment '市场反馈',
detail_status char(1) default '0' comment '计划明细状态(0初始化 1已提交 2已审核 3评审版已发布 4.正式版已发布 5.待市场反馈 6.已应答不满足)',
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 (roll_plan_detail_record_id)
) engine=innodb auto_increment=1 comment = '滚动计划明细历史记录表';
-- ----------------------------
-- 5、闸口时间表
-- ----------------------------
drop table if exists dhc_switch_config;
create table dhc_switch_config (
switch_id bigint(20) not null auto_increment comment '闸口时间id',
switch_config_code varchar(32) default '' comment '闸口类别编码',
switch_config_name varchar(64) default '' comment '闸口类别名称',
switch_name varchar(64) default '' comment '闸口名称',
product_line varchar(32) default '' comment '产品线编码',
product_line_name varchar(64) default '' comment '产品线名称',
switch_start_date date comment '开始日期',
switch_start_month int default 0 comment '开始月份',
switch_start_week int default 0 comment '开始星期',
switch_start_hour int default 0 comment '开始小时',
switch_end_date date comment '结束日期',
switch_end_month int default 0 comment '结束月份',
switch_end_week int default 0 comment '结束星期',
switch_end_hour int default 0 comment '结束小时',
enable_flag 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 (switch_id)
) engine=innodb auto_increment=1 comment = '闸口时间表';