tmp.sql 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. alter table cust_customer add `cust_province_id` INT(11) COMMENT '所在省ID' after cust_address;
  2. alter table cust_customer add `cust_province` VARCHAR(90) COMMENT '所在省' after cust_province_id;
  3. alter table cust_customer add `cust_city_id` INT(11) COMMENT '所在市ID' after cust_province;
  4. alter table cust_customer add `cust_city` VARCHAR(90) COMMENT '所在市' after cust_city_id;
  5. alter table cust_customer add `cust_region_id` INT(11) COMMENT '所在区县ID' after cust_city;
  6. alter table cust_customer add `cust_region` VARCHAR(90) COMMENT '所在区县' after cust_region_id;
  7. alter table cust_customer modify `cust_status` VARCHAR(4) DEFAULT 10 COMMENT '客户状态(10 待领取 20 领取审批 30 已领取)';
  8. alter table cust_customer add `follow_up_man` VARCHAR(90) COMMENT '最后跟进人' after follow_up_date;
  9. alter table ctr_contract_invoice modify `appro_status` varchar(4) DEFAULT NULL COMMENT '审核状态 10 待提交审核 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销';
  10. alter table ctr_contract add `signatory_type` varchar(255) DEFAULT NULL COMMENT '签订单位类型 10 终端用户 20 经销商 30 代理商' after signatory_name;
  11. alter table ctr_contract modify `incharge_name` varchar(90) COMMENT '负责人(销售工程师)';
  12. alter table ctr_contract modify `appro_status` varchar(4) NOT NULL COMMENT '审核状态 10 待提交审核 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销',
  13. alter table ctr_contract add `cust_province_id` INT(11) COMMENT '所在省ID' after cust_name;
  14. alter table ctr_contract add `cust_province` VARCHAR(90) COMMENT '所在省' after cust_province_id;
  15. alter table ctr_contract add `cust_city_id` INT(11) COMMENT '所在市ID' after cust_province;
  16. alter table ctr_contract add `cust_city` VARCHAR(90) COMMENT '所在市' after cust_city_id;
  17. alter table ctr_contract add `product_line` varchar(4) NOT NULL COMMENT '产品线' after cust_name;
  18. alter table cust_customer drop column cust_dist_code;
  19. alter table cust_customer drop column cust_location;
  20. alter table ctr_contract modify `contract_end_time` datetime COMMENT '合同结束时间'
  21. alter table base_distributor add `invoice_header` varchar(255) DEFAULT NULL COMMENT '开票抬头' after sale_num;
  22. alter table cust_customer add `invoice_header` varchar(255) DEFAULT NULL COMMENT '开票抬头' after follow_up_man;
  23. -- 2023-05-05
  24. alter table ctr_contract add `contract_sign_time` datetime COMMENT '合同签订时间' after contract_end_time;
  25. alter table ctr_contract add `signatory_unit` varchar(90) COMMENT '合同签订单位' after signatory_type;
  26. alter table ctr_contract add `earnest_money` decimal(24, 6) COMMENT '质量/履约保证金(元)' after signatory_unit;
  27. alter table ctr_contract_product add `contract_code` varchar(32) NOT NULL COMMENT '合同编号' after contract_id;
  28. alter table ctr_contract_product add `purchase_cost` decimal(24, 6) DEFAULT NULL COMMENT '采购成本' after contract_prive;
  29. alter table ctr_contract_product add `dev_cost` decimal(24, 6) DEFAULT NULL COMMENT '二次开发成本' after purchase_cost;
  30. alter table ctr_contract_product add `maintain_cost` decimal(24, 6) DEFAULT NULL COMMENT '产品维保成本' after dev_cost;
  31. alter table ctr_contract_product add `direct_cost` decimal(24, 6) DEFAULT NULL COMMENT '直接成本' after maintain_cost;
  32. alter table ctr_contract_product add `maintain_period` int(11) DEFAULT NULL COMMENT '质保期(天)' after direct_cost;
  33. alter table ctr_contract_product add `warrant_period` int(11) DEFAULT NULL COMMENT '运维期(天)' after maintain_period;
  34. alter table ctr_contract_product add `maintain_start_time` datetime DEFAULT NULL COMMENT '运维开始时间' after warrant_period;
  35. alter table ctr_contract_product add `maintain_remark` text DEFAULT NULL COMMENT '运维约定条款' after maintain_start_time;
  36. alter table ctr_contract_product add `accept_time` datetime DEFAULT NULL COMMENT '验收时间' after maintain_remark;
  37. alter table ctr_contract_collection_plan add `plan_scale` decimal(24, 6) COMMENT '计划回款比例' after plan_datetime;
  38. alter table ctr_contract_collection_plan add `plan_condition` text COMMENT '回款条件' after plan_scale;
  39. -- 2023-05-11
  40. alter table base_distributor add `dist_type` varchar(4) DEFAULT '10' COMMENT '经销商类型 10 经销商 20 代理商' after invoice_header;
  41. alter table base_distributor add `customer_type` varchar(255) NOT NULL COMMENT '授权客户类型' after dist_type;
  42. alter table base_distributor add `existed_product` text DEFAULT NULL COMMENT '已有代理品牌和产品' after customer_type;
  43. alter table base_distributor add `assistant_sale_id` text DEFAULT NULL COMMENT '助理人员Id' after existed_product;
  44. alter table base_distributor add `assistant_sale` text DEFAULT NULL COMMENT '助理人员' after assistant_sale_id;
  45. alter table base_distributor add `register_district` varchar(255) DEFAULT NULL COMMENT '注册地' after assistant_sale;
  46. alter table base_distributor add `history_customer` text DEFAULT NULL COMMENT '历史合作的终端客户名称' after register_district;
  47. alter table base_distributor add `proxy_start_time` datetime DEFAULT NULL COMMENT '代理签约有效期开始(代理商)' after history_customer;
  48. alter table base_distributor add `proxy_end_time` datetime DEFAULT NULL COMMENT '代理签约有效期结束(代理商)' after proxy_start_time;
  49. alter table base_distributor add `proxy_district` varchar(255) DEFAULT NULL COMMENT '授权代理区域(代理商)' after proxy_end_time;
  50. alter table base_distributor add `contract_url` text DEFAULT NULL COMMENT '代理合同(代理商)' after proxy_district;
  51. CREATE TABLE `base_distributor_dynamics` (
  52. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  53. `dist_id` int(11) NOT NULL COMMENT '经销商/代理商ID',
  54. `opn_people_id` int(11) NOT NULL COMMENT '操作人ID',
  55. `opn_people` varchar(90) NOT NULL COMMENT '操作人',
  56. `opn_date` datetime NOT NULL COMMENT '操作日期',
  57. `opn_type` varchar(10) NOT NULL COMMENT '操作类型',
  58. `opn_content` text DEFAULT NULL COMMENT '操作内容',
  59. `remark` text DEFAULT NULL COMMENT '备注',
  60. `created_by` int(11) NOT NULL COMMENT '创建者',
  61. `created_name` varchar(90) NOT NULL COMMENT '创建人',
  62. `created_time` datetime NOT NULL COMMENT '创建时间',
  63. `updated_by` int(11) DEFAULT NULL COMMENT '更新者',
  64. `updated_name` varchar(90) DEFAULT NULL COMMENT '更新人',
  65. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  66. `deleted_time` datetime DEFAULT NULL COMMENT '删除时间',
  67. PRIMARY KEY (`id`) USING BTREE
  68. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '经销商/代理商动态';
  69. alter table base_distributor_contact add `honorific` varchar(255) DEFAULT NULL COMMENT '尊称' after mail;
  70. alter table base_distributor_contact add `territory` text DEFAULT NULL COMMENT '负责区域/业务线' after honorific;
  71. CREATE TABLE `base_distributor_record` (
  72. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  73. `dist_id` int(11) NOT NULL COMMENT '所属经销商',
  74. `dist_type` varchar(4) DEFAULT '10' COMMENT '经销商类型 10 经销商 20 代理商',
  75. `business_scope` varchar(255) NOT NULL COMMENT '业务范围',
  76. `customer_type` varchar(255) NOT NULL COMMENT '授权客户类型',
  77. `proxy_district` varchar(255) DEFAULT NULL COMMENT '授权代理区域(代理商)',
  78. `proxy_start_time` datetime DEFAULT NULL COMMENT '代理签约有效期开始(代理商)',
  79. `proxy_end_time` datetime DEFAULT NULL COMMENT '代理签约有效期结束(代理商)',
  80. `contract_url` text DEFAULT NULL COMMENT '代理合同(代理商)',
  81. `existed_product` text DEFAULT NULL COMMENT '已有代理品牌和产品',
  82. `history_customer` text DEFAULT NULL COMMENT '历史合作的终端客户名称',
  83. `to_dist_reason` text DEFAULT NULL COMMENT '转移经销商原因',
  84. `remark` text DEFAULT NULL COMMENT '备注',
  85. `created_by` int(11) NOT NULL COMMENT '创建者',
  86. `created_name` varchar(90) NOT NULL COMMENT '创建人',
  87. `created_time` datetime NOT NULL COMMENT '创建时间',
  88. `updated_by` int(11) DEFAULT NULL COMMENT '更新者',
  89. `updated_name` varchar(90) DEFAULT NULL COMMENT '更新人',
  90. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  91. `deleted_time` datetime DEFAULT NULL COMMENT '删除时间',
  92. PRIMARY KEY (`id`) USING BTREE
  93. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMMENT = '历史代理记录';
  94. CREATE TABLE `base_distributor_target` (
  95. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  96. `dist_id` int(11) NOT NULL COMMENT '所属经销商',
  97. `year` int(11) NOT NULL COMMENT '年度',
  98. `q1` decimal(24, 6) NOT NULL COMMENT 'q1指标(万元)',
  99. `q2` decimal(24, 6) NOT NULL COMMENT 'q2指标(万元)',
  100. `q3` decimal(24, 6) NOT NULL COMMENT 'q3指标(万元)',
  101. `q4` decimal(24, 6) NOT NULL COMMENT 'q4指标(万元)',
  102. `total` decimal(24, 6) NOT NULL COMMENT '年度指标(万元)',
  103. `remark` text DEFAULT NULL COMMENT '备注',
  104. `created_by` int(11) NOT NULL COMMENT '创建者',
  105. `created_name` varchar(90) NOT NULL COMMENT '创建人',
  106. `created_time` datetime NOT NULL COMMENT '创建时间',
  107. `updated_by` int(11) DEFAULT NULL COMMENT '更新者',
  108. `updated_name` varchar(90) DEFAULT NULL COMMENT '更新人',
  109. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  110. `deleted_time` datetime DEFAULT NULL COMMENT '删除时间',
  111. PRIMARY KEY (`id`) USING BTREE
  112. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMMENT = '代理商业务指标';
  113. -- alter table base_distributor_contact modify `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键';
  114. alter table base_distributor add `appro_item` varchar(255) COMMENT '审批项名称: 创建代理商 经销商转代理商 代理商续签 代理商转经销商' after contract_url;
  115. alter table base_distributor add `appro_data` text COMMENT '审核数据' after appro_item;
  116. alter table base_distributor add `appro_status` varchar(4) COMMENT '审核状态 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销' after appro_data;
  117. alter table plat_followup add `further_plan` text COMMENT '下一步跟进计划和目标' after follow_content;
  118. alter table plat_followup add `effect` text COMMENT '达成效果' after further_plan;
  119. alter table plat_followup add `issue` text COMMENT '问题或困难' after effect;