/*
 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: 07/08/2025 16:04:33
*/

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 = 46 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of pay_order
-- ----------------------------
INSERT INTO `pay_order` VALUES (49, 'smile01', '9890001', 'MyBatisBook', '651958626376', '2025-08-07 16:03:13', 100.00, 'PAY_SUCCESS', '<form name=\"punchout_form\" method=\"post\" action=\"https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.page.pay&sign=A27cwepfWTkwyKG1o2dIrJg8O8cBdIUzOHzN8dtc2A0G4qVG8Z5UULUn25VSSz0zODhOu5H%2FWWc9RGJMlyREHrQ5up2f6PqMH%2FUOulBgBWdmm6ob3qo8lEGExhSeN%2B0jDzfCmS3nql88IU4rgWgl8BTwmliwDIHzVa7MZZyY2U3LWWAVYLw8guKcJYs%2FQf79GzTnx7yroJdFBuxC6XQ15cOdexrW%2F0Bz4ylKmPf0u6Cu5sMZ4Kw3fLd1t29igOPxFrb4stiYpJ6LLJxGnpcYyAbiqIGj%2B7IwR9M877QrGh9jhD8%2FchbuiYykx%2BLpzoFPDktKH2NQA88lPq84SbkwBw%3D%3D&return_url=http%3A%2F%2Flocalhost%3A63342%2Fgroup-buying-sys%2Fdocs%2Fdev-ops%2Fnginx%2Fhtml%2Findex.html&notify_url=http%3A%2F%2F127.0.0.1%3A8092%2Fapi%2Fv1%2Falipay%2Falipay_notify_url&version=1.0&app_id=9021000150645052&sign_type=RSA2&timestamp=2025-08-07+16%3A03%3A13&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;651958626376&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>', '2025-08-07 16:04:20', 1, 20.00, 80.00, '2025-08-07 16:03:13', '2025-08-07 16:04:20');

SET FOREIGN_KEY_CHECKS = 1;
