This commit is contained in:
2025-10-14 13:26:21 +08:00
parent c6e6e9b5fb
commit 143633c358
3 changed files with 216 additions and 0 deletions

150
doc/sql/mall.sql Normal file
View File

@@ -0,0 +1,150 @@
DROP TABLE IF EXISTS `mall_cart`;
CREATE TABLE `mall_cart`
(
`id` bigint NOT NULL COMMENT '主键',
`user_id` bigint not null default 0 comment '用户id',
`title` varchar(200) not null default '' comment '商品名称',
`spu_id` int not null default 0 comment 'spuId',
`sku_id` int not null default 0 comment 'skuId',
`quantity` int not null default 0 comment '数量',
`create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(0) NULL DEFAULT NULL COMMENT '创建部门',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`status` int(0) NULL DEFAULT NULL COMMENT '状态',
`is_deleted` int(0) NULL DEFAULT 0 COMMENT '是否已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '商城购物车'
ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `mall_summary_order`;
create table `mall_summary_order`
(
`id` bigint NOT NULL COMMENT '主键',
`user_id` bigint not null default 0 comment '用户id',
`products_info` json null default null comment '商品信息',
`order_info` json null default null comment '订单信息',
`confirm_info` json null default null comment '订单确认信息',
`vendor_regions_id` bigint not null comment '地区id',
`address_id` bigint not null comment '地址id',
`third_serial_no` varchar(200) not null default '' comment '第三方流水号',
`delivery_info` json null comment '快递信息',
`freight_amount` decimal(10, 2) not null default 0.00 comment '运费',
`cost_amount` decimal(10, 2) not null default 0.00 comment '订单成本',
`order_amount` decimal(10, 2) not null default 0.00 comment '订单金额',
`total_amount` decimal(10, 2) not null default 0.00 comment '总金额',
`actual_amount` decimal(10, 2) not null default 0.00 comment '实际支付',
`extra_amount` decimal(10, 2) not null default 0.00 comment '组合支付金额',
`payment_type` int not null default 0 comment '支付类型',
`extra_type` int not null default 0 comment '附加支付类型',
`payment_status` int not null default 0 comment '支付状态',
`payment_completed_time` datetime null comment '支付完成时间',
`payment_track` varchar(200) not null default '' comment '支付凭证',
`expire_time` datetime null comment '超时时间',
`remarks` varchar(200) not null default '' comment '备注',
`version` bigint null default 0,
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`status` int NULL DEFAULT 0 COMMENT '状态',
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '商城汇总订单'
ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `mall_detail_order`;
create table `mall_detail_order`
(
`id` bigint NOT NULL COMMENT '主键',
`user_id` bigint not null default 0 comment '用户id',
`summary_order_id` bigint not null default 0 comment '主订单id',
`spu_id` int not null default 0 comment 'spu id',
`spu_sn` varchar(100) not null default '' comment 'spu sn',
`sku_id` int not null default 0 comment 'sku id',
`sku_sn` varchar(100) not null default '' comment 'sku sn',
`quantity` int not null default 0 comment '数量',
`sku_snapshot` json null comment '商品快照',
`actual_cost_amount` decimal(10, 2) not null default 0.00 comment '实际成本',
`cost_amount` decimal(10, 2) not null default 0.00 comment '订单成本',
`extra_amount` decimal(10, 2) not null default 0.00 comment '组合支付金额',
`actual_amount` decimal(10, 2) not null default 0.00 comment '实际支付',
`given_amount` decimal(10, 2) not null default 0.00 comment '消费豆赠送金额',
`remarks` varchar(200) not null default '' comment '备注',
`version` bigint null default 0,
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`status` int NULL DEFAULT -1 COMMENT '状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结',
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_user_id` (`user_id`) USING BTREE,
KEY `idx_summary_order_id` (`summary_order_id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '商城详情订单'
ROW_FORMAT = Dynamic;
drop table if exists mall_spu;
create table mall_spu
(
goods_id int default 0 not null comment '商品id',
supply_type int default 0 not null comment '渠道(1京东,2星链,3测试,4云商特卖 ,5厂商特卖,6天猫,7微唯宝特卖,8云链专供,9三方仓储,10华南一仓,11华南二仓)',
spu_sn varchar(255) default '' not null comment '商品编码',
spu_name varchar(255) default '' not null comment '商品名称',
main_img varchar(255) default '' not null comment '主图',
detail_img json null comment '详情图',
brand_name varchar(255) default '' not null comment '品牌名称',
cate_id varchar(255) default '' not null comment 'cate_id分类',
cate_ids varchar(255) default '' not null comment 'cate_id分类',
limit_num int default 0 not null comment '限购数量',
lowest_num int default 0 not null comment '起售数量(单个规格的起购数不能代表整个商品的起购数,具体起购数量查询sku详情接口)',
cost_price decimal(10, 2) default 0.00 not null comment '成本价',
retail_price decimal(10, 2) default 0.00 not null comment '销售价',
profit decimal(10, 2) default 0.00 not null comment '利润',
floor_price decimal(10, 2) default 0.00 not null comment '最低价',
no_deliver varchar(255) default '' not null comment '非配送地区(多个值,逗号分割)',
top_img json null comment '顶图',
bottom_img json null comment '底图',
update_time datetime null comment '修改时间',
status int default 0 null comment '状态(0=下架,1=上架,3=删除)',
PRIMARY KEY (`goods_id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '商城spu'
ROW_FORMAT = Dynamic;
drop table if exists mall_sku;
create table mall_sku
(
sku_id int default 0 not null comment 'id',
supply_type int default 0 not null comment '渠道(1京东,2星链,3测试,4云商特卖 ,5厂商特卖,6天猫,7微唯宝特卖,8云链专供,9三方仓储,10华南一仓,11华南二仓)',
goods_id int default 0 not null comment '商品id',
spu_sn varchar(255) default '' not null comment '商品编码',
sku_sn varchar(255) default '' not null comment '商品编码',
sku_name varchar(255) default '' not null comment '商品名称',
main_img varchar(255) default '' not null comment '主图',
detail_img json null comment '详情图',
attr json null comment '属性',
lowest_num int default 0 not null comment '起售数量',
status int default 0 null comment '状态(0=下架,1=上架,3=删除)',
cost_price decimal(10, 2) default 0.00 not null comment '成本价',
retail_price decimal(10, 2) default 0.00 not null comment '销售价',
floor_price decimal(10, 2) default 0.00 not null comment '最低价',
profit decimal(10, 2) default 0.00 not null comment '利润',
PRIMARY KEY (`sku_id`) USING BTREE,
INDEX `idx_goods_id` (`goods_id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '商城sku'
ROW_FORMAT = Dynamic;

29
doc/sql/order.sql Normal file
View File

@@ -0,0 +1,29 @@
DROP TABLE IF EXISTS `user_order`;
CREATE TABLE `user_order`
(
`id` bigint(20) NOT NULL COMMENT '主键',
`user_id` bigint(20) not null default 0 comment '用户id',
`order_type` int(2) not null default 0 comment '订单类型',
`order_id` bigint(20) not null default 0 comment '订单id',
`title` varchar(50) not null default '' comment '订单名称',
`description` varchar(200) not null default '' comment '订单描述',
`order_status` int(2) not null default 0 comment '订单状态',
`amount` decimal(10, 2) not null default 0.00 comment '订单金额',
`actual_amount` decimal(10, 2) not null default 0.00 comment '实际支付金额',
`payment_type` int(2) not null default 0 comment '支付方式',
`payment_time` datetime null default null comment '支付时间',
`payment_track` varchar(255) not null default '' comment '支付凭证编号',
`payment_status` int(2) not null default 0 comment '支付状态',
`create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(0) NULL DEFAULT NULL COMMENT '创建部门',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`status` int(0) NULL DEFAULT NULL COMMENT '状态',
`is_deleted` int(0) NULL DEFAULT NULL COMMENT '是否已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '用户订单'
ROW_FORMAT = Dynamic;

37
doc/sql/system_region.sql Normal file

File diff suppressed because one or more lines are too long