cyywl_server/sql/optional/mall/order.sql

77 lines
6.8 KiB
Java
Raw Normal View History

2022-08-26 17:47:43 +08:00
/**todo cancelType 设置默认值 0?*/
CREATE TABLE `trade_order`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
`sn` varchar(32) NOT NULL COMMENT '',
`type` int NOT NULL DEFAULT '0' COMMENT '[0: 1: 2: 3:]',
`terminal` int NOT NULL COMMENT '[1: 2:H5 3:iOS 4:]',
`user_id` bigint unsigned NOT NULL COMMENT '',
`user_ip` varchar(30) NOT NULL DEFAULT '' COMMENT ' IP',
`user_remark` varchar(200) DEFAULT NULL COMMENT '',
`status` int NOT NULL DEFAULT '0' COMMENT '[0: 1: 2: 3: 4:]',
`product_count` int NOT NULL COMMENT '',
`cancel_type` int NOT NULL COMMENT '[10: 20:退 30: 40:]',
`remark` varchar(200) DEFAULT NULL COMMENT '',
`payed` bit(1) NOT NULL DEFAULT b'0' COMMENT '[0: 1:]',
`finish_time` datetime DEFAULT NULL COMMENT '',
`cancel_time` datetime DEFAULT NULL COMMENT '',
`sku_original_price` int NOT NULL DEFAULT '0' COMMENT '',
`sku_promotion_price` int NOT NULL DEFAULT '0' COMMENT '',
`order_promotion_price` int NOT NULL DEFAULT '0' COMMENT '',
`delivery_price` int NOT NULL DEFAULT '0' COMMENT '',
`pay_price` int NOT NULL DEFAULT '0' COMMENT '',
`pay_order_id` int NOT NULL COMMENT '',
`pay_channel` int NOT NULL COMMENT '',
`delivery_type` int NOT NULL DEFAULT '1' COMMENT ':[1: 2:]',
`actual_delivery_type` int NOT NULL DEFAULT '1' COMMENT ':[1: 2:]',
`delivery_templateid` int DEFAULT NULL COMMENT '',
`express_no` int DEFAULT NULL COMMENT '',
`delivery_status` bit(1) NOT NULL DEFAULT b'0' COMMENT '[0: 1:]',
`delivery_time` datetime DEFAULT NULL COMMENT '',
`receive_time` datetime DEFAULT NULL COMMENT '',
`receiver_name` varchar(20) NOT NULL COMMENT '',
`receiver_mobile` varchar(20) NOT NULL COMMENT '',
`receiver_area_id` int NOT NULL COMMENT '',
`receiver_post_code` int DEFAULT NULL COMMENT '',
`receiver_detail_address` varchar(255) NOT NULL COMMENT '',
`refund_status` int NOT NULL DEFAULT '0' COMMENT '[0:退 1:退 2:退]',
`refund_price` int NOT NULL DEFAULT '0' COMMENT '退',
`coupon_id` bigint unsigned NOT NULL COMMENT '',
`creator` varchar(64) DEFAULT '' COMMENT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`updater` varchar(64) DEFAULT '' COMMENT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB COMMENT ='';
DROP TABLE IF EXISTS `trade_order_item`;
CREATE TABLE `trade_order_item`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
`user_id` bigint unsigned NOT NULL COMMENT '',
`order_Id` bigint unsigned NOT NULL COMMENT '',
`spu_id` bigint unsigned NOT NULL COMMENT ' SPU ',
`sku_id` bigint unsigned NOT NULL COMMENT ' SKU ',
`properties` json DEFAULT NULL COMMENT 'JSON ',
`name` varchar(128) NOT NULL DEFAULT '' COMMENT '',
`pic_url` varchar(200) DEFAULT NULL COMMENT '',
`count` int NOT NULL COMMENT '',
`commented` bit(1) NOT NULL DEFAULT b'0' COMMENT '[0: 1:]',
`original_price` int NOT NULL DEFAULT '0' COMMENT '',
`total_original_price` int NOT NULL DEFAULT '0' COMMENT '',
`total_promotion_price` int NOT NULL DEFAULT '0' COMMENT '',
`present_price` int NOT NULL DEFAULT '0' COMMENT '',
`total_present_price` int NOT NULL DEFAULT '0' COMMENT '',
`total_pay_price` int NOT NULL DEFAULT '0' COMMENT '',
`refund_status` int NOT NULL DEFAULT '0' COMMENT '退:[0:退 1:退 2:退 3:退]',
`refund_total` int NOT NULL DEFAULT '0' COMMENT '退',
`creator` varchar(64) DEFAULT '' COMMENT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`updater` varchar(64) DEFAULT '' COMMENT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '',
PRIMARY KEY (`id`) USING BTREE
2022-09-05 20:44:04 +08:00
) ENGINE = InnoDB COMMENT ='';