21_20240812.sql 10 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ALTER TABLE `product_spu`
  2. ADD COLUMN `spu_apply_id` bigint NOT NULL COMMENT '商品申请id';
  3. CREATE TABLE `product_sku_apply` (
  4. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  5. `spu_apply_id` bigint NOT NULL COMMENT 'spu编号',
  6. `properties` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]',
  7. `price` int DEFAULT '-1' COMMENT '商品价格,单位:分',
  8. `promotion_fee` int DEFAULT NULL COMMENT '推广费, 单位: 分',
  9. `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
  10. `market_price` int DEFAULT NULL COMMENT '市场价,单位:分',
  11. `cost_price` int DEFAULT '-1' COMMENT '成本价,单位: 分',
  12. `bar_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'SKU 的条形码',
  13. `pic_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '图片地址',
  14. `stock` int DEFAULT NULL COMMENT '库存',
  15. `weight` double DEFAULT NULL COMMENT '商品重量,单位:kg 千克',
  16. `volume` double DEFAULT NULL COMMENT '商品体积,单位:m^3 平米',
  17. `first_brokerage_price` int DEFAULT NULL COMMENT '一级分销的佣金,单位:分',
  18. `second_brokerage_price` int DEFAULT NULL COMMENT '二级分销的佣金,单位:分',
  19. `sales_count` int DEFAULT '0' COMMENT '商品销量',
  20. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  21. `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  22. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人',
  23. `updater` double(64,0) DEFAULT NULL COMMENT '更新人',
  24. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  25. `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
  26. `shop_id` bigint DEFAULT '0' COMMENT '店铺id',
  27. `merchant_id` bigint DEFAULT NULL COMMENT '商户id',
  28. `high_precision_price` decimal(11,6) DEFAULT NULL COMMENT '高精度价格',
  29. `settlement_price` int DEFAULT '-1' COMMENT '结算价,单位: 分',
  30. `high_precision_settlement_price` decimal(11,6) DEFAULT '0.000000' COMMENT '高精度结算价',
  31. PRIMARY KEY (`id`) USING BTREE
  32. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商品sku申请表';
  33. CREATE TABLE `product_spu_apply` (
  34. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '商品 SPU 编号,自增',
  35. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品名称',
  36. `keyword` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '关键字',
  37. `introduction` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品简介',
  38. `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '商品详情',
  39. `producer_area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '产地',
  40. `spu_type` int DEFAULT NULL COMMENT '商品类别',
  41. `category_id` bigint NOT NULL COMMENT '商品分类编号',
  42. `brand_id` int DEFAULT NULL COMMENT '商品品牌编号',
  43. `pic_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品封面图',
  44. `slider_pic_urls` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '商品轮播图地址\n 数组,以逗号分隔\n 最多上传15张',
  45. `sort` int NOT NULL DEFAULT '0' COMMENT '排序字段',
  46. `status` tinyint NOT NULL COMMENT '商品状态: 0 上架(开启) 1 下架(禁用)-1 回收',
  47. `spec_type` bit(1) DEFAULT NULL COMMENT '规格类型:0 单规格 1 多规格',
  48. `price` int DEFAULT '-1' COMMENT '商品价格,单位使用:分',
  49. `market_price` int DEFAULT NULL COMMENT '市场价,单位使用:分',
  50. `cost_price` int DEFAULT '-1' COMMENT '成本价,单位: 分',
  51. `stock` int NOT NULL DEFAULT '0' COMMENT '库存',
  52. `delivery_types` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '配送方式数组',
  53. `delivery_template_id` bigint DEFAULT NULL COMMENT '物流配置模板编号',
  54. `give_integral` int NOT NULL DEFAULT '0' COMMENT '赠送积分',
  55. `sub_commission_type` bit(1) DEFAULT NULL COMMENT '分销类型',
  56. `sales_count` int DEFAULT '0' COMMENT '商品销量',
  57. `virtual_sales_count` int DEFAULT '0' COMMENT '虚拟销量',
  58. `browse_count` int DEFAULT '0' COMMENT '商品点击量',
  59. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  60. `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  61. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人',
  62. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人',
  63. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  64. `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
  65. `shop_id` bigint DEFAULT NULL COMMENT '店铺id',
  66. `merchant_id` bigint DEFAULT NULL COMMENT '商户id',
  67. `hidden` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否隐藏。隐藏:1,不隐藏:0',
  68. `promotion_fee` int DEFAULT NULL COMMENT '推广费, 单位: 分,值为sku中最大的推广费',
  69. `spu_pay_type` int NOT NULL DEFAULT '1' COMMENT '商品支付类别(1 rmb 2积分)',
  70. `high_precision` bit(1) NOT NULL DEFAULT b'0' COMMENT '高精度',
  71. `high_precision_price` decimal(11,6) DEFAULT 0 COMMENT '高精度价格',
  72. `apply_member_user_id` bigint DEFAULT NULL COMMENT '申请用户id',
  73. `check_system_user_id` bigint DEFAULT NULL COMMENT '审核系统用户id',
  74. `check_time` datetime DEFAULT NULL COMMENT '审核时间',
  75. `check_comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '审核意见',
  76. `check_status` tinyint DEFAULT '0' COMMENT '审核状态:默认0表示未审核,1审核通过,2审核不通过',
  77. PRIMARY KEY (`id`) USING BTREE
  78. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商品spu申请表';
  79. CREATE TABLE `product_spu_apply_log` (
  80. `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'spu审核记录id',
  81. `status` tinyint NOT NULL DEFAULT '0' COMMENT '申请状态 0:申请中 1:通过 2:未通过',
  82. `product_spu_apply_id` bigint NOT NULL COMMENT '商品申请id',
  83. `check_system_user_id` bigint DEFAULT NULL COMMENT '审核系统用户id',
  84. `change_json_object` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '修改的json对象',
  85. `check_comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '审核意见',
  86. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  87. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  88. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
  89. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  90. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  91. PRIMARY KEY (`id`) USING BTREE
  92. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商品审核记录';