/*
 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: 13/07/2025 14:21:55
*/

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 '支付时间',
                              `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 = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pay_order
-- ----------------------------
INSERT INTO `pay_order` VALUES (5, 'smile01', '10001', '测试商品', '51403944017404', '2025-07-12 05:49:16', 1.68, '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=Af8UHbR23xcDThup0mv3NVZLlkMAcQ3tjmqGNBpwYqJ1Xn1ytqt42NWBsbDxKHT3rEo3h3dmd60wJ9N0LTmjElq%2B9HGFukp7KtxOiZRlbxip9x9yl4mCjQTUunf6l7iMsUAAtBUh%2FiVJOsI7Uy4Jy8Fg7fqjRAjc06fKcsynU5wb3xtOhr9f8uQIpe7ykxLg3Uc6YyR9GYdTcceVRu15BoSur6xz4S%2FMhRTOqc8XbWrqBGhvWMk%2BV6FHbx04AHYg7HHc0%2FTndoIHFSX9c1h7Jysxbyxp3q40GMfrnpX53VkqcPpQBbLA8f%2BWO8MnzbnxobeKcXAR11gxSbl4FcEWng%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-13+14%3A21%3A33&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;51403944017404&quot;,&quot;total_amount&quot;:&quot;1.68&quot;,&quot;subject&quot;:&quot;测试商品&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, '2025-07-12 13:49:15', '2025-07-13 14:21:33');
INSERT INTO `pay_order` VALUES (6, '10001', '10001', '测试商品', '66665553128265', '2025-07-13 06:19:11', 1.68, '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=lQ1WTro6vDXTQet%2Bd%2BJ7TWIIWXF%2B5SWg0r53joEBUesQL12UtgHrWa%2BafAwjkJWxH9zPqwAvFuXr1ZFfmMnqz1PTsRXo4ACTAJC0Se2uFSYAU1HK8Cyk4jHh9OwEjW1MQXdWT1l52KjLuZOBeJAlUvVPyAfxQnBx0HF2XKHEfFLFBgeRufAp%2BEzCM%2BoX8l0G%2FkQdskCRhICLMh2tFj2T4i4sgsSwuJQDV%2Fs0EOwpDpDKV3Z9xPEzkI2zZM6ZB8jCfTa734H8%2BC9IWZmKX2njnNj89g4h9RVuLd92l0veNn%2FJmrxTz296eCWJl6yU5PLSB0pX0IiSnUoHiySFnrswaA%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-13+14%3A19%3A11&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;66665553128265&quot;,&quot;total_amount&quot;:&quot;1.68&quot;,&quot;subject&quot;:&quot;测试商品&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, '2025-07-13 14:19:11', '2025-07-13 14:21:21');

SET FOREIGN_KEY_CHECKS = 1;
