alter table cust_customer add `cust_province_id` INT(11) COMMENT '所在省ID' after cust_address; alter table cust_customer add `cust_province` VARCHAR(90) COMMENT '所在省' after cust_province_id; alter table cust_customer add `cust_city_id` INT(11) COMMENT '所在市ID' after cust_province; alter table cust_customer add `cust_city` VARCHAR(90) COMMENT '所在市' after cust_city_id; alter table cust_customer add `cust_region_id` INT(11) COMMENT '所在区县ID' after cust_city; alter table cust_customer add `cust_region` VARCHAR(90) COMMENT '所在区县' after cust_region_id; alter table cust_customer modify `cust_status` VARCHAR(4) DEFAULT 10 COMMENT '客户状态(10 待领取 20 领取审批 30 已领取)'; alter table cust_customer add `follow_up_man` VARCHAR(90) COMMENT '最后跟进人' after follow_up_date; alter table ctr_contract_invoice modify `appro_status` varchar(4) DEFAULT NULL COMMENT '审核状态 10 待提交审核 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销'; alter table ctr_contract add `signatory_type` varchar(255) DEFAULT NULL COMMENT '签订单位类型 10 终端用户 20 经销商 30 代理商' after signatory_name; alter table ctr_contract modify `incharge_name` varchar(90) COMMENT '负责人(销售工程师)'; alter table ctr_contract modify `appro_status` varchar(4) NOT NULL COMMENT '审核状态 10 待提交审核 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销', alter table ctr_contract add `cust_province_id` INT(11) COMMENT '所在省ID' after cust_name; alter table ctr_contract add `cust_province` VARCHAR(90) COMMENT '所在省' after cust_province_id; alter table ctr_contract add `cust_city_id` INT(11) COMMENT '所在市ID' after cust_province; alter table ctr_contract add `cust_city` VARCHAR(90) COMMENT '所在市' after cust_city_id; alter table ctr_contract add `product_line` varchar(4) NOT NULL COMMENT '产品线' after cust_name; alter table cust_customer drop column cust_dist_code; alter table cust_customer drop column cust_location; alter table ctr_contract modify `contract_end_time` datetime COMMENT '合同结束时间' alter table base_distributor add `invoice_header` varchar(255) DEFAULT NULL COMMENT '开票抬头' after sale_num; alter table cust_customer add `invoice_header` varchar(255) DEFAULT NULL COMMENT '开票抬头' after follow_up_man; -- 2023-05-05 alter table ctr_contract add `contract_sign_time` datetime COMMENT '合同签订时间' after contract_end_time; alter table ctr_contract add `signatory_unit` varchar(90) COMMENT '合同签订单位' after signatory_type; alter table ctr_contract add `earnest_money` decimal(24, 6) COMMENT '质量/履约保证金(元)' after signatory_unit; alter table ctr_contract_product add `contract_code` varchar(32) NOT NULL COMMENT '合同编号' after contract_id; alter table ctr_contract_product add `purchase_cost` decimal(24, 6) DEFAULT NULL COMMENT '采购成本' after contract_prive; alter table ctr_contract_product add `dev_cost` decimal(24, 6) DEFAULT NULL COMMENT '二次开发成本' after purchase_cost; alter table ctr_contract_product add `maintain_cost` decimal(24, 6) DEFAULT NULL COMMENT '产品维保成本' after dev_cost; alter table ctr_contract_product add `direct_cost` decimal(24, 6) DEFAULT NULL COMMENT '直接成本' after maintain_cost; alter table ctr_contract_product add `maintain_period` int(11) DEFAULT NULL COMMENT '质保期(天)' after direct_cost; alter table ctr_contract_product add `warrant_period` int(11) DEFAULT NULL COMMENT '运维期(天)' after maintain_period; alter table ctr_contract_product add `maintain_start_time` datetime DEFAULT NULL COMMENT '运维开始时间' after warrant_period; alter table ctr_contract_product add `maintain_remark` text DEFAULT NULL COMMENT '运维约定条款' after maintain_start_time; alter table ctr_contract_product add `accept_time` datetime DEFAULT NULL COMMENT '验收时间' after maintain_remark; alter table ctr_contract_collection_plan add `plan_scale` decimal(24, 6) COMMENT '计划回款比例' after plan_datetime; alter table ctr_contract_collection_plan add `plan_condition` text COMMENT '回款条件' after plan_scale; -- 2023-05-11 alter table base_distributor add `dist_type` varchar(4) DEFAULT '10' COMMENT '经销商类型 10 经销商 20 代理商' after invoice_header; alter table base_distributor add `customer_type` varchar(255) NOT NULL COMMENT '授权客户类型' after dist_type; alter table base_distributor add `existed_product` text DEFAULT NULL COMMENT '已有代理品牌和产品' after customer_type; alter table base_distributor add `assistant_sale_id` text DEFAULT NULL COMMENT '助理人员Id' after existed_product; alter table base_distributor add `assistant_sale` text DEFAULT NULL COMMENT '助理人员' after assistant_sale_id; alter table base_distributor add `register_district` varchar(255) DEFAULT NULL COMMENT '注册地' after assistant_sale; alter table base_distributor add `history_customer` text DEFAULT NULL COMMENT '历史合作的终端客户名称' after register_district; alter table base_distributor add `proxy_start_time` datetime DEFAULT NULL COMMENT '代理签约有效期开始(代理商)' after history_customer; alter table base_distributor add `proxy_end_time` datetime DEFAULT NULL COMMENT '代理签约有效期结束(代理商)' after proxy_start_time; alter table base_distributor add `proxy_district` varchar(255) DEFAULT NULL COMMENT '授权代理区域(代理商)' after proxy_end_time; alter table base_distributor add `contract_url` text DEFAULT NULL COMMENT '代理合同(代理商)' after proxy_district; CREATE TABLE `base_distributor_dynamics` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `dist_id` int(11) NOT NULL COMMENT '经销商/代理商ID', `opn_people_id` int(11) NOT NULL COMMENT '操作人ID', `opn_people` varchar(90) NOT NULL COMMENT '操作人', `opn_date` datetime NOT NULL COMMENT '操作日期', `opn_type` varchar(10) NOT NULL COMMENT '操作类型', `opn_content` text DEFAULT NULL COMMENT '操作内容', `remark` text DEFAULT NULL COMMENT '备注', `created_by` int(11) NOT NULL COMMENT '创建者', `created_name` varchar(90) NOT NULL COMMENT '创建人', `created_time` datetime NOT NULL COMMENT '创建时间', `updated_by` int(11) DEFAULT NULL COMMENT '更新者', `updated_name` varchar(90) DEFAULT NULL COMMENT '更新人', `updated_time` datetime DEFAULT NULL COMMENT '更新时间', `deleted_time` datetime DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '经销商/代理商动态'; alter table base_distributor_contact add `honorific` varchar(255) DEFAULT NULL COMMENT '尊称' after mail; alter table base_distributor_contact add `territory` text DEFAULT NULL COMMENT '负责区域/业务线' after honorific; CREATE TABLE `base_distributor_record` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `dist_id` int(11) NOT NULL COMMENT '所属经销商', `dist_type` varchar(4) DEFAULT '10' COMMENT '经销商类型 10 经销商 20 代理商', `business_scope` varchar(255) NOT NULL COMMENT '业务范围', `customer_type` varchar(255) NOT NULL COMMENT '授权客户类型', `proxy_district` varchar(255) DEFAULT NULL COMMENT '授权代理区域(代理商)', `proxy_start_time` datetime DEFAULT NULL COMMENT '代理签约有效期开始(代理商)', `proxy_end_time` datetime DEFAULT NULL COMMENT '代理签约有效期结束(代理商)', `contract_url` text DEFAULT NULL COMMENT '代理合同(代理商)', `existed_product` text DEFAULT NULL COMMENT '已有代理品牌和产品', `history_customer` text DEFAULT NULL COMMENT '历史合作的终端客户名称', `to_dist_reason` text DEFAULT NULL COMMENT '转移经销商原因', `remark` text DEFAULT NULL COMMENT '备注', `created_by` int(11) NOT NULL COMMENT '创建者', `created_name` varchar(90) NOT NULL COMMENT '创建人', `created_time` datetime NOT NULL COMMENT '创建时间', `updated_by` int(11) DEFAULT NULL COMMENT '更新者', `updated_name` varchar(90) DEFAULT NULL COMMENT '更新人', `updated_time` datetime DEFAULT NULL COMMENT '更新时间', `deleted_time` datetime DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMMENT = '历史代理记录'; CREATE TABLE `base_distributor_target` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `dist_id` int(11) NOT NULL COMMENT '所属经销商', `year` int(11) NOT NULL COMMENT '年度', `q1` decimal(24, 6) NOT NULL COMMENT 'q1指标(万元)', `q2` decimal(24, 6) NOT NULL COMMENT 'q2指标(万元)', `q3` decimal(24, 6) NOT NULL COMMENT 'q3指标(万元)', `q4` decimal(24, 6) NOT NULL COMMENT 'q4指标(万元)', `total` decimal(24, 6) NOT NULL COMMENT '年度指标(万元)', `remark` text DEFAULT NULL COMMENT '备注', `created_by` int(11) NOT NULL COMMENT '创建者', `created_name` varchar(90) NOT NULL COMMENT '创建人', `created_time` datetime NOT NULL COMMENT '创建时间', `updated_by` int(11) DEFAULT NULL COMMENT '更新者', `updated_name` varchar(90) DEFAULT NULL COMMENT '更新人', `updated_time` datetime DEFAULT NULL COMMENT '更新时间', `deleted_time` datetime DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMMENT = '代理商业务指标'; -- alter table base_distributor_contact modify `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键'; alter table base_distributor add `appro_item` varchar(255) COMMENT '审批项名称: 创建代理商 经销商转代理商 代理商续签 代理商转经销商' after contract_url; alter table base_distributor add `appro_data` text COMMENT '审核数据' after appro_item; alter table base_distributor add `appro_status` varchar(4) COMMENT '审核状态 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销' after appro_data; alter table plat_followup add `further_plan` text COMMENT '下一步跟进计划和目标' after follow_content; alter table plat_followup add `effect` text COMMENT '达成效果' after further_plan; alter table plat_followup add `issue` text COMMENT '问题或困难' after effect; -- 2023-06-20 alter table work_order add `product_line` varchar(4) NOT NULL COMMENT '产品线' after nbo_name; alter table work_order add `end_time` datetime DEFAULT NULL COMMENT '结束时间' after order_status; alter table work_order add `finish_remark` text DEFAULT NULL COMMENT '完成信息' after `file`; alter table work_order add `finish_time` datetime DEFAULT NULL COMMENT '完成信息' after `finish_remark`; alter table work_order add `finish_by` int(11) DEFAULT NULL COMMENT '完成操作人' after `finish_time`; alter table work_order add `finish_by_name` varchar(90) DEFAULT NULL COMMENT '完成操作人' after `finish_by`; alter table work_order modify `order_status` varchar(4) NOT NULL COMMENT '工单状态(10发起20审批中30审批通过40审批拒绝50关闭60已完成)'; -- 添加工单状态字典 60已完成 -- 2023-07-06 alter table work_order add `sale_id` int(11) DEFAULT NULL COMMENT '销售工程师ID' after assign_user_name; alter table work_order add `sale_name` varchar(90) DEFAULT NULL COMMENT '销售工程师' after sale_id; alter table work_order add `expect_time` datetime COMMENT '期望完成时间 (技术文件)'; alter table work_order add `support_time` datetime COMMENT '支持时间 (售前讲解)'; alter table work_order add `trial_time_start` datetime COMMENT '试用开始时间 (试用)'; alter table work_order add `trial_time_end` datetime COMMENT '试用结束时间 (试用)'; -- 售前讲解 技术文件 试用 alter table work_order add `feedback_support_time` datetime DEFAULT NULL COMMENT '支持反馈-反馈时间 (售前讲解 技术文件)'; alter table work_order add `feedback_support_by` int(11) DEFAULT NULL COMMENT '支持反馈-反馈人 (售前讲解 技术文件)'; alter table work_order add `feedback_support_name` varchar(90) DEFAULT NULL COMMENT '支持反馈-反馈人 (售前讲解 技术文件)'; alter table work_order add `feedback_support_content` text DEFAULT NULL COMMENT '支持反馈-本次讲解情况反馈 (售前讲解 技术文件)'; alter table work_order add `feedback_sale_time` datetime DEFAULT NULL COMMENT '销售反馈-反馈时间 (售前讲解 技术文件)'; alter table work_order add `feedback_sale_by` int(11) DEFAULT NULL COMMENT '销售反馈-反馈人 (售前讲解 技术文件)'; alter table work_order add `feedback_sale_name` varchar(90) DEFAULT NULL COMMENT '销售反馈-反馈人 (售前讲解 技术文件)'; alter table work_order add `feedback_sale_meeting` text DEFAULT NULL COMMENT '销售反馈-会议纪要 (售前讲解)'; alter table work_order add `feedback_sale_dist` text DEFAULT NULL COMMENT '销售反馈-客户\经销商反馈 (售前讲解)'; alter table work_order add `feedback_sale_next` text DEFAULT NULL COMMENT '销售反馈-下一步计划 (售前讲解 技术文件)'; alter table work_order add `feedback_sale_user` text DEFAULT NULL COMMENT '销售反馈-用户反馈 (技术文件)'; CREATE TABLE work_order_feedback_trial( `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键' , `work_order_id` INT(11) NOT NULL COMMENT '关联工单ID' , `feedback_trial_type` VARCHAR(4) NOT NULL COMMENT '试用反馈类型 10 启动 20 过程 30 总结', `feedback_trial_time` DATETIME COMMENT '试用反馈-反馈时间 (试用)', `feedback_trial_by`INT(11) COMMENT '试用反馈-反馈人 (试用)', `feedback_trial_name` VARCHAR(90) COMMENT '试用反馈-反馈人 (试用)', `feedback_trial_content` TEXT COMMENT '试用反馈-部署安装总结\会议总结\过程问题\试用总结 (试用)', `feedback_trial_dist` TEXT COMMENT '试用反馈-客户\经销商反馈 (试用)', `feedback_trial_plan` TEXT COMMENT '试用反馈-下一步计划\跟进计划 (试用)', `remark` TEXT COMMENT '备注' , `created_by` INT(11) NOT NULL COMMENT '创建者' , `created_name` VARCHAR(90) NOT NULL COMMENT '创建人' , `created_time` DATETIME NOT NULL COMMENT '创建时间' , `updated_by` INT(11) COMMENT '更新者' , `updated_name` VARCHAR(90) COMMENT '更新人' , `updated_time` DATETIME COMMENT '更新时间' , `deleted_time` DATETIME COMMENT '删除时间' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '试用反馈'; alter table work_order_dynamics modify `opn_type` varchar(90) NOT NULL COMMENT '操作类型'; alter table plat_punch_records add `partner_contact_id` INT(11) COMMENT '合作伙伴联系人id'; alter table plat_punch_records add `partner_contact_name` varchar(90) COMMENT '合作伙伴联系人';