-- ----------------------------
-- Table structure for qimall_addons_huiju_bill_order
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_huiju_bill_order`;
CREATE TABLE `qimall_addons_huiju_bill_order`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `mall_id` int(10) NOT NULL DEFAULT 0,
  `merchant_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分账方账号',
  `trade_id` int(10) NOT NULL DEFAULT 0 COMMENT '支付流水ID',
  `trade_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分账支付类型',
  `sys_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '系统支付订单号',
  `trx_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '汇聚分账支付订单号',
  `fee` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '手续费',
  `status` int(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '100:成功，101:失败，102:已创建',
  `updated_at` int(10) NULL DEFAULT 0,
  `created_at` int(10) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_mall_id`(`mall_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '汇聚分账支付流水表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_huiju_bill_order_refund
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_huiju_bill_order_refund`;
CREATE TABLE `qimall_addons_huiju_bill_order_refund`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NOT NULL DEFAULT 0,
  `refund_id` int(10) NOT NULL DEFAULT 0 COMMENT '退款订单ID',
  `sys_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '中台退款订单号',
  `trx_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '汇聚退款订单号',
  `out_trade_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付流水订单号',
  `status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '100:成功，101:失败，102:已创建',
  `refund_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '售后订单号',
  `refund_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '退款金额',
  `refund_at` int(10) NOT NULL DEFAULT 0 COMMENT '退款成功时间',
  `updated_at` int(10) NOT NULL DEFAULT 0,
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_mall_id`(`mall_id`) USING BTREE,
  INDEX `index_refund_order_no`(`refund_order_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '汇聚分账支付退款记录表' ROW_FORMAT = Dynamic;
