V1.0.1.20230412.sql 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ALTER TABLE `sys_enterprise` ADD COLUMN `biz_platform_code` varchar(100) DEFAULT NULL COMMENT '业务平台-引用enum OpCenterBizPlatformEnum';
  2. ALTER TABLE `sys_enterprise` ADD COLUMN `biz_platform_name` varchar(600) DEFAULT NULL COMMENT '业务平台名';
  3. ALTER TABLE `sys_enterprise` ADD COLUMN `biz_operator_id` varchar(64) DEFAULT NULL COMMENT '业务方运营商id';
  4. ALTER TABLE `sys_organization` ADD COLUMN `biz_platform_code` varchar(100) DEFAULT NULL COMMENT '业务平台-引用enum OpCenterBizPlatformEnum';
  5. ALTER TABLE `sys_organization` ADD COLUMN `biz_operator_id` varchar(64) DEFAULT NULL COMMENT '业务方运营商id';
  6. ALTER TABLE `sys_organization` ADD COLUMN `biz_platform_name` varchar(600) DEFAULT NULL COMMENT '业务平台名';
  7. ALTER TABLE `unified_supplier` ADD COLUMN `biz_platform_code` varchar(100) DEFAULT NULL COMMENT '业务平台-引用enum OpCenterBizPlatformEnum';
  8. ALTER TABLE `unified_supplier` ADD COLUMN `biz_platform_name` varchar(600) DEFAULT NULL COMMENT '业务平台名';
  9. CREATE TABLE `unified_business` (
  10. `id` BIGINT ( 20 ) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  11. `user_name` VARCHAR ( 30 ) NOT NULL COMMENT '姓名',
  12. `user_number` VARCHAR ( 60 ) DEFAULT NULL COMMENT '员工工号',
  13. `company_name` VARCHAR ( 110 ) NOT NULL COMMENT '所属公司',
  14. `dept_name` VARCHAR ( 110 ) NOT NULL COMMENT '所属部门',
  15. `area_name` VARCHAR ( 110 ) DEFAULT NULL COMMENT '所属区域',
  16. `post_name` VARCHAR ( 110 ) DEFAULT NULL COMMENT '岗位名称',
  17. `phone` VARCHAR ( 110 ) NOT NULL COMMENT '电话',
  18. `email` VARCHAR ( 160 ) NOT NULL COMMENT '邮箱',
  19. `job_status` TINYINT ( 4 ) NOT NULL DEFAULT '1' COMMENT '在职状态:1-在职;0-离职;',
  20. `remark` VARCHAR ( 210 ) DEFAULT NULL COMMENT '备注',
  21. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  22. `create_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '创建人',
  23. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  24. `update_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '更新人',
  25. `deleted` TINYINT ( 4 ) NOT NULL DEFAULT '0' COMMENT '软删除 0-未删除 1-已删除',
  26. `enabled` TINYINT ( 4 ) NOT NULL DEFAULT '1' COMMENT '状态:1-启用;0-停用;',
  27. PRIMARY KEY ( `id` )
  28. ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '运营中心-业务人员表';
  29. CREATE TABLE `unified_settlement_programme` (
  30. `id` BIGINT ( 20 ) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  31. `customer_id` BIGINT ( 20 ) NOT NULL COMMENT '客户id',
  32. `type` TINYINT ( 4 ) NOT NULL DEFAULT '1' COMMENT '类型:1-运营商;',
  33. `programme_name` VARCHAR ( 110 ) NOT NULL COMMENT '方案名称',
  34. `programme_no` VARCHAR ( 50 ) NOT NULL COMMENT '方案编号',
  35. `settlement_scope` TINYINT ( 4 ) DEFAULT NULL COMMENT '结算范围',
  36. `settlement_rule` TINYINT ( 4 ) DEFAULT NULL COMMENT '结算规则',
  37. `bill_name` VARCHAR ( 110 ) DEFAULT NULL COMMENT '账单名称',
  38. `export_field` VARCHAR ( 1000 ) DEFAULT '{"org_name":1,"virt_name":1,"supplier_name":0,"third_no":0,"agreement_cost":0,"integral":0}' COMMENT '导出字段',
  39. `supname_display_rule` TINYINT ( 4 ) DEFAULT NULL COMMENT '供应商名称展示规则',
  40. `custom_supplier_name` VARCHAR ( 110 ) DEFAULT NULL COMMENT '自定义供应商名称',
  41. `is_default` TINYINT ( 4 ) NOT NULL DEFAULT '0' COMMENT '是否默认:1-默认;0-不是默认;',
  42. `remark` VARCHAR ( 210 ) DEFAULT NULL COMMENT '备注',
  43. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  44. `create_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '创建人',
  45. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  46. `update_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '更新人',
  47. `deleted` TINYINT ( 4 ) NOT NULL DEFAULT '0' COMMENT '软删除 0-未删除 1-已删除',
  48. `enabled` TINYINT ( 4 ) NOT NULL DEFAULT '1' COMMENT '状态:1-启用;0-停用;',
  49. PRIMARY KEY ( `id` )
  50. ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '结算方案表';
  51. CREATE TABLE `unified_settlement_programme_range_rule` (
  52. `id` BIGINT ( 20 ) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  53. `type` TINYINT ( 4 ) NOT NULL COMMENT '类型:1-部分订单不参与结算;2-部分按原供应商名称导出;',
  54. `programme_id` BIGINT ( 20 ) NOT NULL COMMENT '结算方案id',
  55. `display` TINYINT ( 4 ) DEFAULT NULL COMMENT '排序',
  56. `way` TINYINT ( 4 ) DEFAULT NULL COMMENT '方式',
  57. `not_joining_range` VARCHAR ( 1000 ) DEFAULT NULL COMMENT '不参与范围(显示)',
  58. `not_joining_range_json` text DEFAULT NULL COMMENT '不参与范围json',
  59. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  60. `create_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '创建人',
  61. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  62. `update_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '更新人',
  63. `deleted` TINYINT ( 4 ) NOT NULL DEFAULT '0' COMMENT '软删除 0-未删除 1-已删除',
  64. PRIMARY KEY ( `id` )
  65. ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '结算方案-不参与范围表';
  66. CREATE TABLE `unified_settlement_programme_amount_rule` (
  67. `id` BIGINT ( 20 ) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  68. `programme_id` BIGINT ( 20 ) NOT NULL COMMENT '结算方案id',
  69. `display` TINYINT ( 4 ) DEFAULT NULL COMMENT '排序',
  70. `operator_ids` VARCHAR ( 200 ) DEFAULT NULL COMMENT '适用运营商ids',
  71. `operator_names` VARCHAR ( 1000 ) DEFAULT NULL COMMENT '适用运营商',
  72. `org_ids` VARCHAR ( 200 ) DEFAULT NULL COMMENT '适用项目ids',
  73. `org_names` VARCHAR ( 1000 ) DEFAULT NULL COMMENT '适用项目',
  74. `order_type_ids` VARCHAR ( 200 ) DEFAULT NULL COMMENT '适用订单类型ids',
  75. `order_type_names` VARCHAR ( 1000 ) DEFAULT NULL COMMENT '适用订单类型',
  76. `amount_rule` TINYINT ( 4 ) DEFAULT NULL COMMENT '订单结算金额规则',
  77. `amount_rate` DECIMAL ( 13, 2 ) DEFAULT NULL COMMENT '结算规则比例0.01~100 %',
  78. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  79. `create_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '创建人',
  80. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  81. `update_user_id` BIGINT ( 20 ) DEFAULT NULL COMMENT '更新人',
  82. `deleted` TINYINT ( 4 ) NOT NULL DEFAULT '0' COMMENT '软删除 0-未删除 1-已删除',
  83. PRIMARY KEY ( `id` )
  84. ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '结算方案-订单结算金额表';
  85. ALTER TABLE `unified_settlement_programme_range_rule` ADD INDEX index_range_rule_type ( `type`, `programme_id`);
  86. ALTER TABLE `unified_settlement_programme_amount_rule` ADD INDEX index_amount_rule (`programme_id`);