-- ---------------------------- -- 0、 xxx -- ---------------------------- -- create table xxx -- ( -- post_id bigint(20) not null auto_increment comment '岗位ID', -- post_code varchar(64) not null comment '岗位编码', -- primary key (post_id) -- ) engine=innodb comment = 'xxxx'; CREATE TABLE `mall_product` ( `id` bigint NOT NULL COMMENT 'ID', `product_id` bigint NOT NULL COMMENT '商品ID', `product_name` varchar(100) NOT NULL COMMENT '商品名称', `detail` blob NOT NULL COMMENT '商品详情', `model` varchar(100) NOT NULL COMMENT '商品规格', `amount` decimal(10, 3) NOT NULL COMMENT '金额', `name` varchar(60) NOT NULL COMMENT '图片名称', `url` varchar(200) NOT NULL COMMENT '图片url', `create_by` varchar(64) DEFAULT '' COMMENT '创建者', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) DEFAULT '' COMMENT '更新者', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `remark` varchar(500) DEFAULT NULL COMMENT '备注', `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品表'; CREATE TABLE `mall_index_product` ( `id` bigint NOT NULL COMMENT 'ID', `product_id` bigint NOT NULL COMMENT '商品ID', `sort` int NOT NULL DEFAULT '999' COMMENT '排序', `type` int NOT NULL COMMENT '模型类型 1: 热门模型 2: 最新模型 3:推荐模型', `create_by` varchar(64) DEFAULT '' COMMENT '创建者', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) DEFAULT '' COMMENT '更新者', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `remark` varchar(500) DEFAULT NULL COMMENT '备注', `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='首页商品'; CREATE TABLE `mall_product_comment` ( `id` bigint NOT NULL COMMENT 'ID', `parent_id` bigint NOT NULL DEFAULT '0' COMMENT '父评论ID', `product_id` bigint NOT NULL COMMENT '商品ID', `user_id` bigint NOT NULL COMMENT '用户ID', `content` varchar(500) NOT NULL COMMENT '评论内容', `rating` int NOT NULL COMMENT '评分', `create_by` varchar(64) DEFAULT '' COMMENT '创建者', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) DEFAULT '' COMMENT '更新者', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `remark` varchar(500) DEFAULT NULL COMMENT '备注', `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品评论表'; CREATE TABLE `order_trade` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', `code` varchar(30) NOT NULL COMMENT '订单编码', `user_id` bigint NOT NULL COMMENT '用户ID', `product_id` bigint NOT NULL COMMENT '商品ID', `product_name` varchar(60) NOT NULL COMMENT '商品名称', `user_name` varchar(30) NOT NULL COMMENT '用户名称', `order_time` datetime(3) DEFAULT NULL COMMENT '下单时间', `order_status` int NOT NULL COMMENT '订单状态 1:下单 2:支付 3:完成 4:取消', `pay_status` int NOT NULL COMMENT '支付状态 1:待支付 2:已支付 3:退款', `total_amount` decimal(10, 3) NOT NULL COMMENT '总金额', `payment_amount` decimal(10, 3) NOT NULL COMMENT '付款金额', `create_by` varchar(64) DEFAULT '' COMMENT '创建者', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) DEFAULT '' COMMENT '更新者', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `remark` varchar(500) DEFAULT NULL COMMENT '备注', `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1798708644507918337 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';