/*
 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: 16/07/2025 13:59:35
*/

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 (31, 'smile01', '9890001', 'MyBatisBook', '376456387082', '2025-07-16 13:47:35', 100.00, 'DEAL_DONE', '<form name=\"punchout_form\" method=\"post\" action=\"https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.page.pay&sign=QiS6Ss9WVG45w4G85WPEw8D7TLbahtqfJQ8M%2BtPGI4FGP0njFMLDamSWT%2B5H67mZlEJjO%2F03a0kZ%2Fs4eg2bsX2ZAn8hzFyUPNHIbAfNikjnlWPxVBT1ageB3zmc95xP9r%2BtGRnuPqryxSs1FzKQjqbQJJRWXxdQE%2FEHjq5bc6zTODbiDMk%2B8hhy104FlM%2BPiT4SKKOfAgtHI2rFruW%2B6rlIHdxsI5roHvq650uDQ0Ir%2BqTZ46FP%2Fv2RpNfmOp1pR8%2BJ4NAZlti8wng0AzWVkl7xUdsgBQ%2BD9Bja57Lt8pZC1SI0%2BrV0HOU0H%2F8AkuVvdCzAPgwUrzaPkYexrsH6a2g%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-16+13%3A47%3A35&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;376456387082&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-07-16 13:50:29', 1, 20.00, 80.00, '2025-07-16 13:47:35', '2025-07-16 13:58:39');
INSERT INTO `pay_order` VALUES (32, 'smile02', '9890001', 'MyBatisBook', '503529040337', '2025-07-16 13:55:51', 100.00, 'DEAL_DONE', '<form name=\"punchout_form\" method=\"post\" action=\"https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.page.pay&sign=l1%2FB5WhTnlHDBZGCmFD62mNUQZSGPISW0ny%2F%2Btxju2Mx0m8Ju%2B80cy43YPNGb5Law80EaByVO9O90S5yJ5qIa4%2FMWNHdcrpoVpdaoiuSwa8FvHAZYA65KM6nB7fe1ESy4Q3xOVYi9TS7TFhg5feSbrCe%2F48jfs0A7GxFzZuioQPXb8fFlTpQhm0w4bsUwYf5YfNKxUUNQn%2BK%2FMT2QMBsEceCT0%2FJn5OM2Yl1IufMvdkMsZVQLdN5%2BxsDP%2BabPTxmV%2BGB0gshWT9mHlfRONqxEbqkug99CmqxQKy9GEnKDZFCdkSknAI3ukS14cflpJB84Vq4Pb1m5ZA8AyCbcUUlYQ%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-16+13%3A55%3A51&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;503529040337&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-07-16 13:56:47', 1, 20.00, 80.00, '2025-07-16 13:55:50', '2025-07-16 13:58:39');
INSERT INTO `pay_order` VALUES (33, 'smile03', '9890001', 'MyBatisBook', '274640446882', '2025-07-16 13:57:47', 100.00, 'DEAL_DONE', '<form name=\"punchout_form\" method=\"post\" action=\"https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.page.pay&sign=aeJrx00JaoiPo%2Bd%2BelwPekikVqqcT0UjTQluUAWGtxia0Zp9BuzIljU%2BOrQtBj9vhV9cfh1qFxh4%2BGqpTyJN0ZTTPoQa1U4tT1UE2be5JKcV%2BKFtXfpSL%2BFHx7oPLoqXUnhksF5Q8h82n680LVt%2FFGfwo4mBKuFzJ%2FX1libjCzFwdcIHvosESbClSHb5hmNSyWSmyh4UZra9wvaofUjZvrE2%2FhEYIK01Sl9cTXFvmnCHaGLdKgBPUYdx5zVQryKuV%2BfZgDw9s7kEjPommlx3s0XK0tFb8dmitYc%2FdFvVDjDTJ8YE4PuFDedG2qtmOgJ%2BteXfrUHjWwfsMLTuor9elA%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-16+13%3A57%3A47&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;274640446882&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-07-16 13:58:39', 1, 20.00, 80.00, '2025-07-16 13:57:47', '2025-07-16 13:58:40');

SET FOREIGN_KEY_CHECKS = 1;
