-- 导入脚本按 UTF-8 解析，避免中文注释/数据乱码（需文件本身以 UTF-8 保存）
SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

START TRANSACTION;

SET time_zone = "+00:00";

USE bdrp;
--

-- --------------------------------------------------------

--
-- 表的结构 `admin_api`
--

CREATE TABLE `admin_api` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `api_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '接口名称',
    `api_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '接口编码',
    `method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '请求方法：GET、POST等',
    `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '接口URL',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
    `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '接口描述'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '接口表';

--
-- 转存表中的数据 `admin_api`
--

INSERT INTO
    `admin_api` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `api_name`,
        `api_code`,
        `method`,
        `url`,
        `status`,
        `description`
    )
VALUES (
        1,
        '2025-09-30 17:52:12',
        '2025-09-30 17:52:12',
        NULL,
        0,
        0,
        'agent-commission-deduction-列表',
        'get__api_v1_admin_agent_agent-commission-deduction_list',
        'GET',
        '/api/v1/admin/agent/agent-commission-deduction/list',
        1,
        '查询agent-commission-deduction-列表'
    ),
    (
        2,
        '2025-09-30 17:52:12',
        '2025-09-30 17:52:12',
        NULL,
        0,
        0,
        'agent-commission-列表',
        'get__api_v1_admin_agent_agent-commission_list',
        'GET',
        '/api/v1/admin/agent/agent-commission/list',
        1,
        '查询agent-commission-列表'
    ),
    (
        3,
        '2025-09-30 17:52:12',
        '2025-09-30 17:52:12',
        NULL,
        0,
        0,
        'agent-link-列表',
        'get__api_v1_admin_agent_agent-link_list',
        'GET',
        '/api/v1/admin/agent/agent-link/list',
        1,
        '查询agent-link-列表'
    ),
    (
        4,
        '2025-09-30 17:52:12',
        '2025-09-30 17:52:12',
        NULL,
        0,
        0,
        'agent-membership-config-列表',
        'get__api_v1_admin_agent_agent-membership-config_list',
        'GET',
        '/api/v1/admin/agent/agent-membership-config/list',
        1,
        '查询agent-membership-config-列表'
    ),
    (
        5,
        '2025-09-30 17:52:12',
        '2025-09-30 17:52:12',
        NULL,
        0,
        0,
        'agent-membership-config-更新',
        'post__api_v1_admin_agent_agent-membership-config_update',
        'POST',
        '/api/v1/admin/agent/agent-membership-config/update',
        1,
        '创建agent-membership-config-更新'
    ),
    (
        6,
        '2025-09-30 17:52:12',
        '2025-09-30 17:52:12',
        NULL,
        0,
        0,
        'agent-membership-recharge-order-列表',
        'get__api_v1_admin_agent_agent-membership-recharge-order_list',
        'GET',
        '/api/v1/admin/agent/agent-membership-recharge-order/list',
        1,
        '查询agent-membership-recharge-order-列表'
    ),
    (
        7,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'agent-platform-deduction-列表',
        'get__api_v1_admin_agent_agent-platform-deduction_list',
        'GET',
        '/api/v1/admin/agent/agent-platform-deduction/list',
        1,
        '查询agent-platform-deduction-列表'
    ),
    (
        8,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'agent-production-config-列表',
        'get__api_v1_admin_agent_agent-production-config_list',
        'GET',
        '/api/v1/admin/agent/agent-production-config/list',
        1,
        '查询agent-production-config-列表'
    ),
    (
        9,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'agent-production-config-更新',
        'post__api_v1_admin_agent_agent-production-config_update',
        'POST',
        '/api/v1/admin/agent/agent-production-config/update',
        1,
        '创建agent-production-config-更新'
    ),
    (
        10,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'agent-reward-列表',
        'get__api_v1_admin_agent_agent-reward_list',
        'GET',
        '/api/v1/admin/agent/agent-reward/list',
        1,
        '查询agent-reward-列表'
    ),
    (
        11,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'agent-withdrawal-列表',
        'get__api_v1_admin_agent_agent-withdrawal_list',
        'GET',
        '/api/v1/admin/agent/agent-withdrawal/list',
        1,
        '查询agent-withdrawal-列表'
    ),
    (
        12,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '代理管理-列表',
        'get__api_v1_admin_agent_list',
        'GET',
        '/api/v1/admin/agent/list',
        1,
        '查询代理管理-列表'
    ),
    (
        13,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-batch-update-status',
        'put__api_v1_admin_api_batch-update-status',
        'PUT',
        '/api/v1/admin/api/batch-update-status',
        1,
        '更新api-batch-update-status'
    ),
    (
        14,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-创建',
        'post__api_v1_admin_api_create',
        'POST',
        '/api/v1/admin/api/create',
        1,
        '创建api-创建'
    ),
    (
        15,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_api_delete',
        'DELETE',
        '/api/v1/admin/api/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        16,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_api_detail',
        'GET',
        '/api/v1/admin/api/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        17,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-列表',
        'get__api_v1_admin_api_list',
        'GET',
        '/api/v1/admin/api/list',
        1,
        '查询api-列表'
    ),
    (
        18,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_api_update',
        'PUT',
        '/api/v1/admin/api/update/:id',
        1,
        '更新update-:id'
    ),
    (
        19,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '功能管理-config-example',
        'post__api_v1_admin_feature_config-example',
        'POST',
        '/api/v1/admin/feature/config-example',
        1,
        '创建功能管理-config-example'
    ),
    (
        20,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '功能管理-创建',
        'post__api_v1_admin_feature_create',
        'POST',
        '/api/v1/admin/feature/create',
        1,
        '创建功能管理-创建'
    ),
    (
        21,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_feature_delete',
        'DELETE',
        '/api/v1/admin/feature/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        22,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_feature_detail',
        'GET',
        '/api/v1/admin/feature/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        23,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'example-:feature_id',
        'get__api_v1_admin_feature_example',
        'GET',
        '/api/v1/admin/feature/example/:feature_id',
        1,
        '查询example-:feature_id'
    ),
    (
        24,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '功能管理-列表',
        'get__api_v1_admin_feature_list',
        'GET',
        '/api/v1/admin/feature/list',
        1,
        '查询功能管理-列表'
    ),
    (
        25,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_feature_update',
        'PUT',
        '/api/v1/admin/feature/update/:id',
        1,
        '更新update-:id'
    ),
    (
        26,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '菜单管理-all',
        'get__api_v1_admin_menu_all',
        'GET',
        '/api/v1/admin/menu/all',
        1,
        '查询菜单管理-all'
    ),
    (
        27,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '菜单管理-创建',
        'post__api_v1_admin_menu_create',
        'POST',
        '/api/v1/admin/menu/create',
        1,
        '创建菜单管理-创建'
    ),
    (
        28,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_menu_delete',
        'DELETE',
        '/api/v1/admin/menu/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        29,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_menu_detail',
        'GET',
        '/api/v1/admin/menu/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        30,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '菜单管理-列表',
        'get__api_v1_admin_menu_list',
        'GET',
        '/api/v1/admin/menu/list',
        1,
        '查询菜单管理-列表'
    ),
    (
        31,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_menu_update',
        'PUT',
        '/api/v1/admin/menu/update/:id',
        1,
        '更新update-:id'
    ),
    (
        32,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '通知管理-创建',
        'post__api_v1_admin_notification_create',
        'POST',
        '/api/v1/admin/notification/create',
        1,
        '创建通知管理-创建'
    ),
    (
        33,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_notification_delete',
        'DELETE',
        '/api/v1/admin/notification/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        34,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_notification_detail',
        'GET',
        '/api/v1/admin/notification/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        35,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '通知管理-列表',
        'get__api_v1_admin_notification_list',
        'GET',
        '/api/v1/admin/notification/list',
        1,
        '查询通知管理-列表'
    ),
    (
        36,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_notification_update',
        'PUT',
        '/api/v1/admin/notification/update/:id',
        1,
        '更新update-:id'
    ),
    (
        37,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '订单管理-创建',
        'post__api_v1_admin_order_create',
        'POST',
        '/api/v1/admin/order/create',
        1,
        '创建订单管理-创建'
    ),
    (
        38,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_order_delete',
        'DELETE',
        '/api/v1/admin/order/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        39,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_order_detail',
        'GET',
        '/api/v1/admin/order/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        40,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '订单管理-列表',
        'get__api_v1_admin_order_list',
        'GET',
        '/api/v1/admin/order/list',
        1,
        '查询订单管理-列表'
    ),
    (
        41,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'refund-:id',
        'post__api_v1_admin_order_refund',
        'POST',
        '/api/v1/admin/order/refund/:id',
        1,
        '创建refund-:id'
    ),
    (
        42,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_order_update',
        'PUT',
        '/api/v1/admin/order/update/:id',
        1,
        '更新update-:id'
    ),
    (
        43,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '平台用户-创建',
        'post__api_v1_admin_platform_user_create',
        'POST',
        '/api/v1/admin/platform_user/create',
        1,
        '创建平台用户-创建'
    ),
    (
        44,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_platform_user_delete',
        'DELETE',
        '/api/v1/admin/platform_user/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        45,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_platform_user_detail',
        'GET',
        '/api/v1/admin/platform_user/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        46,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '平台用户-列表',
        'get__api_v1_admin_platform_user_list',
        'GET',
        '/api/v1/admin/platform_user/list',
        1,
        '查询平台用户-列表'
    ),
    (
        47,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_platform_user_update',
        'PUT',
        '/api/v1/admin/platform_user/update/:id',
        1,
        '更新update-:id'
    ),
    (
        48,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '产品管理-创建',
        'post__api_v1_admin_product_create',
        'POST',
        '/api/v1/admin/product/create',
        1,
        '创建产品管理-创建'
    ),
    (
        49,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_product_delete',
        'DELETE',
        '/api/v1/admin/product/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        50,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_product_detail',
        'GET',
        '/api/v1/admin/product/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        51,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'list-:product_id',
        'get__api_v1_admin_product_feature_list',
        'GET',
        '/api/v1/admin/product/feature/list/:product_id',
        1,
        '查询list-:product_id'
    ),
    (
        52,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:product_id',
        'put__api_v1_admin_product_feature_update',
        'PUT',
        '/api/v1/admin/product/feature/update/:product_id',
        1,
        '更新update-:product_id'
    ),
    (
        53,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '产品管理-列表',
        'get__api_v1_admin_product_list',
        'GET',
        '/api/v1/admin/product/list',
        1,
        '查询产品管理-列表'
    ),
    (
        54,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_product_update',
        'PUT',
        '/api/v1/admin/product/update/:id',
        1,
        '更新update-:id'
    ),
    (
        55,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'link-创建',
        'post__api_v1_admin_promotion_link_create',
        'POST',
        '/api/v1/admin/promotion/link/create',
        1,
        '创建link-创建'
    ),
    (
        56,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_promotion_link_delete',
        'DELETE',
        '/api/v1/admin/promotion/link/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        57,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_promotion_link_detail',
        'GET',
        '/api/v1/admin/promotion/link/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        58,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'link-列表',
        'get__api_v1_admin_promotion_link_list',
        'GET',
        '/api/v1/admin/promotion/link/list',
        1,
        '查询link-列表'
    ),
    (
        59,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_promotion_link_update',
        'PUT',
        '/api/v1/admin/promotion/link/update/:id',
        1,
        '更新update-:id'
    ),
    (
        60,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'record-:path',
        'get__api_v1_admin_promotion_link_record',
        'GET',
        '/api/v1/admin/promotion/link/record/:path',
        1,
        '查询record-:path'
    ),
    (
        61,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'stats-history',
        'get__api_v1_admin_promotion_stats_history',
        'GET',
        '/api/v1/admin/promotion/stats/history',
        1,
        '查询stats-history'
    ),
    (
        62,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'stats-total',
        'get__api_v1_admin_promotion_stats_total',
        'GET',
        '/api/v1/admin/promotion/stats/total',
        1,
        '查询stats-total'
    ),
    (
        63,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'cleanup-配置',
        'put__api_v1_admin_query_cleanup_config',
        'PUT',
        '/api/v1/admin/query/cleanup/config',
        1,
        '更新cleanup-配置'
    ),
    (
        64,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'cleanup-configs',
        'get__api_v1_admin_query_cleanup_configs',
        'GET',
        '/api/v1/admin/query/cleanup/configs',
        1,
        '查询cleanup-configs'
    ),
    (
        65,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'details-:log_id',
        'get__api_v1_admin_query_cleanup_details',
        'GET',
        '/api/v1/admin/query/cleanup/details/:log_id',
        1,
        '查询details-:log_id'
    ),
    (
        66,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'cleanup-logs',
        'get__api_v1_admin_query_cleanup_logs',
        'GET',
        '/api/v1/admin/query/cleanup/logs',
        1,
        '查询cleanup-logs'
    ),
    (
        67,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:order_id',
        'get__api_v1_admin_query_detail',
        'GET',
        '/api/v1/admin/query/detail/:order_id',
        1,
        '查询detail-:order_id'
    ),
    (
        68,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '角色管理-创建',
        'post__api_v1_admin_role_create',
        'POST',
        '/api/v1/admin/role/create',
        1,
        '创建角色管理-创建'
    ),
    (
        69,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_role_delete',
        'DELETE',
        '/api/v1/admin/role/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        70,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_role_detail',
        'GET',
        '/api/v1/admin/role/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        71,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '角色管理-列表',
        'get__api_v1_admin_role_list',
        'GET',
        '/api/v1/admin/role/list',
        1,
        '查询角色管理-列表'
    ),
    (
        72,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_role_update',
        'PUT',
        '/api/v1/admin/role/update/:id',
        1,
        '更新update-:id'
    ),
    (
        73,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-all',
        'get__api_v1_admin_api_all',
        'GET',
        '/api/v1/admin/api/all',
        1,
        '查询api-all'
    ),
    (
        74,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-列表',
        'get__api_v1_admin_role_api_list',
        'GET',
        '/api/v1/admin/role/:role_id/api/list',
        1,
        '查询api-列表'
    ),
    (
        75,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-assign',
        'post__api_v1_admin_role_api_assign',
        'POST',
        '/api/v1/admin/role/api/assign',
        1,
        '创建api-assign'
    ),
    (
        76,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-remove',
        'post__api_v1_admin_role_api_remove',
        'POST',
        '/api/v1/admin/role/api/remove',
        1,
        '创建api-remove'
    ),
    (
        77,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'api-更新',
        'put__api_v1_admin_role_api_update',
        'PUT',
        '/api/v1/admin/role/api/update',
        1,
        '更新api-更新'
    ),
    (
        78,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '用户管理-创建',
        'post__api_v1_admin_user_create',
        'POST',
        '/api/v1/admin/user/create',
        1,
        '创建用户管理-创建'
    ),
    (
        79,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'delete-:id',
        'delete__api_v1_admin_user_delete',
        'DELETE',
        '/api/v1/admin/user/delete/:id',
        1,
        '删除delete-:id'
    ),
    (
        80,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'detail-:id',
        'get__api_v1_admin_user_detail',
        'GET',
        '/api/v1/admin/user/detail/:id',
        1,
        '查询detail-:id'
    ),
    (
        81,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '用户管理-info',
        'get__api_v1_admin_user_info',
        'GET',
        '/api/v1/admin/user/info',
        1,
        '查询用户管理-info'
    ),
    (
        82,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        '用户管理-列表',
        'get__api_v1_admin_user_list',
        'GET',
        '/api/v1/admin/user/list',
        1,
        '查询用户管理-列表'
    ),
    (
        83,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'reset-password-:id',
        'put__api_v1_admin_user_reset-password',
        'PUT',
        '/api/v1/admin/user/reset-password/:id',
        1,
        '更新reset-password-:id'
    ),
    (
        84,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'update-:id',
        'put__api_v1_admin_user_update',
        'PUT',
        '/api/v1/admin/user/update/:id',
        1,
        '更新update-:id'
    ),
    (
        85,
        '2025-09-30 17:52:13',
        '2025-09-30 17:52:13',
        NULL,
        0,
        0,
        'health-check',
        'get__api_v1_health_check',
        'GET',
        '/api/v1/health/check',
        1,
        '查询health-check'
    ),
    (
        86,
        '2025-10-24 15:42:28',
        '2025-10-24 15:42:28',
        NULL,
        0,
        0,
        'retry-agent-process-:id',
        'post__api_v1_admin_order_retry-agent-process',
        'POST',
        '/api/v1/admin/order/retry-agent-process/:id',
        1,
        '创建retry-agent-process-:id'
    ),
    (
        87,
        '2025-10-24 16:36:51',
        '2025-10-24 16:36:51',
        NULL,
        0,
        0,
        'wechat-getSignature',
        'post__api_v1_wechat_getSignature',
        'POST',
        '/api/v1/wechat/getSignature',
        1,
        '创建wechat-getSignature'
    ),
    (
        88,
        '2025-12-24 19:19:09',
        '2025-12-24 19:19:09',
        NULL,
        0,
        0,
        'bank-card-review',
        'post__api_v1_admin_agent_agent-withdrawal_bank-card_review',
        'POST',
        '/api/v1/admin/agent/agent-withdrawal/bank-card/review',
        1,
        '创建bank-card-review'
    ),
    (
        89,
        '2025-12-27 14:07:21',
        '2025-12-27 14:07:21',
        NULL,
        0,
        0,
        'agent-withdrawal-statistics',
        'get__api_v1_admin_agent_agent-withdrawal_statistics',
        'GET',
        '/api/v1/admin/agent/agent-withdrawal/statistics',
        1,
        '查询agent-withdrawal-statistics'
    ),
    (
        90,
        '2025-12-27 14:07:21',
        '2025-12-27 14:07:21',
        NULL,
        0,
        0,
        '订单管理-refund-statistics',
        'get__api_v1_admin_order_refund-statistics',
        'GET',
        '/api/v1/admin/order/refund-statistics',
        1,
        '查询订单管理-refund-statistics'
    ),
    (
        91,
        '2025-12-27 14:07:21',
        '2025-12-27 14:07:21',
        NULL,
        0,
        0,
        '订单管理-revenue-statistics',
        'get__api_v1_admin_order_revenue-statistics',
        'GET',
        '/api/v1/admin/order/revenue-statistics',
        1,
        '查询订单管理-revenue-statistics'
    ),
    (
        92,
        '2025-12-27 16:08:33',
        '2025-12-27 16:08:33',
        NULL,
        0,
        0,
        'agent-order-statistics',
        'get__api_v1_admin_agent_agent-order_statistics',
        'GET',
        '/api/v1/admin/agent/agent-order/statistics',
        1,
        '查询agent-order-statistics'
    ),
    (
        93,
        '2025-12-27 16:08:33',
        '2025-12-27 16:08:33',
        NULL,
        0,
        0,
        '代理管理-statistics',
        'get__api_v1_admin_agent_statistics',
        'GET',
        '/api/v1/admin/agent/statistics',
        1,
        '查询代理管理-statistics'
    ),
    (
        94,
        '2025-12-29 16:31:23',
        '2025-12-29 16:31:23',
        NULL,
        0,
        0,
        'agent-link-product-statistics',
        'get__api_v1_admin_agent_agent-link_product-statistics',
        'GET',
        '/api/v1/admin/agent/agent-link/product-statistics',
        1,
        '查询agent-link-product-statistics'
    ),
    (
        95,
        '2025-12-29 16:31:23',
        '2025-12-29 16:31:23',
        NULL,
        0,
        0,
        '订单管理-source-statistics',
        'get__api_v1_admin_order_source-statistics',
        'GET',
        '/api/v1/admin/order/source-statistics',
        1,
        '查询订单管理-source-statistics'
    ),
    (
        96,
        '2025-12-29 16:31:23',
        '2025-12-29 16:31:23',
        NULL,
        0,
        0,
        '订单管理-statistics',
        'get__api_v1_admin_order_statistics',
        'GET',
        '/api/v1/admin/order/statistics',
        1,
        '查询订单管理-statistics'
    ),
    (
        97,
        '2025-12-31 12:42:23',
        '2025-12-31 12:42:23',
        NULL,
        0,
        0,
        'agent-commission-batch-unfreeze',
        'post__api_v1_admin_agent_agent-commission_batch-unfreeze',
        'POST',
        '/api/v1/admin/agent/agent-commission/batch-unfreeze',
        1,
        '创建agent-commission-batch-unfreeze'
    ),
    (
        98,
        '2025-12-31 12:42:23',
        '2025-12-31 12:42:23',
        NULL,
        0,
        0,
        'agent-commission-update-status',
        'post__api_v1_admin_agent_agent-commission_update-status',
        'POST',
        '/api/v1/admin/agent/agent-commission/update-status',
        1,
        '创建agent-commission-update-status'
    ),
    (
        99,
        '2026-01-03 18:11:08',
        '2026-01-03 18:11:08',
        NULL,
        0,
        0,
        'wallet-:agent_id',
        'get__api_v1_admin_agent_wallet',
        'GET',
        '/api/v1/admin/agent/wallet/:agent_id',
        1,
        '查询wallet-:agent_id'
    ),
    (
        100,
        '2026-01-04 16:14:19',
        '2026-01-04 16:14:19',
        NULL,
        0,
        0,
        'wallet-update-balance',
        'post__api_v1_admin_agent_wallet_update-balance',
        'POST',
        '/api/v1/admin/agent/wallet/update-balance',
        1,
        '创建wallet-update-balance'
    ),
    (
        101,
        '2026-01-05 15:08:27',
        '2026-01-05 15:08:27',
        NULL,
        0,
        0,
        '代理管理-system-config',
        'get__api_v1_admin_agent_system-config',
        'GET',
        '/api/v1/admin/agent/system-config',
        1,
        '查询代理管理-system-config'
    ),
    (
        102,
        '2026-01-05 15:08:27',
        '2026-01-05 15:08:27',
        NULL,
        0,
        0,
        '代理管理-system-config',
        'post__api_v1_admin_agent_system-config',
        'POST',
        '/api/v1/admin/agent/system-config',
        1,
        '创建代理管理-system-config'
    ),
    (
        103,
        '2026-01-07 17:08:33',
        '2026-01-07 17:08:33',
        NULL,
        0,
        0,
        'wallet-transaction-列表',
        'get__api_v1_admin_agent_wallet-transaction_list',
        'GET',
        '/api/v1/admin/agent/wallet-transaction/list',
        1,
        '查询wallet-transaction-列表'
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_dict_data`
--

CREATE TABLE `admin_dict_data` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `dict_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典类型编码',
    `dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典标签',
    `dict_value` tinyint NOT NULL COMMENT '字典键值',
    `dict_sort` int NOT NULL DEFAULT '0' COMMENT '字典排序',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典数据表';

--
-- 转存表中的数据 `admin_dict_data`
--

INSERT INTO
    `admin_dict_data` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `dict_type`,
        `dict_label`,
        `dict_value`,
        `dict_sort`,
        `status`,
        `remark`
    )
VALUES (
        1,
        '2025-04-29 13:28:38',
        '2025-04-29 13:28:59',
        NULL,
        0,
        0,
        'admin_menu_type',
        'catalog',
        0,
        1,
        1,
        '目录'
    ),
    (
        2,
        '2025-04-29 13:28:38',
        '2025-04-29 13:29:03',
        NULL,
        0,
        0,
        'admin_menu_type',
        'menu',
        1,
        2,
        1,
        '菜单'
    ),
    (
        3,
        '2025-04-29 13:28:38',
        '2025-04-29 13:29:05',
        NULL,
        0,
        0,
        'admin_menu_type',
        'action',
        2,
        3,
        1,
        '按钮'
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_dict_type`
--

CREATE TABLE `admin_dict_type` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `dict_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典类型编码',
    `dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典类型名称',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典类型表';

--
-- 转存表中的数据 `admin_dict_type`
--

INSERT INTO
    `admin_dict_type` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `dict_type`,
        `dict_name`,
        `status`,
        `remark`
    )
VALUES (
        1,
        '2025-04-29 13:28:38',
        '2025-04-29 13:29:09',
        NULL,
        0,
        0,
        'admin_menu_type',
        '菜单类型',
        1,
        '系统菜单类型'
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_menu`
--

CREATE TABLE `admin_menu` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `pid` bigint NOT NULL DEFAULT '0' COMMENT '父菜单ID',
    `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '路由名称',
    `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '路由路径',
    `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '组件路径',
    `redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '重定向路径',
    `meta` json NOT NULL COMMENT '路由元数据配置',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态: 0-禁用, 1-启用',
    `type` tinyint NOT NULL DEFAULT '0',
    `sort` int NOT NULL DEFAULT '0' COMMENT '排序号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单表';

--
-- 转存表中的数据 `admin_menu`
--

INSERT INTO
    `admin_menu` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `pid`,
        `name`,
        `path`,
        `component`,
        `redirect`,
        `meta`,
        `status`,
        `type`,
        `sort`
    )
VALUES (
        1,
        '2025-04-27 20:19:01',
        '2025-04-28 18:13:14',
        NULL,
        0,
        0,
        0,
        'Dashboard',
        '/dashboard',
        '',
        NULL,
        '{\"icon\": \"lucide:layout-dashboard\", \"order\": -1, \"title\": \"page.dashboard.title\"}',
        1,
        0,
        0
    ),
    (
        2,
        '2025-04-27 20:19:01',
        '2025-04-28 18:13:12',
        NULL,
        0,
        0,
        1,
        'Analytics',
        '/analytics',
        '/dashboard/analytics/index',
        NULL,
        '{\"icon\": \"lucide:area-chart\", \"title\": \"page.dashboard.analytics\", \"affixTab\": true}',
        1,
        0,
        0
    ),
    (
        3,
        '2025-04-27 20:19:01',
        '2026-03-30 14:07:05',
        '2026-03-30 14:07:06',
        1,
        1,
        1,
        'Workspace',
        '/workspace',
        '/dashboard/workspace/index',
        NULL,
        '{\"icon\": \"carbon:workspace\", \"title\": \"page.dashboard.workspace\"}',
        1,
        0,
        0
    ),
    (
        4,
        '2025-04-27 20:19:01',
        '2026-03-30 14:07:46',
        '2026-03-30 14:07:46',
        1,
        1,
        0,
        'Demos',
        '/demos',
        '',
        NULL,
        '{\"icon\": \"ic:baseline-view-in-ar\", \"order\": 1000, \"title\": \"demos.title\", \"keepAlive\": true}',
        1,
        0,
        0
    ),
    (
        5,
        '2025-04-27 20:19:01',
        '2026-03-30 14:07:44',
        '2026-03-30 14:07:45',
        1,
        1,
        4,
        'AntDesignDemos',
        '/demos/ant-design',
        '/demos/antd/index',
        NULL,
        '{\"title\": \"demos.antd\"}',
        1,
        0,
        0
    ),
    (
        6,
        '2025-04-27 20:19:01',
        '2025-06-06 17:48:31',
        NULL,
        0,
        0,
        24,
        'OrderManage',
        '/order',
        '/order/order/index',
        NULL,
        '{\"icon\": \"lucide:shopping-cart\", \"order\": 1000, \"title\": \"订单管理\"}',
        1,
        1,
        0
    ),
    (
        7,
        '2025-04-27 20:19:01',
        '2026-03-30 14:07:55',
        '2026-03-30 14:07:55',
        1,
        1,
        0,
        'VbenProject',
        '/vben-admin',
        '',
        NULL,
        '{\"icon\": \"carbon:apps\", \"order\": 9998, \"title\": \"demos.vben.title\", \"badgeType\": \"dot\"}',
        1,
        0,
        0
    ),
    (
        8,
        '2025-04-27 20:19:01',
        '2026-03-30 14:07:53',
        '2026-03-30 14:07:53',
        1,
        1,
        7,
        'VbenDocument',
        '/vben-admin/document',
        'IFrameView',
        NULL,
        '{\"icon\": \"lucide:book-open-text\", \"link\": \"https://doc.vben.admin\", \"title\": \"demos.vben.document\"}',
        1,
        0,
        0
    ),
    (
        9,
        '2025-04-27 20:19:01',
        '2026-03-30 14:08:17',
        '2026-03-30 14:08:17',
        1,
        1,
        0,
        'VbenAbout',
        '/vben-admin/about',
        '/_core/about/index',
        NULL,
        '{\"icon\": \"lucide:copyright\", \"order\": 9999, \"title\": \"demos.vben.about\"}',
        1,
        0,
        0
    ),
    (
        10,
        '2025-04-28 18:12:21',
        '2025-04-28 18:12:21',
        NULL,
        0,
        0,
        0,
        'System',
        '/system',
        '',
        NULL,
        '{\"icon\": \"ion:settings-outline\", \"order\": 9997, \"title\": \"system.title\"}',
        1,
        0,
        9997
    ),
    (
        11,
        '2025-04-28 18:12:21',
        '2025-04-28 18:12:21',
        NULL,
        0,
        0,
        10,
        'SystemRole',
        '/system/role',
        '/system/role/list',
        NULL,
        '{\"icon\": \"mdi:account-group\", \"title\": \"system.role.title\"}',
        1,
        1,
        1
    ),
    (
        12,
        '2025-04-28 18:12:21',
        '2025-04-28 18:12:21',
        NULL,
        0,
        0,
        10,
        'SystemMenu',
        '/system/menu',
        '/system/menu/list',
        NULL,
        '{\"icon\": \"mdi:menu\", \"title\": \"system.menu.title\"}',
        1,
        1,
        2
    ),
    (
        13,
        '2025-04-28 18:12:21',
        '2025-05-29 15:23:31',
        NULL,
        0,
        0,
        10,
        'SystemDept',
        '/system/dept',
        '/system/dept/list',
        NULL,
        '{\"icon\": \"charm:organisation\", \"title\": \"system.dept.title\"}',
        0,
        1,
        0
    ),
    (
        14,
        '2025-04-29 21:40:22',
        '2025-04-29 21:40:22',
        NULL,
        0,
        0,
        10,
        'SystemUser',
        '/system/user',
        '/system/user/list',
        NULL,
        '{\"icon\": \"carbon:user-filled\", \"title\": \"用户管理\"}',
        1,
        1,
        0
    ),
    (
        15,
        '2025-05-08 16:12:22',
        '2026-03-30 14:10:07',
        '2026-03-30 14:10:07',
        1,
        1,
        0,
        'Promotion',
        '/promotion',
        '',
        NULL,
        '{\"icon\": \"carbon:carbon\", \"title\": \"推广\"}',
        1,
        0,
        0
    ),
    (
        16,
        '2025-05-08 16:20:19',
        '2026-03-30 14:10:03',
        '2026-03-30 14:10:03',
        1,
        1,
        15,
        'PromotionLink',
        '/promotion/link',
        '/promotion/link/index',
        NULL,
        '{\"icon\": \"carbon:link\", \"title\": \"推广链接管理\"}',
        1,
        1,
        0
    ),
    (
        17,
        '2025-05-08 16:21:41',
        '2026-03-30 14:10:05',
        '2026-03-30 14:10:05',
        1,
        1,
        15,
        'PromotionAnalytics',
        '/promotion/analytics',
        '/promotion/analytics/index',
        NULL,
        '{\"icon\": \"carbon:analytics\", \"title\": \"推广数据分析\"}',
        1,
        1,
        0
    ),
    (
        18,
        '2025-05-13 20:29:52',
        '2025-05-13 20:30:59',
        NULL,
        0,
        0,
        0,
        'platformUser',
        '/platform-user',
        '/platform-user/list',
        NULL,
        '{\"icon\": \"carbon:user-profile\", \"title\": \"平台用户管理\", \"activeIcon\": \"\"}',
        1,
        1,
        0
    ),
    (
        19,
        '2025-05-14 01:05:54',
        '2025-05-14 01:05:54',
        NULL,
        0,
        0,
        0,
        'notification',
        '/notification',
        '/notification/list',
        NULL,
        '{\"icon\": \"carbon:notification\", \"title\": \"通知管理\"}',
        1,
        1,
        0
    ),
    (
        20,
        '2025-05-15 22:56:11',
        '2025-05-15 22:56:11',
        NULL,
        0,
        0,
        0,
        'productManage',
        '/product-manage',
        '',
        NULL,
        '{\"icon\": \"carbon:box\", \"title\": \"产品管理\"}',
        1,
        0,
        0
    ),
    (
        21,
        '2025-05-15 23:14:04',
        '2025-05-15 23:14:04',
        NULL,
        0,
        0,
        20,
        'productList',
        '/product-manage/product',
        '/product-manage/product/list',
        NULL,
        '{\"icon\": \"carbon:store\", \"title\": \"产品列表\"}',
        1,
        1,
        0
    ),
    (
        22,
        '2025-05-16 00:15:01',
        '2025-05-16 00:15:01',
        NULL,
        0,
        0,
        20,
        'feature',
        '/product-manage/feature',
        '/product-manage/feature/list',
        NULL,
        '{\"icon\": \"carbon:web-services-container\", \"title\": \"模块列表\"}',
        1,
        1,
        0
    ),
    (
        23,
        '2025-05-29 16:04:53',
        '2025-06-06 17:48:36',
        NULL,
        0,
        0,
        24,
        'OrderQueryDetail',
        '/order/query/:id',
        '/order/query/query-details',
        NULL,
        '{\"icon\": \"carbon:report\", \"title\": \"查询结果\", \"hideInMenu\": true}',
        1,
        1,
        0
    ),
    (
        24,
        '2025-05-29 16:15:36',
        '2025-05-29 16:15:36',
        NULL,
        0,
        0,
        0,
        'Order',
        '/order',
        '',
        NULL,
        '{\"icon\": \"lucide:shopping-cart\", \"title\": \"订单管理\"}',
        1,
        0,
        0
    ),
    (
        25,
        '2025-06-06 18:24:53',
        '2025-06-06 18:26:18',
        NULL,
        0,
        0,
        24,
        'queryCleanup',
        '/order/query/query-cleanup-manage',
        '/order/query-cleanup/query-cleanup-log',
        NULL,
        '{\"icon\": \"carbon:clean\", \"title\": \"查询数据管理\", \"activeIcon\": \"\"}',
        1,
        1,
        0
    ),
    (
        26,
        '2025-06-06 21:43:48',
        '2025-06-06 21:58:06',
        NULL,
        0,
        0,
        0,
        'AgentManage',
        '/agent-manage',
        '',
        NULL,
        '{\"icon\": \"carbon:airline-manage-gates\", \"title\": \"代理系统\"}',
        1,
        0,
        0
    ),
    (
        27,
        '2025-06-06 21:44:27',
        '2025-06-07 11:38:40',
        NULL,
        0,
        0,
        26,
        'AgentList',
        '/agent-manage/agent-list',
        '/agent/agent-list/list',
        NULL,
        '{\"icon\": \"carbon:list\", \"title\": \"代理列表\"}',
        1,
        1,
        0
    ),
    (
        28,
        '2025-06-07 11:39:25',
        '2025-06-07 11:39:33',
        NULL,
        0,
        0,
        26,
        'AgentLinks',
        '/agent-manage/agent-links',
        '/agent/agent-links/list',
        NULL,
        '{\"icon\": \"carbon:link\", \"title\": \"推广链接\"}',
        1,
        1,
        0
    ),
    (
        29,
        '2025-06-07 11:40:47',
        '2025-06-08 12:25:17',
        NULL,
        0,
        0,
        26,
        'AgentCommission',
        '/agent-manage/agent-commission',
        '/agent/agent-commission/list',
        NULL,
        '{\"icon\": \"carbon:money\", \"title\": \"佣金记录\"}',
        1,
        1,
        0
    ),
    (
        30,
        '2025-06-07 12:14:15',
        '2025-06-07 12:14:15',
        NULL,
        0,
        0,
        26,
        'AgentReward',
        '/agent-manage/agent-reward',
        '/agent/agent-reward/list',
        NULL,
        '{\"icon\": \"carbon:store\", \"title\": \"平台奖励\"}',
        1,
        1,
        0
    ),
    (
        31,
        '2025-06-07 12:15:12',
        '2025-06-07 12:15:12',
        NULL,
        0,
        0,
        26,
        'AgentWithdrawal',
        '/agent-manage/withdrawal',
        '/agent/agent-withdrawal/list',
        NULL,
        '{\"icon\": \"carbon:piggy-bank\", \"title\": \"提现记录\"}',
        1,
        1,
        0
    ),
    (
        32,
        '2025-06-07 13:44:27',
        '2025-06-07 13:44:27',
        NULL,
        0,
        0,
        26,
        'AgentCommissionDeduction',
        '/agent-manage/agent-commission-deduction',
        '/agent/agent-commission-deduction/list',
        NULL,
        '{\"icon\": \"carbon:collapse-categories\", \"title\": \"上级抽佣记录\"}',
        1,
        1,
        0
    ),
    (
        33,
        '2025-06-07 16:28:52',
        '2025-06-07 16:28:52',
        NULL,
        0,
        0,
        26,
        'AgentPlatformDeduction',
        '/agent-manage/agent-platform-deduction',
        '/agent/agent-platform-deduction/list',
        NULL,
        '{\"icon\": \"carbon:ibm-openshift-container-platform-on-vpc-for-regulated-industries\", \"title\": \"平台抽佣记录\"}',
        1,
        1,
        0
    ),
    (
        34,
        '2025-06-07 16:46:18',
        '2025-06-07 17:09:55',
        NULL,
        0,
        0,
        26,
        'AgentProductConfig',
        '/agent-manage/agent-product-config',
        '/agent/agent-product-config/list',
        NULL,
        '{\"icon\": \"carbon:cloud-satellite-config\", \"title\": \"代理产品配置\"}',
        1,
        1,
        0
    ),
    (
        35,
        '2025-06-07 21:17:02',
        '2025-06-08 11:40:11',
        NULL,
        0,
        0,
        26,
        'AgentMembershipRechargeOrder',
        '/agent-manage/agent-membership-recharge-order',
        '/agent/agent-membership-recharge-order/list',
        NULL,
        '{\"icon\": \"carbon:feature-membership\", \"title\": \"会员充值订单\"}',
        1,
        1,
        0
    ),
    (
        36,
        '2025-06-07 23:40:35',
        '2025-06-07 23:40:35',
        NULL,
        0,
        0,
        26,
        'AgentMembershipConfig',
        '/agent-manage/agent-membership-config',
        '/agent/agent-membership-config/list',
        NULL,
        '{\"icon\": \"carbon:document-configuration\", \"title\": \"代理会员配置\"}',
        1,
        1,
        0
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_role`
--

CREATE TABLE `admin_role` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `role_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色名称',
    `role_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色编码',
    `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色描述',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
    `sort` int NOT NULL DEFAULT '0' COMMENT '排序'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表';

--
-- 转存表中的数据 `admin_role`
--

INSERT INTO
    `admin_role` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `role_name`,
        `role_code`,
        `description`,
        `status`,
        `sort`
    )
VALUES (
        1,
        '2025-04-27 20:19:01',
        '2025-04-29 19:22:43',
        NULL,
        0,
        0,
        '超级管理员',
        'SUPER',
        '系统超级管理员，拥有所有权限',
        1,
        0
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_role_api`
--

CREATE TABLE `admin_role_api` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `role_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到角色表的id',
    `api_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到接口表的id'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色接口关联表';

-- --------------------------------------------------------

--
-- 表的结构 `admin_role_menu`
--

CREATE TABLE `admin_role_menu` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `role_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到角色表的id',
    `menu_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到菜单表的id'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色菜单关联表';

--
-- 转存表中的数据 `admin_role_menu`
--

INSERT INTO
    `admin_role_menu` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `role_id`,
        `menu_id`
    )
VALUES (
        17,
        '2025-04-29 19:13:18',
        '2025-04-29 19:13:18',
        NULL,
        0,
        0,
        1,
        1
    ),
    (
        22,
        '2025-04-29 19:13:18',
        '2025-04-29 19:13:18',
        NULL,
        0,
        0,
        1,
        6
    ),
    (
        26,
        '2025-04-29 19:13:18',
        '2025-04-29 19:13:18',
        NULL,
        0,
        0,
        1,
        10
    ),
    (
        27,
        '2025-04-29 19:13:18',
        '2025-04-29 19:13:18',
        NULL,
        0,
        0,
        1,
        11
    ),
    (
        28,
        '2025-04-29 19:13:18',
        '2025-04-29 19:13:18',
        NULL,
        0,
        0,
        1,
        12
    ),
    (
        29,
        '2025-04-29 19:13:18',
        '2025-04-29 19:13:18',
        NULL,
        0,
        0,
        1,
        13
    ),
    (
        35,
        '2025-04-29 21:41:12',
        '2025-04-29 21:41:12',
        NULL,
        0,
        0,
        1,
        14
    ),
    (
        42,
        '2025-05-13 20:31:07',
        '2025-05-13 20:31:07',
        NULL,
        0,
        0,
        1,
        18
    ),
    (
        59,
        '2025-05-14 01:06:56',
        '2025-05-14 01:06:56',
        NULL,
        0,
        0,
        1,
        19
    ),
    (
        60,
        '2025-05-15 22:56:20',
        '2025-05-15 22:56:20',
        NULL,
        0,
        0,
        1,
        20
    ),
    (
        61,
        '2025-05-15 23:14:14',
        '2025-05-15 23:14:14',
        NULL,
        0,
        0,
        1,
        21
    ),
    (
        62,
        '2025-05-16 00:15:11',
        '2025-05-16 00:15:11',
        NULL,
        0,
        0,
        1,
        22
    ),
    (
        63,
        '2025-05-29 16:05:13',
        '2025-05-29 16:05:13',
        NULL,
        0,
        0,
        1,
        23
    ),
    (
        64,
        '2025-05-29 16:26:42',
        '2025-05-29 16:26:42',
        NULL,
        0,
        0,
        1,
        24
    ),
    (
        65,
        '2025-06-06 18:25:27',
        '2025-06-06 18:25:27',
        NULL,
        0,
        0,
        1,
        25
    ),
    (
        66,
        '2025-06-06 21:45:00',
        '2025-06-06 21:45:00',
        NULL,
        0,
        0,
        1,
        26
    ),
    (
        67,
        '2025-06-06 21:45:00',
        '2025-06-06 21:45:00',
        NULL,
        0,
        0,
        1,
        27
    ),
    (
        68,
        '2025-06-07 11:40:56',
        '2025-06-07 11:40:56',
        NULL,
        0,
        0,
        1,
        28
    ),
    (
        69,
        '2025-06-07 11:59:38',
        '2025-06-07 11:59:38',
        NULL,
        0,
        0,
        1,
        29
    ),
    (
        70,
        '2025-06-07 12:15:23',
        '2025-06-07 12:15:23',
        NULL,
        0,
        0,
        1,
        30
    ),
    (
        71,
        '2025-06-07 12:15:23',
        '2025-06-07 12:15:23',
        NULL,
        0,
        0,
        1,
        31
    ),
    (
        72,
        '2025-06-07 13:44:41',
        '2025-06-07 13:44:41',
        NULL,
        0,
        0,
        1,
        32
    ),
    (
        73,
        '2025-06-07 16:28:59',
        '2025-06-07 16:28:59',
        NULL,
        0,
        0,
        1,
        33
    ),
    (
        74,
        '2025-06-07 16:46:23',
        '2025-06-07 16:46:23',
        NULL,
        0,
        0,
        1,
        34
    ),
    (
        75,
        '2025-06-07 21:17:17',
        '2025-06-07 21:17:17',
        NULL,
        0,
        0,
        1,
        35
    ),
    (
        76,
        '2025-06-07 23:40:41',
        '2025-06-07 23:40:41',
        NULL,
        0,
        0,
        1,
        36
    ),
    (
        77,
        '2025-06-08 18:26:24',
        '2025-06-08 18:26:24',
        NULL,
        0,
        0,
        1,
        2
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_user`
--

CREATE TABLE `admin_user` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
    `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
    `real_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '真实姓名',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：0-禁用，1-启用'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理员用户表';

--
-- 转存表中的数据 `admin_user`
--

INSERT INTO
    `admin_user` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `username`,
        `password`,
        `real_name`,
        `status`
    )
VALUES (
        1,
        '2025-04-27 20:19:01',
        '2026-04-01 15:31:55',
        NULL,
        0,
        0,
        'admin',
        '$2a$10$yrsN3Vs6zpe83yHkdEid5u/IlZVZZ4Xo05lXWa6d1yPAva4KfZc2W',
        '',
        1
    );

-- --------------------------------------------------------

--
-- 表的结构 `admin_user_role`
--

CREATE TABLE `admin_user_role` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `user_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到用户表的id',
    `role_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到角色表的id'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色关联表';

--
-- 转存表中的数据 `admin_user_role`
--

INSERT INTO
    `admin_user_role` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `user_id`,
        `role_id`
    )
VALUES (
        1,
        '2025-04-27 20:19:01',
        '2025-04-27 20:19:01',
        NULL,
        0,
        0,
        1,
        1
    );

-- --------------------------------------------------------

--
-- 表的结构 `agent`
--

CREATE TABLE `agent` (
    `id` bigint NOT NULL,
    `user_id` bigint NOT NULL,
    `level_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'normal' COMMENT '代理等级',
    `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `wechat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `membership_expiry_time` datetime DEFAULT NULL COMMENT '会员过期时间',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_active_stat`
--

CREATE TABLE `agent_active_stat` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `agent_id` bigint NOT NULL COMMENT '代理ID',
    `stat_date` date NOT NULL COMMENT '统计日期',
    `active_number` int NOT NULL DEFAULT '0' COMMENT '下级活跃数',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理活跃统计表';

-- --------------------------------------------------------

--
-- 表的结构 `agent_audit`
--

CREATE TABLE `agent_audit` (
    `id` bigint NOT NULL,
    `user_id` bigint NOT NULL,
    `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `wechat_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `status` tinyint NOT NULL DEFAULT '0',
    `audit_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `audit_time` datetime DEFAULT NULL,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理审核表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_closure`
--

CREATE TABLE `agent_closure` (
    `id` bigint NOT NULL,
    `ancestor_id` bigint NOT NULL,
    `descendant_id` bigint NOT NULL,
    `depth` int NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理闭包表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_commission`
--

CREATE TABLE `agent_commission` (
    `id` bigint NOT NULL,
    `agent_id` bigint NOT NULL,
    `order_id` bigint NOT NULL,
    `amount` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `refunded_amount` decimal(18, 2) NOT NULL DEFAULT '0.00' COMMENT '已退款佣金金额',
    `product_id` bigint NOT NULL COMMENT '产品ID',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：0-已结算，1-冻结中，2-已退款',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理佣金表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_commission_deduction`
--

CREATE TABLE `agent_commission_deduction` (
    `id` int NOT NULL,
    `agent_id` bigint NOT NULL,
    `deducted_agent_id` bigint NOT NULL COMMENT '被抽佣代理ID',
    `amount` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `product_id` bigint NOT NULL COMMENT '产品ID',
    `order_id` bigint DEFAULT NULL COMMENT '关联订单ID',
    `type` enum('cost', 'pricing') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'cost',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理佣金扣除表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_link`
--

CREATE TABLE `agent_link` (
    `id` bigint NOT NULL,
    `product_id` bigint NOT NULL,
    `price` decimal(10, 2) NOT NULL,
    `user_id` bigint NOT NULL,
    `agent_id` bigint NOT NULL,
    `link_identifier` varchar(255) NOT NULL,
    `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL,
    `del_state` tinyint DEFAULT '0',
    `version` bigint DEFAULT '0'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- 表的结构 `agent_membership_config`
--

CREATE TABLE `agent_membership_config` (
    `id` bigint NOT NULL,
    `level_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '会员级别名称，如 S级，S+级',
    `price` decimal(10, 2) DEFAULT NULL COMMENT '会员年费',
    `report_commission` decimal(5, 2) DEFAULT NULL COMMENT '直推报告收益',
    `lower_activity_reward` decimal(10, 2) DEFAULT NULL COMMENT '下级活跃奖励金额',
    `new_activity_reward` decimal(10, 2) DEFAULT NULL COMMENT '新增活跃奖励金额',
    `lower_standard_count` int DEFAULT NULL COMMENT '活跃下级达标个数',
    `new_lower_standard_count` int DEFAULT NULL COMMENT '新增活跃下级达标个数',
    `lower_withdraw_reward_ratio` decimal(5, 2) DEFAULT NULL COMMENT '下级提现奖励比例',
    `lower_convert_vip_reward` decimal(10, 2) DEFAULT NULL COMMENT '下级转化VIP奖励',
    `lower_convert_svip_reward` decimal(10, 2) DEFAULT NULL COMMENT '下级转化SVIP奖励',
    `exemption_amount` decimal(10, 2) DEFAULT NULL COMMENT '免审核金额',
    `price_increase_max` decimal(10, 2) DEFAULT NULL COMMENT '提价最高金额',
    `price_ratio` decimal(5, 2) DEFAULT NULL COMMENT '提价区间收取比例',
    `price_increase_amount` decimal(10, 2) DEFAULT NULL COMMENT '在原本成本上加价的金额',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL,
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员级别配置表' ROW_FORMAT = DYNAMIC;

--
-- 转存表中的数据 `agent_membership_config`
--

INSERT INTO
    `agent_membership_config` (
        `id`,
        `level_name`,
        `price`,
        `report_commission`,
        `lower_activity_reward`,
        `new_activity_reward`,
        `lower_standard_count`,
        `new_lower_standard_count`,
        `lower_withdraw_reward_ratio`,
        `lower_convert_vip_reward`,
        `lower_convert_svip_reward`,
        `exemption_amount`,
        `price_increase_max`,
        `price_ratio`,
        `price_increase_amount`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`
    )
VALUES (
        1,
        'VIP',
        398.00,
        1.20,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        199.00,
        259.00,
        1500.00,
        5.00,
        0.40,
        6.00,
        '2025-02-25 21:31:13',
        '2025-10-24 16:45:32',
        NULL,
        0,
        0
    ),
    (
        2,
        'SVIP',
        598.00,
        1.50,
        50.00,
        50.00,
        100,
        20,
        0.01,
        259.00,
        399.00,
        3000.00,
        10.00,
        0.60,
        10.00,
        '2025-02-25 21:31:13',
        '2025-10-24 16:45:27',
        NULL,
        0,
        0
    ),
    (
        3,
        'normal',
        0.00,
        0.00,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        500.00,
        NULL,
        NULL,
        NULL,
        '2025-02-25 21:31:13',
        '2026-02-28 11:19:41',
        NULL,
        0,
        0
    );

-- --------------------------------------------------------

--
-- 表的结构 `agent_membership_recharge_order`
--

CREATE TABLE `agent_membership_recharge_order` (
    `id` bigint NOT NULL,
    `user_id` bigint NOT NULL COMMENT '用户ID',
    `agent_id` bigint NOT NULL COMMENT '代理ID',
    `level_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '会员级别，如 VIP，SVIP，normal',
    `amount` decimal(10, 2) NOT NULL COMMENT '充值金额',
    `payment_method` enum(
        'alipay',
        'wechat',
        'appleiap',
        'other'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付方式：支付宝，微信，苹果支付，其他',
    `order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '交易号',
    `platform_order_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付平台订单号',
    `status` enum(
        'pending',
        'paid',
        'failed',
        'refunded',
        'closed'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态，0 未删除，1 已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员充值记录表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_membership_user_config`
--

CREATE TABLE `agent_membership_user_config` (
    `id` bigint NOT NULL,
    `user_id` bigint NOT NULL COMMENT '用户ID，标识代理用户',
    `agent_id` bigint NOT NULL COMMENT '代理ID',
    `product_id` bigint NOT NULL COMMENT '产品ID',
    `price_range_from` decimal(10, 2) NOT NULL COMMENT '定价区间最低',
    `price_range_to` decimal(10, 2) NOT NULL COMMENT '定价区间最高',
    `price_ratio` decimal(5, 2) NOT NULL COMMENT '定价区间收取比例',
    `price_increase_amount` decimal(10, 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 '记录更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态，0 未删除，1 已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员代理配置表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_order`
--

CREATE TABLE `agent_order` (
    `id` bigint NOT NULL,
    `order_id` bigint NOT NULL,
    `agent_id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL,
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- 表的结构 `agent_platform_deduction`
--

CREATE TABLE `agent_platform_deduction` (
    `id` int NOT NULL,
    `order_id` bigint NOT NULL DEFAULT '0' COMMENT '订单ID',
    `agent_id` bigint NOT NULL COMMENT '被抽佣代理ID',
    `amount` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `type` enum('cost', 'pricing') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'cost',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理平台扣除表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_product_config`
--

CREATE TABLE `agent_product_config` (
    `id` bigint NOT NULL,
    `product_id` bigint NOT NULL COMMENT '产品ID',
    `cost_price` decimal(10, 2) NOT NULL COMMENT '成本价',
    `price_range_min` decimal(10, 2) NOT NULL COMMENT '定价区间最低',
    `price_range_max` decimal(10, 2) NOT NULL COMMENT '定价区间最高',
    `pricing_standard` decimal(10, 2) NOT NULL COMMENT '定价标准',
    `overpricing_ratio` decimal(5, 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 '记录更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态，0 未删除，1 已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理产品配置表' ROW_FORMAT = DYNAMIC;

--
-- 转存表中的数据 `agent_product_config`
--

INSERT INTO
    `agent_product_config` (
        `id`,
        `product_id`,
        `cost_price`,
        `price_range_min`,
        `price_range_max`,
        `pricing_standard`,
        `overpricing_ratio`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`
    )
VALUES (
        1,
        1,
        12.80,
        12.80,
        300.00,
        59.80,
        0.10,
        '2025-02-26 00:04:13',
        '2026-03-01 16:38:53',
        NULL,
        0,
        0
    ),
    (
        2,
        2,
        12.80,
        12.80,
        300.00,
        59.80,
        0.10,
        '2025-02-26 00:04:13',
        '2026-02-28 11:23:22',
        NULL,
        0,
        0
    ),
    (
        3,
        3,
        8.80,
        8.80,
        200.00,
        39.80,
        0.10,
        '2025-02-26 00:04:13',
        '2026-02-28 11:24:13',
        NULL,
        0,
        0
    ),
    (
        4,
        4,
        8.80,
        8.80,
        300.00,
        49.80,
        0.10,
        '2025-02-26 00:04:13',
        '2026-02-28 11:18:51',
        NULL,
        0,
        0
    ),
    (
        5,
        5,
        11.89,
        11.89,
        300.00,
        59.80,
        0.10,
        '2025-02-26 00:04:13',
        '2026-02-28 11:23:37',
        NULL,
        0,
        0
    ),
    (
        6,
        6,
        8.80,
        8.80,
        200.00,
        39.80,
        0.10,
        '2025-02-26 00:04:13',
        '2026-02-28 11:25:21',
        NULL,
        0,
        0
    ),
    (
        7,
        7,
        6.80,
        10.80,
        200.00,
        49.80,
        0.08,
        '2025-02-26 00:04:13',
        '2026-02-28 11:23:47',
        NULL,
        0,
        0
    ),
    (
        8,
        27,
        6.80,
        6.80,
        200.00,
        49.80,
        0.08,
        '2025-02-26 00:04:13',
        '2026-02-28 11:23:54',
        NULL,
        0,
        0
    );

-- --------------------------------------------------------

--
-- 表的结构 `agent_real_name`
--

CREATE TABLE `agent_real_name` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `agent_id` bigint NOT NULL COMMENT '代理ID',
    `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '实名姓名',
    `id_card` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '身份证号',
    `status` enum(
        'pending',
        'approved',
        'rejected'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending' COMMENT '认证状态（认证中、通过、拒绝）',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `approve_time` datetime DEFAULT NULL COMMENT '认证通过时间',
    `reject_time` datetime DEFAULT NULL COMMENT '认证拒绝时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理实名认证表';

-- --------------------------------------------------------

--
-- 表的结构 `agent_rewards`
--

CREATE TABLE `agent_rewards` (
    `id` int NOT NULL,
    `agent_id` bigint NOT NULL,
    `relation_agent_id` bigint DEFAULT NULL COMMENT '关联代理ID',
    `amount` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `type` enum(
        'descendant_promotion',
        'descendant_upgrade_vip',
        'descendant_upgrade_svip',
        'descendant_stay_active',
        'descendant_new_active',
        'descendant_withdraw'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理奖励表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_wallet`
--

CREATE TABLE `agent_wallet` (
    `id` bigint NOT NULL,
    `agent_id` bigint NOT NULL,
    `balance` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `frozen_balance` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `total_earnings` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `withdrawn_amount` decimal(10, 2) NOT NULL DEFAULT '0.00',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理钱包表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_wallet_transaction`
--

CREATE TABLE `agent_wallet_transaction` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `agent_id` bigint NOT NULL COMMENT '代理ID',
    `transaction_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '交易类型:commission(佣金收入)、withdraw(提现)、freeze(冻结)、unfreeze(解冻)、reward(奖励)、refund(退款)、adjust(调整)等',
    `amount` decimal(10, 2) NOT NULL COMMENT '变动金额(正数为增加,负数为减少)',
    `balance_before` decimal(10, 2) NOT NULL COMMENT '变动前余额',
    `balance_after` decimal(10, 2) NOT NULL COMMENT '变动后余额',
    `frozen_balance_before` decimal(10, 2) NOT NULL COMMENT '变动前冻结余额',
    `frozen_balance_after` decimal(10, 2) NOT NULL COMMENT '变动后冻结余额',
    `transaction_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '关联交易ID(订单号、提现申请号等)',
    `related_user_id` bigint DEFAULT NULL COMMENT '关联用户ID(如佣金来源用户)',
    `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注说明'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理钱包流水记录表';

-- --------------------------------------------------------

--
-- 表的结构 `agent_withdrawal`
--

CREATE TABLE `agent_withdrawal` (
    `id` bigint NOT NULL,
    `agent_id` bigint NOT NULL COMMENT '代理ID',
    `withdraw_type` tinyint NOT NULL DEFAULT '1' COMMENT '提现类型:1-支付宝,2-银行卡',
    `withdraw_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '提现单号',
    `amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '提现金额',
    `actual_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '实际到账金额（扣税后）',
    `tax_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '扣税金额',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态:1-申请中,2-成功,3-失败',
    `payeeAccount` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '收款人账号',
    `bank_card_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '银行卡号',
    `bank_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '开户支行',
    `payee_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '收款人姓名',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态:0-未删除,1-已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理提现记录表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `agent_withdrawal_tax`
--

CREATE TABLE `agent_withdrawal_tax` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `withdrawal_amount` decimal(10, 2) NOT NULL COMMENT '提现金额',
    `exemption_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '免税金额',
    `taxable_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '应税金额',
    `tax_rate` decimal(5, 4) NOT NULL DEFAULT '0.2000' COMMENT '税率，如：0.2000表示20%',
    `tax_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '应缴税费',
    `actual_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '实际到账金额',
    `year_month` int NOT NULL COMMENT '所属年月，格式：202401',
    `tax_status` tinyint NOT NULL DEFAULT '0' COMMENT '扣税状态：0-待扣税，1-已扣税，2-免税，3-扣税失败',
    `tax_time` datetime DEFAULT NULL COMMENT '扣税时间',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注信息',
    `agent_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到代理用户表的id',
    `withdrawal_id` bigint NOT NULL DEFAULT '0' COMMENT '关联提现记录表的id',
    `exemption_record_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到免税额度记录的id'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理提现扣税表';

-- --------------------------------------------------------

--
-- 表的结构 `agent_withdrawal_tax_exemption`
--

CREATE TABLE `agent_withdrawal_tax_exemption` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `year_month` int NOT NULL COMMENT '年月标识，格式：202401',
    `total_exemption_amount` decimal(10, 2) NOT NULL DEFAULT '800.00' COMMENT '月度免税总额度',
    `used_exemption_amount` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '已使用免税额度',
    `remaining_exemption_amount` decimal(10, 2) NOT NULL DEFAULT '800.00' COMMENT '剩余免税额度',
    `agent_id` bigint NOT NULL DEFAULT '0' COMMENT '关联到代理用户表的id'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代理提现免税额度表';

-- --------------------------------------------------------

--
-- 表的结构 `authorization_document`
--

CREATE TABLE `authorization_document` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `user_id` bigint NOT NULL COMMENT '用户ID',
    `order_id` bigint NOT NULL COMMENT '订单ID',
    `query_id` bigint NOT NULL COMMENT '查询ID',
    `file_name` varchar(255) NOT NULL COMMENT '文件名',
    `file_path` varchar(500) NOT NULL COMMENT '文件路径',
    `file_url` varchar(500) NOT NULL COMMENT '文件访问URL',
    `file_size` bigint NOT NULL DEFAULT '0' COMMENT '文件大小(字节)',
    `file_type` varchar(50) NOT NULL COMMENT '文件类型',
    `status` varchar(20) NOT NULL DEFAULT 'active' COMMENT '状态(active/expired/deleted)',
    `expire_time` datetime DEFAULT NULL COMMENT '过期时间(永久保留设为NULL)',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '授权文档表';

-- --------------------------------------------------------

--
-- 表的结构 `example`
--

CREATE TABLE `example` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `api_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'API标识',
    `feature_id` bigint NOT NULL COMMENT '关联feature表的ID',
    `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '示例表' ROW_FORMAT = DYNAMIC;

--
-- 转存表中的数据 `example`
--

INSERT INTO
    `example` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `api_id`,
        `feature_id`,
        `content`
    )
VALUES (
        35,
        '2025-09-15 22:45:09',
        '2025-09-21 22:31:28',
        NULL,
        0,
        0,
        'DWBG8B4D',
        67,
        '[encoded data, 29784 characters]'
    ),
    (
        36,
        '2025-09-15 22:45:09',
        '2025-09-21 22:31:42',
        NULL,
        0,
        0,
        'JRZQ4B6C',
        69,
        'qIw0D0X6DGRI0kC8c+RxEKlAlQKDcg5F9iAB1BZRVrjgnFcOfs9dsGK4nqPzy2wM85V2TptNfzRGXKWS9ZpoyXka/tjfnS0Tj0R8L8baccdJzrl2xElu8znK6fHk4BbCTXUI2qlWkFQ7SvBeg1GZNwtxHY1+zAYDkjuEiehhyepHU9RmJegxU5GFCz8sNDeVMbG/OLkaWYkR6pZCmxUR7lecw4VmWXmbiUtztjCAQ6YrfjjNEgIOFhq4rYX+y5eWjiSP1OIae3FZ8bgc+8fVHuGm2O+K8PaZeZATjwfPAY7HdvzGC9gqidQb0gL3oaGId3XQOG5ogyYTj1IzSpAdVV58d5YYKn5dpn7RH0wz1wc4pwO0NTFaa8gTWRzVSTztlyLZWWuUjOYyzMzsIsjysLa82il2mn6a4qkc/oRenf/bm7uH6simzl5PiEMe2WK8sQuhh3lk2dDtrWFsrNEXan3tb6d65PgRr8dO6aQWIElRxZrN/WUXchGK15p4rA7hxUm4XzDgTGmZ5hh3MFd26qE5RsMYOsIK9u0VibV4m4mXtebxXZTQ68krjz94NXnAc+p7u1NjcchdN/L+py0aZ/Xf11ci3yULrRLlDBvOitFlxa+rwkuRoYZsdi24W6QqOxOA7RFx1sKBemspkEyuSO0sWxMjitVVYi4DrqdcqCfDdHZwli84ms5uiaMapOip'
    ),
    (
        37,
        '2025-09-17 18:20:31',
        '2025-09-30 18:00:11',
        NULL,
        0,
        0,
        'JRZQ09J8',
        70,
        'fnzxyJ/OiwJaWhuRCxHPJFQod4xr6oFpkujFLNWXxiMTDXOp1EoQF0C4i8FVEbmuXdsNapKkYh8wHZhcR21R7TfTb5HaRKL6Q53/RxeWJwHZSwVzTbbOjcXNBII9ijB2swwuTKOfI1FTxaPYBfBwcpUz7Vksu1xX30G1J1YYy73DlMNMbhPW5wBtelAvryHWvcAm7N8dXUdmPM+QCNZQQg=='
    );

INSERT INTO
    `example` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `api_id`,
        `feature_id`,
        `content`
    )
VALUES (
        38,
        '2025-09-17 20:32:33',
        '2025-09-30 18:56:25',
        NULL,
        0,
        0,
        'DWBG6A2C',
        68,
        '[encoded data, 23040 characters]'
    ),
    (
        39,
        '2025-09-18 20:32:51',
        '2025-09-21 22:31:53',
        NULL,
        0,
        0,
        'JRZQ5E9F',
        71,
        '[encoded data, 13932 characters]'
    );

INSERT INTO
    `example` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `api_id`,
        `feature_id`,
        `content`
    )
VALUES (
        45,
        '2025-09-21 02:45:12',
        '2025-09-30 18:52:58',
        NULL,
        0,
        0,
        'QYGL3F8E',
        59,
        '[encoded data, 476140 characters]'
    );

INSERT INTO
    `example` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `api_id`,
        `feature_id`,
        `content`
    )
VALUES (
        46,
        '2025-10-18 14:45:51',
        '2025-10-18 14:45:51',
        NULL,
        0,
        0,
        'IVYZ81NC',
        72,
        'NqH/2/mBEFq1BuA/qGgg+1cLcfloIiiwKeBSDunSEMStn7Cpq45C+xb+GtdJS2G6m4zOTiocxdfb3dQvfpC5H7yxEOyzaG/HpBxIXjrJHEVeQ9z5dJ+bgZNlgQrvBD/N4WuvL6UIFLlo70aIxWjdX/65kATr4qVYwPa3tZQR1rZgvHpU3RD30EV2+RDIvY0kcwyjjtr0b2gHBZiJrtYfxlFJsXe/BR6ns2b0TSSGo0QImJAlT8idq/dh5hVA3qMGUUw738nz7SFVbzjpghbIv+y41vOuUobcac0P/RoWhizUCPqGwtrPco4kDnuhBLS9tSbS/qSf0h8XTJlq84kGAVWNlK/fK9RCODGl39agI5t1d6JczX6T/xpjppEaKm9xi1hB+dNFLWUWkjS1jHzMqA=='
    ),
    (
        47,
        '2025-10-28 22:03:30',
        '2025-10-28 22:06:42',
        NULL,
        0,
        0,
        'QCXG7A2B',
        77,
        '7NLhryd2y3AZhisMRHa0Sr/skszIb7qmT7Jbdo8vxNA='
    ),
    (
        48,
        '2025-10-28 22:06:57',
        '2025-10-28 22:06:57',
        NULL,
        0,
        0,
        'QCXG9P1C',
        79,
        'bGfP5JrgFYAO735YdC8AvuwQgeDhRK+JXji7QeM1ITN5z/x0HkDd0OKH4FimlNBssh7AALWdkHXJAa41uBzJMUtxdh1Dn0i5UUfdAtlZ+YEccl/AZjMLvj+Rd47I/ssWiyrpGeu/WbhDHcJir5CqjoOh/c5sH/oECYFpw7o1PWK8rw8rRsqFpcuxp9LCl1Fa+wqkz3XmXOe/fVL1IoQs4tkkzzyJwYiyB08ddK8ZAStJuRnT0wOfgVCkSu9vB6fEL5vDahJ09NEidk/0m0s/IkB7IySvsCWtKA0zha7RvyztNdr5BIgwDLiewToACY+q9kfxzx9/nqmA4VIwQwLjX0gRqCE9VZfMFY7jFfxtMbEggNBIIlVNWNRXIgkDZcHEt02/zF1jwN+9pGMh2C/iNGgIIb3Dy/KhHrpkcMGGD2Y4I+f48V4Xh6JO87A0zjhuDaYQS7qUOafHBzL979kgSouCKAZ/NZp0VW61BqehS8wm1MWeWFww1PLaFZZxNzZPz2Jt4vdlutDOjFWJtjWjKZaLpABWcwzYcDV3C3VE0EWgFZ8e5yqFThP234ABrF1GoVcwcsYNbz3kFAuujHrCo3NXvMlcWyMb0vnI1LGaao0='
    ),
    (
        49,
        '2025-10-28 22:09:59',
        '2025-10-28 22:09:59',
        NULL,
        0,
        0,
        'IVYZ7F3A',
        78,
        'nbft302GLyaG+PiCfirKy3w/dRz0rkZN71OI5iZ1yl0np8+maB+1pJNZXb/W4GIMjh5xu+GOcB5ZsiPOgqKXvMxf3GB6OLzWHQeRoJAewuYLuIS/goHWeny+X6FY6lcV7T6m4GO/qVeSQhmnFarGLXM1LB3deYzPGXZoP1VhgmXlD6u1tWhXgLCF1ljpgkJmoagPO6t+G1QOG4BLrpWPcRSKc0Tg005EsqZh211aSBzbhIGAaZjfO/RjtLs5WYP/lBUz69firMgSjEpBTZxN5mq2COlswdlPVbLYolilvCTz7LMuRviSPFn55XFiJ/uPJwNG06l4Z9IZGcPNtDnd9hm0PqCS5V8PNkAgJxP4hwakOJYV09iztTSEujaP/x8JI6XTcvhZYS6JgfbFKItMOgFy6cXgSHMfQzVWld4QloJh3TFjCNp9PCG5m+lO/AwQRYoYYdZ0ipu0gtc+JcT1qNXsH6s8zPfLLHaleyVrrZUmyA71g5dqeY+TuK7p58Vh4C5kSlWA+sMjALPHUxfSrvR2xZimY/e9k7o0xwGmz9mYJybu2EFE29ZiJnk03efvLF2CELuTY52Hyl1gj55l/Q=='
    ),
    (
        50,
        '2025-11-06 22:38:52',
        '2025-11-06 22:38:52',
        NULL,
        0,
        0,
        'FLXGDEA9',
        73,
        'tJuhZye3TjV1LnQ+YXtEtq63SG+NvnGI7KC32NTBMSqhQ/8fEEw2YNF0la7b0SkW3nqfrKTxB9J9uM22ghpjx998D2a8VwQvxniSFocpmnaOBGTgjgSPVcqZMGzOn/2TJWww+G9cxsEtMwsvCmsv0RMCGOfV/zyxaCLk2MWMmyZVkxPOJt+BWhM4+SgUawHY'
    ),
    (
        51,
        '2025-11-10 16:21:59',
        '2025-11-10 16:23:43',
        NULL,
        0,
        0,
        'IVYZ3P9M',
        80,
        'BHK9tIb7axlDP6zKha9jowNss+XkG8CYLSckuCu3T/1hD38w1w+SMh+zpR4un7Dj9tPDCoqd0jRtJBvmft6vRg69/gKCLskwovUXZ+jXXxODrwwb5DTBs7B9uRAj+OUm/P8LazWT1MdsxSGlx3xNGvew/kwU3mjOZx97z+zhnBbehC/6QflKveapN/4pDCHDltVaC+cObX1D7oRy/HtWito+gNYOIbT/HpDFveLuiSiKGVatXol17HS3LZUWLAo1XX+fi8O7y4sOMRPhXrbMA8rSPQbICuxH+OpFXvWprW9uvCaNCWl3qlupz/B+2MGCCG5rf/0KdOOi7/zbFPys+C82VN1Mu5UhhGb8YEBPfNlb/Um7axe/SPadXz2BRw1o+Ql3qgkSliA5IRUeHz7MWNSHZ3c8S0be9VBEyJOTLdUS5WBNhI2M8fGwXLJqchcA4TN3We0la4IPRdfQQG65lmJgNFEtD0bxyloNAhqRKm+gv6n+pW7Y+ejnKH7u7gMD8YBGkwsT1vrJaLiTj0UnCKv8fBJvogyTCiEV+1BcI4myhuwsdQgrG3/0Ztftob9YlbuEcREXPMW3DOMMOmmgn/DAetfMdsqCW0A449rhDRVkgHfMdlQ5EMXXxPb6ioZb1Mos2zdHKf6UKwT99siMpT5dG9bXFpB5bpXIJzL7IU3Z0kUs4B1YbUIF3e4wJ+VxHFmBMxFp2TOUdpvP9DaVcGwtGhL1s00qfN6vyDsClpZ7Hl347h9XBVDvNMNwBSQ4A+/y836fGqv0AGx8jWd4xVDtJhnUlq+6upNcM7wzHEN+aX0vVMsy4q2Mz1hdV06FIZCFkuS+AwxwdXivbkFl9G9vTGOcVv72oM9xEjYljqKq8tYJWMwh70K300qFaoyTU3jOLqvul+vmhASExp3NONJMDDzwJqpQyTQIH0pYo6WLdq3rEC9F5giaqWjnAyRuAKX+N8kMDYKDKRIJr4t6ZGcy47vCJIAa6C7exoi2QiYaXtZIrJ22PaGZYkWVG4RyT1O5GHPW9wsBi+pErur+oGaOfYSfBEGSmR+sKrbWE1rH0L3M/Mr6lDjsgWkvdObZzeeLClIB52QfaHxPcjMNO6Wg33i3USO6PMhY9szTgN9lXlYyY/fxp65EjPgLndjqFdkLGNr4xPR4e7lbzNFRIA=='
    ),
    (
        52,
        '2025-12-24 19:37:49',
        '2025-12-24 19:37:49',
        NULL,
        0,
        0,
        'FLXG7E8F',
        81,
        '[encoded data, 29848 characters]'
    ),
    (
        53,
        '2026-02-01 17:23:58',
        '2026-02-01 17:23:58',
        NULL,
        0,
        0,
        'JRZQ8B3C',
        82,
        'JuhZ2tslSZ8pzhbTL9sR4mWpJc0JldHOSHqrCp6tXiY3tiQMvguSl75lqTr0Vf8JMaVIMlHuDhFK5kULJm8GR7SOsUMgxFM+XfBtvbXko6cJiqrzDNvjkYNnNKNXr4LyNakRFX9szmquAqz5o6/KRegjGD9lE/ZGt9BVAWxXKl4nFriYdHmnuqPxms3vCJfoRidQ1k8bCSWfMHmVG/nsXw=='
    ),
    (
        54,
        '2026-03-01 16:09:55',
        '2026-03-01 16:09:55',
        NULL,
        0,
        0,
        'IVYZ0S0D',
        83,
        'cl+JP9yR1Rx/nLmFmTfZuCeEWFf3Sac/xkl98cG7V7JHdytJ3d7irPK93X4YT63cw07jATWBNJdDR26IIB4kKKTllclOzvo6XDSAIxjzv2Kk5PA00uFjd2XLbu+7l0yyse4UGdbwYw3jUmMwXyAsqem6f+VpHi4vZv+kgiY5tJLV5s7q24ljkttm6DZ1B7yrZRQkSsj7I9n+fgBPC+rHa508xby3qQkn+LzbfH4EmpIRz13h8SBn7J+zBrksYkfhTwv4jPafcNoKlRf0W+0c7xjbycWRKutqxnyvbSal/1GFRJAGpkp4fC6FWTv4nlExMYd1evIv84+GvHnhGCLpnLJsdTYnr88yYHFM/WcMsj2M9fSi65sBO8iy4OayQW/mFx866LQi0Qh2hKYg3/hstdg/SNRJo1UJuXC3QPkqHcFY2Hh/JufdFqoxYKXBmf32KSOjKP1EkTwdhOgNDdWmR619fN/sUahxf/cPahrGhmW6a4zkbn3LLtqwXZFcKwVJaJjpAHuHvyqdRDHe2FffQ3Tj5YcTLaCsdlIqqb0C+1348lY5V5uOSsowxnMDRLwsHQd4XhZ9dw2XMtvOCJLiO67paYC0YbMZ9QmelaXEBUCNgdBtzMXRoA0KulMlBmm+9NhTMVX1ls+yArhxn1WvQuXfF8gY5XrRnM3cMjt2EwJ3ZLAlU3DwrIY1YRN3yWSHMOdVD1vIK930m5RvtovPNQ3vVk+krD7ndYMcHT4XBcSXBb0lZW9NFQysxluBWwnE+aFOwew6ZzC+1WFuTYpYIdbqu/Tq9EF9yVGs+wsdoHKtjncuXSRESunult3jfXBwGTuM3Uf8/2drDcSJN56av49Dg5bKCGD7BPwvBUpwJTN5e6ngDwO1Ld9CwJ3jDPVSI1k/XpQc02m0lQbdCnDsl5bROYkcS4IGfwecvichrCfuEq+1LL2JGuVc8dpzGMKOQy7r2sZ3L06HlrdOOZ2ThYHj4Wk2DLZ0PMQxhIwr5CzyEgmdFFbsSGrfr0IXE8xBz6Z0Iti7/7IB6x09pv91O3q9UZFa8/2gbxbmfd3DiIQw0Hs2rrpbg9jDIX1QhPTXwcElzuG4OJiMjYgRIEB+bf3nTA0VKyOagzqek6ipnnLO33uMTCgMiXh+rNPvjOlgCdf5LGUSvn9pYbTQXrK6gOuNQRylUzvo3FVXGCS6Gc639gjkPISwDHe4AY7UoXlRAZYVj1ME3qXEORuFIbQ+ZZhI4kd95KS2a9a2Ex/jgbAG2BnOYknEBr8iXU5MumCMl3VO+zsTjFRFRINVns4visHiItFAflPUTZOY6vhkUaveGpZh07wf4Qg5Z4+73fEZ8QTIX/Aahh374KkA2r6uPRgerjnjQqVtmZqru8lWyaDZwlaig1vjO6qjLvm8KiAhU7UTrgim+RBGA4gHarZB5xU9faGsDFht0W5HTlZQ9oglCth24A4arHmhuAjJCfSf7mATtU6oYlKL0QUvp4g4fBzF03HLSbakbuUFh2AWQ56r6bg2yEihr1PVvdAXlY7oZtUPqFv+qL32wF0jPvF96yC5t0Mvtw5m0uRS8S5hSn4mWwjcs32rGs1zKwHsYdWaAcgSCyCJmMSFEEwugvyLfY9xb61fXADslUDRcAey80kFkXT2tHPVoP/8qYkShZefk6OD9UY1PdRkPZKFociYmDcLKqASO+ENR/x5VGu5S1u8/iQzbXLSMomAksIxkuWE0eOggcEBuzFcZLbMa5pHttadTSVGkTsXIsj87oXVLD05T8Vzge2Q4VMvTG5jNpQLmVgPaVghI5ZboGxZvSm1mf60dSpb4DvRqDj2eA7O5gl8lVY+rQ89TetUhGUN1wlMVnRkun/T9V/X3ZLfCgmbfncAVy3a7l0we6E5nEdjuIXOmOB9J2spbV9lk17lAp7+PKYPJHYa1PxORqD+Xl//2Tp0UniKaBbnuu28t20ZtnagEpGTtuK6LkGgFI47tXOQjrRfrFWOTb5T9eG6FK2FGnNKowEAABc4jjYPv9+FzqEZmlf1RyKW6c1XnxkOqeR1BSar5ULYiKYPuxtz0LMfd50oTzVRxg7gEXEjz3jyYj+WnNMRbeJRbNract46QKaHBaFnoc1hYClF3QFSMwQb2zKgBKUCvdFtZXp0rtisMRn8K0rJ9kCa6KiKHrZmQ9Kdg5xtuCvvtmeMeYUIej64k7RTF+lYFvz2OIMmbidhRTtgMkrmiTx9viTXIKb9Oqo62xCGMDGnpEr0gGD2lEX7ppRnH8/OUrAxk9RWY7dkE8e//9wonVEk/2f3kFXfLK0nRRAy2bxt/zRfaRzwVmWwLe9/RDsQxwP+SIPXM+hMgFD66ByVStQXpOvblzRxOyKQLHwD2XgzsuJ+Yiz6tQRHCpQLou5/mKpRM1IYE3aiUikvmNA/lq7SbHgLj/CIoYf3R3kYJPVqeYjaeAmeoQ4f0w7uqehnGVbFlfQ3lCslYifEHi6NN1zrkfSxbf572BMdpP6Nf6q5zAo2LWzMtD5Ya4fbCWOiJRco0cT1cl54pwlzmwPu68rIlz9dV/xSBybVTvktiQLje/knVKUrXNP5NoarnRP3VXqmEue08yEzcKGqPGjZLl4JcTCXVXzQw/p3bz2tGiBqn5Ryhub5JFQOlDPlAaxyhhkgjRQIbUHpv7LNA9Mmkslp4brWypSE2c32lq3NbFyrySUZpUMrHXQb6I9D5oncyHka6TtFsylGMfrpj1b/xe3sMluG29Z+//k6qYSwcX91lwyHeCUkx2/+hXwPHM1wNx758FFhNctUPMVPTC/D1X3H3FJlVYb+1J7z217s+A56+MQPBZmtGJldgbfWLb0ZZjSYXZYyQ5LAY67EfBD9ZmPajAX4i/ZafIWs9m2NVOt1+2aL1p4BQnn+rjW/WQcsLnZN51NtVoHm5S/hO8h/ZpxPhpqrMbHlMeTrPn3e0k3rK0tiFwBX0AcsB22Keu6Eq7ckpLAFVAPg6fY='
    ),
    (
        55,
        '2026-03-01 16:10:17',
        '2026-03-01 16:10:17',
        NULL,
        0,
        0,
        'IVYZ6M8P',
        84,
        'qqcWBqlep8YSZ0J8KivbH1nU/e83qZTpLRz2ka5uEHgcWkjqyq9BYD5msilcwORF/znDGUnpGsDePVSPge4ncivfwkGYDMcKEbNLXeVBRmgvvSzXiGKXrPRQxn2UOewKFLzc6A2WLsN9pVQiRJjgOsI/bPW8EBEI6FB1c+EAp/VZhRtw+Z1zZ6pqOwk1ogOJ1RSisjpDDoXhTwZ95UkdJnH5KsxArpfqG9SlCQVwK7J1dfW141zTElLNzOHaQo3MAAxYBati33mOk6gaxQ1LGYwH7tbx5Aa5nuu40RuyOcE='
    );

-- --------------------------------------------------------

--
-- 表的结构 `feature`
--

CREATE TABLE `feature` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `api_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'API标识',
    `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '描述',
    `cost_price` decimal(10, 2) DEFAULT '0.00' COMMENT '成本价'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '功能表' ROW_FORMAT = DYNAMIC;

--
-- 转存表中的数据 `feature`
--

INSERT INTO
    `feature` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `api_id`,
        `name`,
        `cost_price`
    )
VALUES (
        59,
        '2025-04-21 14:54:53',
        '2026-04-01 15:29:44',
        NULL,
        0,
        1,
        'QYGL3F8E',
        '人企关系加强版',
        10.00
    ),
    (
        67,
        '2025-09-21 20:01:50',
        '2026-04-01 15:29:41',
        NULL,
        0,
        3,
        'DWBG8B4D',
        '谛听多维报告',
        10.00
    ),
    (
        68,
        '2025-09-21 20:01:50',
        '2026-04-01 15:29:38',
        NULL,
        0,
        2,
        'DWBG6A2C',
        '司南报告服务',
        10.00
    ),
    (
        69,
        '2025-09-21 20:02:26',
        '2026-04-01 15:29:35',
        NULL,
        0,
        3,
        'JRZQ4B6C',
        '借贷表现',
        10.00
    ),
    (
        70,
        '2025-09-21 20:02:26',
        '2026-04-01 15:29:24',
        NULL,
        0,
        2,
        'JRZQ09J8',
        '收入评估',
        10.00
    ),
    (
        71,
        '2025-09-21 20:02:26',
        '2026-04-01 15:29:21',
        NULL,
        0,
        2,
        'JRZQ5E9F',
        '借选指数评估',
        10.00
    ),
    (
        72,
        '2025-10-18 14:44:47',
        '2026-04-01 15:29:18',
        NULL,
        0,
        2,
        'IVYZ81NC',
        '婚姻状况',
        10.00
    ),
    (
        73,
        '2025-10-23 15:48:22',
        '2026-04-01 15:29:15',
        NULL,
        0,
        2,
        'FLXGDEA9',
        '本人不良',
        10.00
    ),
    (
        74,
        '2025-10-23 15:49:02',
        '2026-04-01 15:29:11',
        NULL,
        0,
        2,
        'IVYZ6G7H',
        '婚姻状态查询补证版',
        10.00
    ),
    (
        75,
        '2025-10-23 15:49:38',
        '2026-04-01 15:29:09',
        NULL,
        0,
        2,
        'IVYZ3A7F',
        '学历信息查询',
        10.00
    ),
    (
        76,
        '2025-10-23 15:49:49',
        '2026-04-01 15:29:05',
        NULL,
        0,
        2,
        'YYSY7D3E',
        '携号转网查询',
        10.00
    ),
    (
        77,
        '2025-10-28 21:25:16',
        '2026-04-01 15:29:01',
        NULL,
        0,
        3,
        'QCXG7A2B',
        '名下车辆',
        10.00
    ),
    (
        78,
        '2025-10-28 21:28:54',
        '2026-04-01 15:28:58',
        NULL,
        0,
        4,
        'IVYZ7F3A',
        '学历信息',
        10.00
    ),
    (
        79,
        '2025-10-28 22:05:42',
        '2026-04-01 15:28:56',
        NULL,
        0,
        3,
        'QCXG9P1C',
        '名下车辆',
        10.00
    ),
    (
        80,
        '2025-11-10 16:19:41',
        '2026-04-01 15:28:30',
        NULL,
        0,
        3,
        'IVYZ3P9M',
        '学历信息',
        10.00
    ),
    (
        81,
        '2025-12-24 19:34:24',
        '2026-04-01 15:28:27',
        NULL,
        0,
        4,
        'FLXG7E8F',
        '司法涉诉',
        10.00
    ),
    (
        82,
        '2026-02-01 17:23:31',
        '2026-04-01 15:28:24',
        NULL,
        0,
        1,
        'JRZQ8B3C',
        '个人消费等级',
        10.00
    ),
    (
        83,
        '2026-03-01 16:03:13',
        '2026-04-01 15:28:21',
        NULL,
        0,
        1,
        'IVYZ0S0D',
        '劳动仲裁信息',
        10.00
    ),
    (
        84,
        '2026-03-01 16:09:44',
        '2026-04-01 15:28:18',
        NULL,
        0,
        1,
        'IVYZ6M8P',
        '职业资格证书',
        10.00
    );

-- --------------------------------------------------------

--
-- 表的结构 `global_notifications`
--

CREATE TABLE `global_notifications` (
    `id` int NOT NULL,
    `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
    `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
    `notification_page` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
    `start_date` date DEFAULT NULL,
    `end_date` date DEFAULT NULL,
    `start_time` time DEFAULT '00:00:00',
    `end_time` time DEFAULT '02:30:00',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `status` tinyint NOT NULL DEFAULT '1',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `order`
--

CREATE TABLE `order` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自生成的订单号',
    `user_id` bigint NOT NULL COMMENT '用户ID',
    `product_id` bigint NOT NULL COMMENT '产品ID（软关联到产品表）',
    `payment_platform` enum(
        'alipay',
        'wechat',
        'appleiap',
        'other'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付平台（支付宝、微信、苹果内购、其他）',
    `payment_scene` enum(
        'app',
        'h5',
        'mini_program',
        'public_account'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '支付场景（App、H5、微信小程序、公众号）',
    `platform_order_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付平台订单号',
    `amount` decimal(10, 2) NOT NULL COMMENT '支付金额',
    `status` enum(
        'pending',
        'paid',
        'failed',
        'refunded',
        'closed',
        'refunding'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending' COMMENT '支付状态',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `pay_time` datetime DEFAULT NULL COMMENT '支付时间',
    `refund_time` datetime DEFAULT NULL COMMENT '退款时间',
    `close_time` datetime DEFAULT NULL COMMENT '订单关闭时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `sales_cost` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '销售成本'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `order_refund`
--

CREATE TABLE `order_refund` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `refund_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '退款单号',
    `order_id` bigint NOT NULL COMMENT '关联的订单ID',
    `user_id` bigint NOT NULL COMMENT '用户ID',
    `product_id` bigint NOT NULL COMMENT '产品ID',
    `platform_refund_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付平台退款单号',
    `refund_amount` decimal(10, 2) NOT NULL COMMENT '退款金额',
    `refund_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '退款原因',
    `status` enum(
        'pending',
        'success',
        'failed',
        'closed'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending' COMMENT '退款状态',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `refund_time` datetime DEFAULT NULL COMMENT '退款成功时间',
    `close_time` datetime DEFAULT NULL COMMENT '退款关闭时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '退款记录表';

-- --------------------------------------------------------

--
-- 表的结构 `product`
--

CREATE TABLE `product` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `product_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '服务名',
    `product_en` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '英文名',
    `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '描述',
    `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '备注',
    `cost_price` decimal(10, 2) NOT NULL DEFAULT '1.00' COMMENT '成本',
    `sell_price` decimal(10, 2) NOT NULL DEFAULT '1.00' COMMENT '售价'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品表' ROW_FORMAT = DYNAMIC;

--
-- 转存表中的数据 `product`
--

INSERT INTO
    `product` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `product_name`,
        `product_en`,
        `description`,
        `notes`,
        `cost_price`,
        `sell_price`
    )
VALUES (
        1,
        '2024-11-04 16:25:19',
        '2026-03-01 16:33:55',
        NULL,
        0,
        0,
        '入职风险',
        'backgroundcheck',
        '<p>【职场X光探测器】——司法级人才风险防御系统 当您向候选人发放offer时，是否透视过这些暗雷？ ⚡ 光鲜简历背后承接的竞业协议与商业壁垒前科 ⚡ 高管候选人关联的境外敏感行业投资版图 ⚡ 核心技术岗员工的学术论文抄袭黑历史 入职风险报告依托大数据技术连通国家权威数据库，为企业构建多维防御体系，让人力资源决策穿透信息迷雾。 法律声明： 本产品不提供背景调查服务，不涉及个人信息采集</p>',
        NULL,
        12.92,
        99.90
    ),
    (
        2,
        '2024-11-04 16:25:19',
        '2026-02-14 17:33:48',
        NULL,
        0,
        0,
        '小微企业',
        'companyinfo',
        '<p>【企业风险CT机】——司法级全息商业决策系统 当您评估一个企业的价值时，账面上的数据可能只是真相的冰山一角。企业风险报告依托大数据技术直连权威数据库，通过司法穿透、财务验真、关联网络三重扫描，为企业主构建「决策安全舱」，让投资并购不再盲人摸象。</p>',
        NULL,
        2.40,
        88.80
    ),
    (
        3,
        '2024-11-04 16:25:19',
        '2025-12-26 15:36:01',
        NULL,
        0,
        0,
        '家政风险',
        'homeservice',
        '<p>【家庭安全警报器】——家政人员风险防火墙 当您把家门钥匙交给陌生人的瞬间，是否担忧过这些隐患？ ⚠️ 自称「金牌月嫂」却遭前雇主控诉偷窃金饰 ⚠️ 持假健康证上岗的护工将传染病带入母婴室 ⚠️ 被法院列为老赖的保洁员卷走客户预付工资 家政风险报告依托大数据技术深度打通司法权威数据库，用司法级风控手段为您的家庭筑起三重防护网。</p>',
        NULL,
        2.40,
        39.80
    ),
    (
        4,
        '2024-11-04 16:25:19',
        '2026-02-14 17:34:06',
        NULL,
        0,
        0,
        '婚恋风险',
        'marriage',
        '<p>【婚姻照妖镜】——婚恋防骗预警系统 面对杀猪盘、重婚骗局等新型婚恋陷阱，仅查婚姻状态还不够！天远数据婚恋风险报告，深度融合全国司法大数据与民政婚姻档案，7x24小时扫描对方隐藏的「黑历史」与「风险关系链」，为您的感情与财产筑起法律屏障火墙。</p>',
        NULL,
        5.00,
        49.80
    ),
    (
        5,
        '2024-11-04 16:25:19',
        '2026-02-14 18:08:27',
        NULL,
        0,
        0,
        '贷前风险',
        'preloanbackgroundcheck',
        '<p>【信贷安全盾牌】——贷前风险诊断系统 当您审批贷一笔贷款时，未知的借款人司法炸弹可能正在侵蚀资产安全。贷前风险报告依托大数据技术深度融合司法等权威数据库，为金融机构构建多维防御网，实现风险层层递进从「经验判断」到「司法等级」的质升级。 法律声明： 本产品仅提供个人信用大数据检测，不提供放款和修复征信服务，不查央行征信，无任何爬虫数据</p>',
        NULL,
        5.58,
        88.80
    ),
    (
        6,
        '2024-11-04 16:25:19',
        '2026-04-01 15:27:57',
        NULL,
        0,
        0,
        '租赁风险',
        'rentalinfo',
        '<p>【租赁避雷针】——租客信用防火墙 当您交出门钥押金时，是否想过对方可能是「失信老赖」？ ⚠️ 表面光鲜的租客实为被法院执行的职业「租金能欠者」 ⚠️ 号称「房东直租」的二房东竟有非法集资前科 ⚠️ 隐瞒的群租集底让租客面临被清退风险无门 天远数据租赁风险报告依托大数据技术连通权威数据库，为房东构建多维防御体系，精准扫描高危租客，让资产安全从源头可控。</p>',
        NULL,
        0.00,
        39.80
    ),
    (
        7,
        '2024-11-04 16:25:19',
        '2026-02-01 17:25:02',
        NULL,
        0,
        0,
        '个人风险',
        'riskassessment',
        '<p>【人生风险雷达】——您的智能风险导航仪 在瞬息万变的时代，未知风险可能潜伏在每一次投资、职业跃迁或社交关系中。天远数据个人风险报告，通过AI大数据技术为您的信用画像、生活轨迹与决策路径进行360度扫描，像贴身导航仪一样提前预警风险盲区，助您掌控人生方向盘。</p>',
        NULL,
        3.60,
        49.80
    ),
    (
        27,
        '2025-09-21 20:03:32',
        '2026-02-14 18:08:06',
        NULL,
        0,
        0,
        '个人大数据',
        'personalData',
        '<p>【人生风险雷达】——您的智能风险导航仪 在瞬息万变的时代，未知风险可能潜伏在每一次投资、职业跃迁或社交关系中。天远数据个人风险报告，通过AI大数据技术为您的信用画像、生活轨迹与决策路径进行360度扫描，像贴身导航仪一样提前预警风险盲区，助您掌控人生方向盘。</p>',
        NULL,
        3.60,
        49.80
    );

-- --------------------------------------------------------

--
-- 表的结构 `product_feature`
--

CREATE TABLE `product_feature` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `product_id` bigint NOT NULL COMMENT '产品ID',
    `feature_id` bigint NOT NULL COMMENT '功能ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `sort` int NOT NULL DEFAULT '0',
    `is_important` tinyint(1) NOT NULL DEFAULT '0',
    `enable` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品与功能关联表' ROW_FORMAT = DYNAMIC;

--
-- 转存表中的数据 `product_feature`
--

INSERT INTO
    `product_feature` (
        `id`,
        `product_id`,
        `feature_id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `sort`,
        `is_important`,
        `enable`
    )
VALUES (
        6,
        2,
        59,
        '2024-11-20 01:28:38',
        '2025-09-21 20:27:25',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        50,
        26,
        1,
        '2024-12-13 11:35:04',
        '2025-06-19 15:41:14',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        52,
        24,
        6,
        '2024-12-13 11:35:04',
        '2024-12-13 11:35:04',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        53,
        23,
        7,
        '2024-12-13 11:35:04',
        '2024-12-13 11:35:04',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        55,
        8,
        37,
        '2024-12-13 22:53:21',
        '2024-12-24 22:17:35',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        56,
        25,
        8,
        '2024-12-16 10:40:26',
        '2024-12-16 10:40:26',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        57,
        9,
        38,
        '2024-12-24 22:20:19',
        '2024-12-24 22:20:19',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        58,
        10,
        39,
        '2024-12-24 22:20:40',
        '2024-12-24 22:20:40',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        59,
        11,
        40,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        60,
        12,
        41,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        61,
        13,
        42,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        62,
        14,
        43,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        63,
        15,
        44,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        64,
        16,
        45,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        65,
        17,
        46,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        66,
        18,
        47,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        67,
        19,
        48,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        68,
        20,
        49,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        69,
        21,
        50,
        '2024-12-24 22:22:17',
        '2024-12-24 22:22:17',
        NULL,
        0,
        0,
        0,
        0,
        1
    ),
    (
        99,
        27,
        67,
        '2025-09-21 20:03:49',
        '2026-02-01 17:26:27',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        102,
        5,
        67,
        '2025-09-21 20:26:51',
        '2025-09-21 20:26:51',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        103,
        2,
        68,
        '2025-09-21 20:27:25',
        '2025-09-21 20:27:25',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        108,
        1,
        72,
        '2025-10-18 15:11:20',
        '2025-10-28 21:23:07',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        109,
        4,
        72,
        '2025-10-18 15:11:32',
        '2025-10-18 15:11:32',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        111,
        7,
        67,
        '2025-10-28 21:34:33',
        '2026-02-01 17:26:30',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        113,
        4,
        68,
        '2025-10-28 21:35:43',
        '2025-10-28 21:35:43',
        NULL,
        0,
        0,
        3,
        0,
        1
    ),
    (
        114,
        3,
        68,
        '2025-10-28 21:36:07',
        '2025-10-28 21:36:07',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        117,
        1,
        68,
        '2025-10-28 21:37:03',
        '2026-03-01 16:33:55',
        NULL,
        0,
        0,
        6,
        0,
        1
    ),
    (
        119,
        5,
        79,
        '2025-10-28 22:06:20',
        '2025-10-28 22:06:20',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        120,
        4,
        79,
        '2025-10-28 22:06:31',
        '2025-10-28 22:06:31',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        128,
        1,
        80,
        '2025-11-10 16:21:16',
        '2025-11-10 16:21:16',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        129,
        5,
        71,
        '2025-11-10 17:06:07',
        '2026-02-04 17:40:11',
        NULL,
        0,
        0,
        3,
        0,
        1
    ),
    (
        138,
        27,
        82,
        '2026-02-01 17:24:58',
        '2026-02-01 17:26:27',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        139,
        7,
        82,
        '2026-02-01 17:25:02',
        '2026-02-01 17:26:30',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        140,
        5,
        82,
        '2026-02-04 17:40:11',
        '2026-02-14 18:08:27',
        NULL,
        0,
        0,
        4,
        0,
        1
    ),
    (
        141,
        1,
        82,
        '2026-02-04 17:40:28',
        '2026-03-01 16:33:55',
        NULL,
        0,
        0,
        5,
        0,
        1
    ),
    (
        142,
        1,
        83,
        '2026-03-01 16:33:55',
        '2026-03-01 16:33:55',
        NULL,
        0,
        0,
        3,
        0,
        1
    ),
    (
        143,
        1,
        84,
        '2026-03-01 16:33:55',
        '2026-03-01 16:33:55',
        NULL,
        0,
        0,
        4,
        0,
        1
    ),
    (
        144,
        6,
        82,
        '2026-04-01 15:27:57',
        '2026-04-01 15:27:57',
        NULL,
        0,
        0,
        1,
        0,
        1
    ),
    (
        145,
        6,
        70,
        '2026-04-01 15:27:57',
        '2026-04-01 15:27:57',
        NULL,
        0,
        0,
        4,
        0,
        1
    ),
    (
        146,
        6,
        69,
        '2026-04-01 15:27:57',
        '2026-04-01 15:27:57',
        NULL,
        0,
        0,
        5,
        0,
        1
    ),
    (
        147,
        6,
        73,
        '2026-04-01 15:27:57',
        '2026-04-01 15:27:57',
        NULL,
        0,
        0,
        2,
        0,
        1
    ),
    (
        148,
        6,
        71,
        '2026-04-01 15:27:57',
        '2026-04-01 15:27:57',
        NULL,
        0,
        0,
        3,
        0,
        1
    );

-- --------------------------------------------------------

--
-- 表的结构 `query`
--

CREATE TABLE `query` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `order_id` bigint NOT NULL COMMENT '订单ID（软关联到订单表）',
    `user_id` bigint NOT NULL COMMENT '用户ID（直接关联到用户）',
    `product_id` bigint NOT NULL COMMENT '产品ID（直接关联到产品）',
    `query_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '查询params数据',
    `query_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '查询结果数据',
    `query_state` enum(
        'pending',
        'success',
        'failed'
    ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending' COMMENT '查询状态',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '查询结果表，存储关联订单的查询数据' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `query_cleanup_config`
--

CREATE TABLE `query_cleanup_config` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态：0-未删除，1-已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `config_key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置键',
    `config_value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置值',
    `config_desc` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置说明',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：1-启用，2-禁用'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '查询数据清理配置表';

--
-- 转存表中的数据 `query_cleanup_config`
--

INSERT INTO
    `query_cleanup_config` (
        `id`,
        `create_time`,
        `update_time`,
        `delete_time`,
        `del_state`,
        `version`,
        `config_key`,
        `config_value`,
        `config_desc`,
        `status`
    )
VALUES (
        1,
        '2025-06-06 16:27:50',
        '2025-06-06 19:58:39',
        NULL,
        0,
        0,
        'cleanup_cron',
        '0 3 * * *',
        '清理任务执行时间（cron表达式）',
        1
    ),
    (
        2,
        '2025-06-06 16:27:50',
        '2025-06-06 16:28:35',
        NULL,
        0,
        0,
        'retention_days',
        '15',
        '数据保留天数',
        1
    ),
    (
        3,
        '2025-06-06 16:27:50',
        '2025-06-06 19:58:23',
        NULL,
        0,
        0,
        'batch_size',
        '100',
        '每次清理的批次大小',
        1
    ),
    (
        4,
        '2025-06-06 16:27:50',
        '2025-06-06 19:58:23',
        NULL,
        0,
        0,
        'enable_cleanup',
        '1',
        '是否启用清理：1-启用，2-禁用',
        1
    );

-- --------------------------------------------------------

--
-- 表的结构 `query_cleanup_detail`
--

CREATE TABLE `query_cleanup_detail` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态：0-未删除，1-已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `cleanup_log_id` bigint NOT NULL COMMENT '关联的清理日志ID',
    `query_id` bigint NOT NULL COMMENT '被清理的查询记录ID',
    `order_id` bigint NOT NULL COMMENT '关联的订单ID',
    `user_id` bigint NOT NULL COMMENT '关联的用户ID',
    `product_id` bigint NOT NULL COMMENT '关联的产品ID',
    `query_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '查询状态',
    `create_time_old` datetime NOT NULL COMMENT '原记录创建时间'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '查询数据清理明细表';

-- --------------------------------------------------------

--
-- 表的结构 `query_cleanup_log`
--

CREATE TABLE `query_cleanup_log` (
    `id` bigint NOT NULL COMMENT '主键ID',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态：0-未删除，1-已删除',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `cleanup_time` datetime NOT NULL COMMENT '清理执行时间',
    `cleanup_before` datetime NOT NULL COMMENT '清理截止时间',
    `affected_rows` int NOT NULL DEFAULT '0' COMMENT '影响行数',
    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态：1-成功，2-失败',
    `error_msg` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '错误信息',
    `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注说明'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '查询数据清理日志表';

-- --------------------------------------------------------

--
-- 表的结构 `query_user_record`
--

CREATE TABLE `query_user_record` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `user_id` bigint NOT NULL DEFAULT '0' COMMENT '用户ID',
    `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '姓名密文（AES-ECB+Base64）',
    `id_card` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '身份证号密文（AES-ECB+Base64）',
    `mobile` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号密文（AES-ECB+Base64）',
    `product` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '产品类型，如 marriage/homeservice/riskassessment 等',
    `query_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '查询单号（与 order.order_no 一致，如 Q_xxx），用户提交查询时生成',
    `order_id` bigint NOT NULL DEFAULT '0' COMMENT '订单ID，关联 order 表，用户发起支付并创建订单后写入',
    `platform_order_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付平台订单号（支付宝/微信），支付成功后由回调写入',
    `agent_identifier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '代理标识，代理渠道时有值'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '查询用户记录表：姓名、身份证、手机号、支付订单号等，用于通过查询信息追溯订单';

-- --------------------------------------------------------

--
-- 表的结构 `user`
--

CREATE TABLE `user` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
    `info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
    `inside` tinyint NOT NULL DEFAULT '0',
    `disable` tinyint NOT NULL DEFAULT '0' COMMENT '0可用 1禁用'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `user_auth`
--

CREATE TABLE `user_auth` (
    `id` bigint NOT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
    `user_id` bigint NOT NULL DEFAULT '0',
    `auth_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '平台唯一id',
    `auth_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '平台类型'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户授权表' ROW_FORMAT = DYNAMIC;

-- --------------------------------------------------------

--
-- 表的结构 `user_temp`
--

CREATE TABLE `user_temp` (
    `id` bigint NOT NULL,
    `auth_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '平台唯一id',
    `auth_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '平台类型',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `delete_time` datetime DEFAULT NULL COMMENT '删除时间',
    `del_state` tinyint NOT NULL DEFAULT '0',
    `version` bigint NOT NULL DEFAULT '0' COMMENT '版本号'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '临时用户表';

--
-- 转储表的索引
--

--
-- 表的索引 `admin_api`
--
ALTER TABLE `admin_api`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_api_code` (`api_code`),
ADD KEY `idx_url_method` (`url`, `method`) COMMENT '优化接口查询';

--
-- 表的索引 `admin_dict_data`
--
ALTER TABLE `admin_dict_data`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_type_value` (`dict_type`, `dict_value`),
ADD UNIQUE KEY `uk_type_label` (`dict_type`, `dict_label`),
ADD KEY `idx_dict_type` (`dict_type`);

--
-- 表的索引 `admin_dict_type`
--
ALTER TABLE `admin_dict_type`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_dict_type` (`dict_type`);

--
-- 表的索引 `admin_menu`
--
ALTER TABLE `admin_menu`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_name_path` (`name`, `path`),
ADD KEY `idx_pid` (`pid`) USING BTREE COMMENT '优化层级查询';

--
-- 表的索引 `admin_role`
--
ALTER TABLE `admin_role`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_role_code` (`role_code`);

--
-- 表的索引 `admin_role_api`
--
ALTER TABLE `admin_role_api`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_role_api` (`role_id`, `api_id`),
ADD KEY `idx_role_id` (`role_id`) COMMENT '优化角色查询',
ADD KEY `idx_api_id` (`api_id`) COMMENT '优化接口查询';

--
-- 表的索引 `admin_role_menu`
--
ALTER TABLE `admin_role_menu`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_role_menu` (`role_id`, `menu_id`),
ADD KEY `idx_role_id` (`role_id`) COMMENT '优化角色查询',
ADD KEY `idx_menu_id` (`menu_id`) COMMENT '优化菜单查询';

--
-- 表的索引 `admin_user`
--
ALTER TABLE `admin_user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_username` (`username`),
ADD UNIQUE KEY `uk_real_name` (`real_name`);

--
-- 表的索引 `admin_user_role`
--
ALTER TABLE `admin_user_role`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_user_role` (`user_id`, `role_id`),
ADD KEY `idx_user_id` (`user_id`) COMMENT '优化用户查询',
ADD KEY `idx_role_id` (`role_id`) COMMENT '优化角色查询';

--
-- 表的索引 `agent`
--
ALTER TABLE `agent`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `uniq_user_id` (`user_id`) USING BTREE,
ADD UNIQUE KEY `uniq_mobile` (`mobile`) USING BTREE,
ADD KEY `idx_user_id` (`user_id`) USING BTREE;

--
-- 表的索引 `agent_active_stat`
--
ALTER TABLE `agent_active_stat`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_agent_date` (`agent_id`, `stat_date`) USING BTREE,
ADD KEY `idx_stat_date` (`stat_date`) USING BTREE;

--
-- 表的索引 `agent_audit`
--
ALTER TABLE `agent_audit`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `uniq_user_id` (`user_id`) USING BTREE;

--
-- 表的索引 `agent_closure`
--
ALTER TABLE `agent_closure`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_descendant_depth` (`descendant_id`, `depth`),
ADD UNIQUE KEY `unique_ancestor_descendant` (
    `ancestor_id`,
    `descendant_id`
) USING BTREE;

--
-- 表的索引 `agent_commission`
--
ALTER TABLE `agent_commission`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `idx_agent_id` (`agent_id`) USING BTREE,
ADD KEY `idx_order_id` (`order_id`) USING BTREE;

--
-- 表的索引 `agent_commission_deduction`
--
ALTER TABLE `agent_commission_deduction`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `idx_agent_id` (`agent_id`) USING BTREE,
ADD KEY `idx_deducted_agent_id` (`deducted_agent_id`) USING BTREE,
ADD KEY `idx_order_type` (`order_id`, `type`);

--
-- 表的索引 `agent_link`
--
ALTER TABLE `agent_link`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uniq_link_identifier` (`link_identifier`),
ADD KEY `idx_product_id` (`product_id`),
ADD KEY `idx_user_id` (`user_id`),
ADD KEY `idx_agent_id` (`agent_id`);

--
-- 表的索引 `agent_membership_config`
--
ALTER TABLE `agent_membership_config`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uniq_level_name` (`level_name`) USING BTREE;

--
-- 表的索引 `agent_membership_recharge_order`
--
ALTER TABLE `agent_membership_recharge_order`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_order_no` (`order_no`),
ADD UNIQUE KEY `unique_platform_order_id` (`platform_order_id`);

--
-- 表的索引 `agent_membership_user_config`
--
ALTER TABLE `agent_membership_user_config`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uniq_agent_id_product_id` (`agent_id`, `product_id`) USING BTREE,
ADD KEY `idx_user_id` (`user_id`) USING BTREE,
ADD KEY `idx_agent_id` (`agent_id`) USING BTREE;

--
-- 表的索引 `agent_order`
--
ALTER TABLE `agent_order`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_order_id` (`order_id`),
ADD KEY `idx_order_id` (`order_id`),
ADD KEY `idx_agent_id` (`agent_id`);

--
-- 表的索引 `agent_platform_deduction`
--
ALTER TABLE `agent_platform_deduction`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `idx_agent_id` (`agent_id`) USING BTREE,
ADD KEY `idx_order_id` (`order_id`);

--
-- 表的索引 `agent_product_config`
--
ALTER TABLE `agent_product_config`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uniq_product_id` (`product_id`) USING BTREE;

--
-- 表的索引 `agent_real_name`
--
ALTER TABLE `agent_real_name`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_agent_id` (`agent_id`),
ADD KEY `idx_status` (`status`),
ADD KEY `idx_id_card` (`id_card`) USING BTREE;

--
-- 表的索引 `agent_rewards`
--
ALTER TABLE `agent_rewards`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `idx_agent_id` (`agent_id`) USING BTREE,
ADD KEY `idx_relation_agent_id` (`relation_agent_id`) USING BTREE;

--
-- 表的索引 `agent_wallet`
--
ALTER TABLE `agent_wallet`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `uniq_agent_id` (`agent_id`) USING BTREE;

--
-- 表的索引 `agent_wallet_transaction`
--
ALTER TABLE `agent_wallet_transaction`
ADD PRIMARY KEY (`id`),
ADD KEY `idx_agent_id` (`agent_id`) COMMENT '代理查询流水',
ADD KEY `idx_transaction_id` (`transaction_id`) COMMENT '根据交易ID查询',
ADD KEY `idx_create_time` (`create_time`) COMMENT '按时间查询',
ADD KEY `idx_agent_id_create_time` (`agent_id`, `create_time`) COMMENT '分页查询代理流水';

--
-- 表的索引 `agent_withdrawal`
--
ALTER TABLE `agent_withdrawal`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_withdraw_no` (`withdraw_no`) USING BTREE,
ADD KEY `idx_agent_status` (`agent_id`, `status`) USING BTREE,
ADD KEY `idx_withdraw_type` (`withdraw_type`);

--
-- 表的索引 `agent_withdrawal_tax`
--
ALTER TABLE `agent_withdrawal_tax`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_withdrawal_id` (`withdrawal_id`) COMMENT '提现记录ID唯一',
ADD KEY `idx_agent_id` (`agent_id`) COMMENT '优化代理查询',
ADD KEY `idx_year_month` (`year_month`) COMMENT '优化按月查询',
ADD KEY `idx_tax_status` (`tax_status`) COMMENT '优化状态查询',
ADD KEY `idx_exemption_record_id` (`exemption_record_id`) COMMENT '优化免税记录关联查询',
ADD KEY `idx_create_time` (`create_time`) COMMENT '优化时间查询';

--
-- 表的索引 `agent_withdrawal_tax_exemption`
--
ALTER TABLE `agent_withdrawal_tax_exemption`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uk_agent_year_month` (`agent_id`, `year_month`) COMMENT '同一代理同一月份只能有一条记录',
ADD KEY `idx_agent_id` (`agent_id`) COMMENT '优化代理查询',
ADD KEY `idx_year_month` (`year_month`) COMMENT '优化按月查询';

--
-- 表的索引 `authorization_document`
--
ALTER TABLE `authorization_document`
ADD PRIMARY KEY (`id`),
ADD KEY `idx_user_id` (`user_id`),
ADD KEY `idx_order_id` (`order_id`),
ADD KEY `idx_query_id` (`query_id`),
ADD KEY `idx_status` (`status`),
ADD KEY `idx_del_state` (`del_state`),
ADD KEY `idx_create_time` (`create_time`);

--
-- 表的索引 `example`
--
ALTER TABLE `example`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_api_id` (`api_id`) USING BTREE,
ADD UNIQUE KEY `unique_feature_id` (`feature_id`) USING BTREE;

--
-- 表的索引 `feature`
--
ALTER TABLE `feature`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_api_id` (`api_id`) USING BTREE;

--
-- 表的索引 `global_notifications`
--
ALTER TABLE `global_notifications`
ADD PRIMARY KEY (`id`) USING BTREE;

--
-- 表的索引 `order`
--
ALTER TABLE `order`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_order_no` (`order_no`) USING BTREE,
ADD KEY `idx_user_id` (`user_id`) USING BTREE,
ADD KEY `idx_product_id` (`product_id`) USING BTREE,
ADD KEY `idx_payment_platform` (`payment_platform`) USING BTREE,
ADD KEY `idx_payment_scene` (`payment_scene`) USING BTREE;

--
-- 表的索引 `order_refund`
--
ALTER TABLE `order_refund`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_refund_no` (`refund_no`),
ADD UNIQUE KEY `unique_platform_refund_id` (`platform_refund_id`),
ADD KEY `idx_user_id` (`user_id`),
ADD KEY `idx_product_id` (`product_id`),
ADD KEY `idx_status` (`status`),
ADD KEY `idx_order_id` (`order_id`);

--
-- 表的索引 `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_product_en` (`product_en`) USING BTREE;

--
-- 表的索引 `product_feature`
--
ALTER TABLE `product_feature`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_product_feature` (`product_id`, `feature_id`) USING BTREE;

--
-- 表的索引 `query`
--
ALTER TABLE `query`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_order_id` (`order_id`) USING BTREE,
ADD KEY `idx_user_id` (`user_id`) USING BTREE,
ADD KEY `idx_product_id` (`product_id`) USING BTREE;

--
-- 表的索引 `query_cleanup_config`
--
ALTER TABLE `query_cleanup_config`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_config_key` (`config_key`) COMMENT '配置键唯一索引';

--
-- 表的索引 `query_cleanup_detail`
--
ALTER TABLE `query_cleanup_detail`
ADD PRIMARY KEY (`id`),
ADD KEY `idx_cleanup_log_id` (`cleanup_log_id`) COMMENT '优化按清理日志查询',
ADD KEY `idx_query_id` (`query_id`) COMMENT '优化按查询ID查询',
ADD KEY `idx_order_id` (`order_id`) COMMENT '优化按订单ID查询',
ADD KEY `idx_user_id` (`user_id`) COMMENT '优化按用户ID查询';

--
-- 表的索引 `query_cleanup_log`
--
ALTER TABLE `query_cleanup_log`
ADD PRIMARY KEY (`id`),
ADD KEY `idx_cleanup_time` (`cleanup_time`) COMMENT '优化按清理时间查询',
ADD KEY `idx_cleanup_before` (`cleanup_before`) COMMENT '优化按清理截止时间查询',
ADD KEY `idx_status` (`status`) COMMENT '优化按状态查询';

--
-- 表的索引 `query_user_record`
--
ALTER TABLE `query_user_record`
ADD PRIMARY KEY (`id`),
ADD KEY `idx_user_id` (`user_id`),
ADD KEY `idx_id_card` (`id_card`),
ADD KEY `idx_mobile` (`mobile`),
ADD KEY `idx_query_no` (`query_no`),
ADD KEY `idx_order_id` (`order_id`),
ADD KEY `idx_platform_order_id` (`platform_order_id`),
ADD KEY `idx_create_time` (`create_time`);

--
-- 表的索引 `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_mobile` (`mobile`) USING BTREE;

--
-- 表的索引 `user_auth`
--
ALTER TABLE `user_auth`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `unique_type_key` (`auth_type`, `auth_key`) USING BTREE,
ADD UNIQUE KEY `unique_userId_key` (`user_id`, `auth_type`) USING BTREE;

--
-- 表的索引 `user_temp`
--
ALTER TABLE `user_temp`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_type_key` (`auth_type`, `auth_key`) USING BTREE;

--
-- 在导出的表使用AUTO_INCREMENT
--

--
-- 使用表AUTO_INCREMENT `admin_api`
--
ALTER TABLE `admin_api`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 104;

--
-- 使用表AUTO_INCREMENT `admin_dict_data`
--
ALTER TABLE `admin_dict_data`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 4;

--
-- 使用表AUTO_INCREMENT `admin_dict_type`
--
ALTER TABLE `admin_dict_type`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 2;

--
-- 使用表AUTO_INCREMENT `admin_menu`
--
ALTER TABLE `admin_menu`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 37;

--
-- 使用表AUTO_INCREMENT `admin_role`
--
ALTER TABLE `admin_role`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 3;

--
-- 使用表AUTO_INCREMENT `admin_role_api`
--
ALTER TABLE `admin_role_api`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `admin_role_menu`
--
ALTER TABLE `admin_role_menu`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 78;

--
-- 使用表AUTO_INCREMENT `admin_user`
--
ALTER TABLE `admin_user`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 3;

--
-- 使用表AUTO_INCREMENT `admin_user_role`
--
ALTER TABLE `admin_user_role`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 3;

--
-- 使用表AUTO_INCREMENT `agent`
--
ALTER TABLE `agent` MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_active_stat`
--
ALTER TABLE `agent_active_stat`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `agent_audit`
--
ALTER TABLE `agent_audit`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_closure`
--
ALTER TABLE `agent_closure`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_commission`
--
ALTER TABLE `agent_commission`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_commission_deduction`
--
ALTER TABLE `agent_commission_deduction`
MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_link`
--
ALTER TABLE `agent_link`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_membership_config`
--
ALTER TABLE `agent_membership_config`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 4;

--
-- 使用表AUTO_INCREMENT `agent_membership_recharge_order`
--
ALTER TABLE `agent_membership_recharge_order`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_membership_user_config`
--
ALTER TABLE `agent_membership_user_config`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_order`
--
ALTER TABLE `agent_order`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_platform_deduction`
--
ALTER TABLE `agent_platform_deduction`
MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_product_config`
--
ALTER TABLE `agent_product_config`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 9;

--
-- 使用表AUTO_INCREMENT `agent_real_name`
--
ALTER TABLE `agent_real_name`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `agent_rewards`
--
ALTER TABLE `agent_rewards`
MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_wallet`
--
ALTER TABLE `agent_wallet`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_wallet_transaction`
--
ALTER TABLE `agent_wallet_transaction`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_withdrawal`
--
ALTER TABLE `agent_withdrawal`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_withdrawal_tax`
--
ALTER TABLE `agent_withdrawal_tax`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `agent_withdrawal_tax_exemption`
--
ALTER TABLE `agent_withdrawal_tax_exemption`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `authorization_document`
--
ALTER TABLE `authorization_document`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `example`
--
ALTER TABLE `example`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
AUTO_INCREMENT = 56;

--
-- 使用表AUTO_INCREMENT `feature`
--
ALTER TABLE `feature`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
AUTO_INCREMENT = 85;

--
-- 使用表AUTO_INCREMENT `global_notifications`
--
ALTER TABLE `global_notifications`
MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `order`
--
ALTER TABLE `order`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `order_refund`
--
ALTER TABLE `order_refund`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `product`
--
ALTER TABLE `product`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
AUTO_INCREMENT = 28;

--
-- 使用表AUTO_INCREMENT `product_feature`
--
ALTER TABLE `product_feature`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
AUTO_INCREMENT = 149;

--
-- 使用表AUTO_INCREMENT `query`
--
ALTER TABLE `query`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `query_cleanup_config`
--
ALTER TABLE `query_cleanup_config`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
AUTO_INCREMENT = 9;

--
-- 使用表AUTO_INCREMENT `query_cleanup_detail`
--
ALTER TABLE `query_cleanup_detail`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `query_cleanup_log`
--
ALTER TABLE `query_cleanup_log`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID';

--
-- 使用表AUTO_INCREMENT `query_user_record`
--
ALTER TABLE `query_user_record`
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `user`
--
ALTER TABLE `user` MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `user_auth`
--
ALTER TABLE `user_auth` MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- 使用表AUTO_INCREMENT `user_temp`
--
ALTER TABLE `user_temp` MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
;