/*
 Navicat Premium Data Transfer

 Source Server         : group_buy_local
 Source Server Type    : MySQL
 Source Server Version : 80042
 Source Host           : localhost:13306
 Source Schema         : pay-mall

 Target Server Type    : MySQL
 Target Server Version : 80042
 File Encoding         : 65001

 Date: 15/07/2025 14:36:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for pay_order
-- ----------------------------
DROP TABLE IF EXISTS `pay_order`;
CREATE TABLE `pay_order`  (
                              `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增ID',
                              `user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户ID',
                              `product_id` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '商品ID',
                              `product_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '商品名称',
                              `order_id` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '订单ID',
                              `order_time` datetime NOT NULL COMMENT '下单时间',
                              `total_amount` decimal(8, 2) UNSIGNED NULL DEFAULT NULL COMMENT '订单金额',
                              `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '订单状态；create-创建完成、pay_wait-等待支付、pay_success-支付成功、deal_done-交易完成、close-订单关单',
                              `pay_url` varchar(2014) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '支付信息',
                              `pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
                              `market_type` tinyint(1) NULL DEFAULT NULL COMMENT '营销类型；0无营销、1拼团营销',
                              `market_deduction_amount` decimal(8, 2) NULL DEFAULT NULL COMMENT '营销金额；优惠金额',
                              `pay_amount` decimal(8, 2) NOT NULL COMMENT '支付金额',
                              `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                              `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                              PRIMARY KEY (`id`) USING BTREE,
                              UNIQUE INDEX `uq_order_id`(`order_id` ASC) USING BTREE,
                              INDEX `idx_user_id_product_id`(`user_id` ASC, `product_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of pay_order
-- ----------------------------
INSERT INTO `pay_order` VALUES (18, 'smile02', '9890001', 'MyBatisBook', '855240590150', '2025-07-15 06:35:57', 100.00, 'PAY_WAIT', '<form name=\"punchout_form\" method=\"post\" action=\"https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.page.pay&sign=qPjHpyXTrmdn%2BGc4H4tqQ0i8MakJ%2BmNNAASwHRwizg0KEQ0YksmQyub3q4IzVOUjkRGj1HuxUdIgKLfJg9h%2F%2B%2FRuVXRa4DNCMw1dUmFXhH2sThvzbRGPAUaR2Nb2B0TAr77X6aDu%2FzWxhLHCkRf2mTaAGoKhuhySf6gxZeJp7Izwu9kka4wlzD1M08KHPWzmrszyJbcH%2BwJsrPHe%2B82%2B9GkJw0pi10nVX9BBPp6ss17zlYgbk8Sg4EWAIEaNZ46RxUDPznPhHNM%2FXY2awBHfNTqbY17eY%2Bu8Tl9nVnKpNXIBiKgG3SlMA0FEi1%2FTjNMkiQPfYr9YcCGwzQWdPJwQxQ%3D%3D&return_url=https%3A%2F%2Fblog.bitday.top&notify_url=https%3A%2F%2Fpay.bitday.top%2Fapi%2Fv1%2Falipay%2Falipay_notify_url&version=1.0&app_id=9021000150645052&sign_type=RSA2&timestamp=2025-07-15+14%3A35%3A57&alipay_sdk=alipay-sdk-java-4.38.157.ALL&format=json\">\n<input type=\"hidden\" name=\"biz_content\" value=\"{&quot;out_trade_no&quot;:&quot;855240590150&quot;,&quot;total_amount&quot;:80.00,&quot;subject&quot;:&quot;MyBatisBook&quot;,&quot;product_code&quot;:&quot;FAST_INSTANT_TRADE_PAY&quot;}\">\n<input type=\"submit\" value=\"立即支付\" style=\"display:none\" >\n</form>\n<script>document.forms[0].submit();</script>', NULL, 1, 20.00, 80.00, '2025-07-15 14:35:56', '2025-07-15 14:35:57');

SET FOREIGN_KEY_CHECKS = 1;
