
-- ----------------------------
-- Table structure for ecw_customer_competitor
-- ----------------------------
DROP TABLE IF EXISTS `ecw_customer_competitor`;
CREATE TABLE `ecw_customer_competitor` (
                                           `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
                                           `name` varchar(512) NOT NULL COMMENT '名称',
                                           `creator` varchar(32) NOT NULL DEFAULT '' COMMENT '创建者',
                                           `create_time` datetime NOT NULL COMMENT '创建时间',
                                           `updater` varchar(32) DEFAULT '' COMMENT '更新者',
                                           `update_time` datetime NOT NULL COMMENT '更新时间',
                                           `deleted` bit DEFAULT false COMMENT '是否删除',
                                           PRIMARY KEY (`id`),
                                           KEY (`create_time`)
) COMMENT='客户竞争对手表';



-- 添加新字段
alter table `ecw_customer` add column `first_deal_time` datetime default null COMMENT '首次成交时间';
alter table `ecw_customer` add column `get_method` Integer default null COMMENT '获取方式';
alter table `ecw_customer` add column `create_from` Integer default null COMMENT '创建入口';
alter table `ecw_customer` add column `customer_service_confirmed_time` datetime default null COMMENT '确认接收时间';
alter table `ecw_customer` add column `busi_country_ids` varchar(100) default null COMMENT '业务国家ids';
alter table `ecw_customer` add column `roles` varchar(100) default null COMMENT '客户角色';
alter table `ecw_customer` add column `competitor_ids` varchar(100) default null COMMENT '竞争对手ids';
alter table `ecw_customer` add column `weight_yearly` decimal(15, 2) DEFAULT 0 COMMENT '年度发货量';
alter table `ecw_customer` add column `num_yearly` int DEFAULT 0 COMMENT '年度发货次数';
alter table `ecw_customer` add column `default_billing` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认开票';

-- 更新表
alter table `ecw_customer`
    change column `pickup_point` `pickup_points` varchar(100) DEFAULT NULL COMMENT '常用提货网点ids';
alter table `ecw_customer`
    change column `product_id` `product_ids` varchar(300) DEFAULT NULL COMMENT '主营产品ids';

