-- MySQL dump 10.13  Distrib 8.0.44, for Linux (x86_64)
--
-- Host: localhost    Database: martial_db
-- ------------------------------------------------------
-- Server version	8.0.44

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `martial_activity_schedule`
--

DROP TABLE IF EXISTS `martial_activity_schedule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_activity_schedule` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `schedule_date` date NOT NULL COMMENT '日程日期',
  `schedule_time` time DEFAULT NULL COMMENT '日程时间',
  `event_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '活动项目',
  `venue` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '地点',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '描述',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `sort_order` int DEFAULT '0' COMMENT '排序',
  `status` int DEFAULT '1' COMMENT '状态(0-未开始,1-进行中,2-已完成)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_date` (`schedule_date`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='活动日程表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_athlete`
--

DROP TABLE IF EXISTS `martial_athlete`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_athlete` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `order_id` bigint DEFAULT NULL COMMENT '订单ID',
  `competition_id` bigint DEFAULT NULL COMMENT '赛事ID',
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `player_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '选手姓名',
  `player_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '参赛编号',
  `gender` int DEFAULT '1' COMMENT '性别(1-男,2-女)',
  `age` int DEFAULT NULL COMMENT '年龄',
  `birth_date` date DEFAULT NULL COMMENT '出生日期',
  `nation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '民族',
  `id_card` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '身份证号',
  `id_card_type` int DEFAULT '1' COMMENT '证件类型(1-身份证,2-护照,3-其他)',
  `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系电话',
  `organization` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所属单位',
  `organization_type` int DEFAULT '1' COMMENT '单位类别(1-学校,2-协会,3-俱乐部,4-其他)',
  `team_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '队伍名称',
  `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '组别',
  `order_num` int DEFAULT '0' COMMENT '出场顺序',
  `introduction` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '选手简介',
  `attachments` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '附件(JSON数组)',
  `photo_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '照片URL',
  `registration_status` int DEFAULT '0' COMMENT '报名状态(0-待确认,1-已确认,2-已取消)',
  `competition_status` int DEFAULT '0' COMMENT '比赛状态(0-待出场,1-进行中,2-已完成)',
  `total_score` decimal(10,3) DEFAULT NULL COMMENT '总分',
  `ranking` int DEFAULT NULL COMMENT '排名',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-启用,2-禁用)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_order` (`order_id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_project` (`project_id`) USING BTREE,
  KEY `idx_player_no` (`player_no`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='参赛选手表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_banner`
--

DROP TABLE IF EXISTS `martial_banner`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_banner` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '轮播图标题',
  `position` int DEFAULT '1' COMMENT '显示位置(1-首页,2-赛事详情,3-其他)',
  `image_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '轮播图图片URL',
  `link_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '跳转链接',
  `sort_order` int DEFAULT '0' COMMENT '排序顺序',
  `start_time` datetime DEFAULT NULL COMMENT '开始显示时间',
  `end_time` datetime DEFAULT NULL COMMENT '结束显示时间',
  `click_count` int DEFAULT '0' COMMENT '点击次数',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sort` (`sort_order`) USING BTREE,
  KEY `idx_tenant_status` (`tenant_id`,`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='轮播图表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_competition`
--

DROP TABLE IF EXISTS `martial_competition`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_competition` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '赛事名称',
  `competition_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '赛事编码(用于裁判登录)',
  `organizer` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '主办单位',
  `location` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '地区',
  `venue` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '详细地点',
  `registration_start_time` datetime DEFAULT NULL COMMENT '报名开始时间',
  `registration_end_time` datetime DEFAULT NULL COMMENT '报名结束时间',
  `competition_start_time` datetime DEFAULT NULL COMMENT '比赛开始时间',
  `competition_end_time` datetime DEFAULT NULL COMMENT '比赛结束时间',
  `introduction` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '赛事简介',
  `poster_images` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '宣传图片(JSON数组)',
  `contact_person` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系人',
  `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系电话',
  `contact_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系邮箱',
  `rules` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '竞赛规则',
  `requirements` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '参赛要求',
  `awards` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '奖项设置',
  `regulation_files` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规程文件(JSON数组)',
  `total_participants` int DEFAULT '0' COMMENT '报名总人数',
  `is_compe_boutique` int DEFAULT NULL,
  `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '报名总金额',
  `status` int DEFAULT '0' COMMENT '状态(0-未开始,1-报名中,2-比赛中,3-已结束,4-已取消)',
  `create_user` bigint DEFAULT NULL COMMENT '创建人',
  `create_dept` bigint DEFAULT NULL COMMENT '创建部门',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_user` bigint DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` int DEFAULT '0' COMMENT '是否已删除',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000' COMMENT '租户ID',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_code` (`competition_code`) USING BTREE,
  KEY `idx_tenant_status` (`tenant_id`,`status`) USING BTREE,
  KEY `idx_time` (`competition_start_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='赛事信息表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_competition_attachment`
--

DROP TABLE IF EXISTS `martial_competition_attachment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_competition_attachment` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '000000' COMMENT '租户ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `attachment_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '附件类型：info-赛事发布, rules-赛事规程, schedule-活动日程, results-成绩, medals-奖牌榜, photos-图片直播',
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件名称',
  `file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件URL',
  `file_size` bigint DEFAULT NULL COMMENT '文件大小（字节）',
  `file_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '文件类型（pdf/doc/docx/xls/xlsx/jpg/png等）',
  `order_num` int DEFAULT '0' COMMENT '排序序号',
  `status` int DEFAULT '1' COMMENT '状态（1-启用 0-禁用）',
  `create_user` bigint DEFAULT NULL COMMENT '创建人',
  `create_dept` bigint DEFAULT NULL COMMENT '创建部门',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_user` bigint DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` int DEFAULT '0' COMMENT '是否已删除（0-否 1-是）',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition_id` (`competition_id`) USING BTREE,
  KEY `idx_attachment_type` (`attachment_type`) USING BTREE,
  KEY `idx_competition_type` (`competition_id`,`attachment_type`) USING BTREE,
  KEY `idx_tenant_id` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='赛事通用附件表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_competition_rules_attachment`
--

DROP TABLE IF EXISTS `martial_competition_rules_attachment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_competition_rules_attachment` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '000000' COMMENT '租户ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件名称',
  `file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件URL',
  `file_size` bigint DEFAULT NULL COMMENT '文件大小（字节）',
  `file_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '文件类型（pdf/doc/docx/xls/xlsx等）',
  `order_num` int DEFAULT '0' COMMENT '排序序号',
  `status` int DEFAULT '1' COMMENT '状态（1-启用 0-禁用）',
  `create_user` bigint DEFAULT NULL COMMENT '创建人',
  `create_dept` bigint DEFAULT NULL COMMENT '创建部门',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_user` bigint DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` int DEFAULT '0' COMMENT '是否已删除（0-否 1-是）',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition_id` (`competition_id`) USING BTREE,
  KEY `idx_tenant_id` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='赛事规程附件表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_competition_rules_chapter`
--

DROP TABLE IF EXISTS `martial_competition_rules_chapter`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_competition_rules_chapter` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '000000' COMMENT '租户ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `chapter_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '章节编号（如：第一章）',
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '章节标题',
  `order_num` int DEFAULT '0' COMMENT '排序序号',
  `status` int DEFAULT '1' COMMENT '状态（1-启用 0-禁用）',
  `create_user` bigint DEFAULT NULL COMMENT '创建人',
  `create_dept` bigint DEFAULT NULL COMMENT '创建部门',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_user` bigint DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` int DEFAULT '0' COMMENT '是否已删除（0-否 1-是）',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition_id` (`competition_id`) USING BTREE,
  KEY `idx_tenant_id` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='赛事规程章节表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_competition_rules_content`
--

DROP TABLE IF EXISTS `martial_competition_rules_content`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_competition_rules_content` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '000000' COMMENT '租户ID',
  `chapter_id` bigint NOT NULL COMMENT '章节ID',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规程内容',
  `order_num` int DEFAULT '0' COMMENT '排序序号',
  `status` int DEFAULT '1' COMMENT '状态（1-启用 0-禁用）',
  `create_user` bigint DEFAULT NULL COMMENT '创建人',
  `create_dept` bigint DEFAULT NULL COMMENT '创建部门',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_user` bigint DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` int DEFAULT '0' COMMENT '是否已删除（0-否 1-是）',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_chapter_id` (`chapter_id`) USING BTREE,
  KEY `idx_tenant_id` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='赛事规程内容表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_contact`
--

DROP TABLE IF EXISTS `martial_contact`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_contact` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `id_type` varchar(50) DEFAULT NULL COMMENT '证件类型',
  `name` varchar(100) DEFAULT NULL COMMENT '姓名',
  `id_card` varchar(50) DEFAULT NULL COMMENT '证件号码',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机号码',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `address` varchar(255) DEFAULT NULL COMMENT '地址',
  `is_default` tinyint(1) DEFAULT '0' COMMENT '是否默认联系人',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1',
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='联系人表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_deduction_item`
--

DROP TABLE IF EXISTS `martial_deduction_item`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_deduction_item` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `item_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '扣分项名称',
  `item_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '扣分项编码',
  `deduction_point` decimal(10,3) DEFAULT '0.000' COMMENT '扣分值',
  `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '分类',
  `applicable_projects` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '适用项目(JSON数组)',
  `project_id` bigint DEFAULT NULL,
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '描述',
  `sort_order` int DEFAULT '0' COMMENT '排序',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_tenant_status` (`tenant_id`,`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='扣分项配置表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_exception_event`
--

DROP TABLE IF EXISTS `martial_exception_event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_exception_event` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `competition_id` bigint DEFAULT NULL COMMENT '赛事ID',
  `schedule_id` bigint DEFAULT NULL COMMENT '赛程ID',
  `athlete_id` bigint DEFAULT NULL COMMENT '运动员ID',
  `event_type` int DEFAULT NULL COMMENT '事件类型(1-器械故障,2-受伤,3-评分争议,4-其他)',
  `event_description` text COMMENT '事件描述',
  `handler_name` varchar(100) DEFAULT NULL COMMENT '处理人',
  `handle_result` text COMMENT '处理结果',
  `handle_time` datetime DEFAULT NULL COMMENT '处理时间',
  `status` int DEFAULT '0' COMMENT '状态(0-待处理,1-已处理)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_competition` (`competition_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='异常事件表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_info_publish`
--

DROP TABLE IF EXISTS `martial_info_publish`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_info_publish` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint DEFAULT NULL COMMENT '赛事ID(NULL表示全局)',
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '标题',
  `info_type` int DEFAULT '1' COMMENT '信息类型(1-通知,2-公告,3-重要)',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '内容',
  `images` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片(JSON数组)',
  `attachments` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '附件(JSON)',
  `publish_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '发布时间',
  `publisher_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '发布人姓名',
  `is_published` int DEFAULT '0' COMMENT '是否已发布(0-未发布,1-已发布)',
  `sort_order` int DEFAULT '0' COMMENT '排序',
  `view_count` int DEFAULT '0' COMMENT '阅读次数',
  `amount` decimal(10,2) DEFAULT '0.00' COMMENT '金额',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_type` (`info_type`) USING BTREE,
  KEY `idx_tenant_status` (`tenant_id`,`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='信息发布表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_judge`
--

DROP TABLE IF EXISTS `martial_judge`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_judge` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '裁判姓名',
  `gender` int DEFAULT '1' COMMENT '性别(1-男,2-女)',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '手机号',
  `id_card` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '身份证号',
  `referee_type` int DEFAULT '2' COMMENT '裁判类型(1-裁判长,2-普通裁判)',
  `level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '等级/职称',
  `specialty` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '擅长项目',
  `photo_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '照片URL',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_phone` (`phone`) USING BTREE,
  KEY `idx_type` (`referee_type`) USING BTREE,
  KEY `idx_tenant_status` (`tenant_id`,`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='裁判信息表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_judge_invite`
--

DROP TABLE IF EXISTS `martial_judge_invite`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_judge_invite` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `judge_id` bigint DEFAULT NULL COMMENT '裁判ID',
  `invite_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '邀请码',
  `role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色(judge-普通裁判,chief_judge-裁判长)',
  `venue_id` bigint DEFAULT NULL COMMENT '分配场地ID',
  `projects` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '分配项目(JSON数组)',
  `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  `is_used` int DEFAULT '0' COMMENT '是否已使用(0-未使用,1-已使用)',
  `use_time` datetime DEFAULT NULL COMMENT '使用时间',
  `device_info` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '设备信息',
  `login_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '登录IP',
  `access_token` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '访问令牌',
  `token_expire_time` datetime DEFAULT NULL COMMENT 'token过期时间',
  `invite_status` int DEFAULT '0' COMMENT '邀请状态(0-待回复,1-已接受,2-已拒绝,3-已取消)',
  `invite_time` datetime DEFAULT NULL COMMENT '邀请时间',
  `reply_time` datetime DEFAULT NULL COMMENT '回复时间',
  `reply_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '回复备注',
  `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系电话',
  `contact_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系邮箱',
  `invite_message` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '邀请消息',
  `cancel_reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '取消原因',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_dept` bigint DEFAULT NULL,
  `create_user` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_competition_code` (`competition_id`,`invite_code`) USING BTREE,
  UNIQUE KEY `uk_invite_code` (`invite_code`) USING BTREE,
  KEY `idx_judge` (`judge_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE,
  KEY `idx_competition_judge` (`competition_id`,`judge_id`) USING BTREE,
  KEY `idx_expire_time` (`expire_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='裁判邀请码表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_judge_project`
--

DROP TABLE IF EXISTS `martial_judge_project`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_judge_project` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `competition_id` bigint DEFAULT NULL COMMENT '赛事ID',
  `judge_id` bigint DEFAULT NULL COMMENT '裁判ID',
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `assign_time` datetime DEFAULT NULL COMMENT '分配时间',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_judge` (`judge_id`),
  KEY `idx_project` (`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='裁判项目关联表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_live_update`
--

DROP TABLE IF EXISTS `martial_live_update`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_live_update` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `schedule_id` bigint DEFAULT NULL COMMENT '赛程ID',
  `athlete_id` bigint DEFAULT NULL COMMENT '选手ID',
  `update_type` int DEFAULT '1' COMMENT '实况类型(1-赛况,2-比分,3-精彩瞬间)',
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '标题',
  `content` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
  `images` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片(JSON数组)',
  `score_info` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '比分信息',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `status` int DEFAULT '1' COMMENT '状态(1-启用,2-禁用)',
  `sort_order` int DEFAULT '0' COMMENT '排序',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_schedule` (`schedule_id`) USING BTREE,
  KEY `idx_update_time` (`update_time`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='比赛实况表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_project`
--

DROP TABLE IF EXISTS `martial_project`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_project` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `venue_id` bigint DEFAULT NULL COMMENT '所属场地ID',
  `project_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称',
  `project_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目编码',
  `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '组别(男子组/女子组)',
  `event_type` int DEFAULT NULL COMMENT '项目类型(1-套路,2-散打,3-器械,4-对练)',
  `type` int DEFAULT '1' COMMENT '类型(1-个人,2-双人,3-集体)',
  `min_participants` int DEFAULT '1' COMMENT '最少参赛人数',
  `max_participants` int DEFAULT '1' COMMENT '最多参赛人数',
  `min_age` int DEFAULT NULL COMMENT '最小年龄',
  `max_age` int DEFAULT NULL COMMENT '最大年龄',
  `gender_limit` int DEFAULT '0' COMMENT '性别限制(0-不限,1-仅男,2-仅女)',
  `estimated_duration` int DEFAULT '5' COMMENT '预估时长(分钟)',
  `price` decimal(10,2) DEFAULT '0.00' COMMENT '报名费用',
  `registration_start_time` datetime DEFAULT NULL COMMENT '报名开始时间',
  `registration_end_time` datetime DEFAULT NULL COMMENT '报名结束时间',
  `difficulty_coefficient` decimal(5,2) DEFAULT '1.00' COMMENT '难度系数',
  `registration_deadline` datetime DEFAULT NULL COMMENT '报名截止时间',
  `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目描述',
  `sort_order` int DEFAULT '0' COMMENT '排序',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='比赛项目表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_registration_order`
--

DROP TABLE IF EXISTS `martial_registration_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_registration_order` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '订单号',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户名',
  `contact_person` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系人',
  `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '联系电话',
  `organization` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所属单位',
  `invoice_type` int DEFAULT '0' COMMENT '发票类型(0-不需要,1-普通,2-增值税)',
  `invoice_title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '发票抬头',
  `invoice_tax_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '税号',
  `total_participants` int DEFAULT '0' COMMENT '参赛总人数',
  `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '订单总金额',
  `paid_amount` decimal(10,2) DEFAULT '0.00' COMMENT '已支付金额',
  `refund_amount` decimal(10,2) DEFAULT '0.00' COMMENT '退款金额',
  `payment_method` int DEFAULT NULL COMMENT '支付方式(1-微信,2-支付宝,3-线下)',
  `payment_time` datetime DEFAULT NULL COMMENT '支付时间',
  `transaction_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '支付交易号',
  `refund_time` datetime DEFAULT NULL COMMENT '退款时间',
  `refund_reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '退款原因',
  `status` int DEFAULT '0' COMMENT '状态(0-待支付,1-已支付,2-已取消,3-已退款)',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_order_no` (`order_no`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_user` (`user_id`) USING BTREE,
  KEY `idx_tenant_status` (`tenant_id`,`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='报名订单表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_result`
--

DROP TABLE IF EXISTS `martial_result`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_result` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `athlete_id` bigint NOT NULL COMMENT '选手ID',
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `venue_id` bigint DEFAULT NULL COMMENT '场地ID',
  `player_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '选手姓名',
  `team_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '队伍名称',
  `total_score` decimal(10,3) DEFAULT NULL COMMENT '总分(所有裁判平均分)',
  `max_score` decimal(10,3) DEFAULT NULL COMMENT '最高分(去掉用)',
  `min_score` decimal(10,3) DEFAULT NULL COMMENT '最低分(去掉用)',
  `valid_score_count` int DEFAULT '0' COMMENT '有效评分数',
  `original_score` decimal(10,3) DEFAULT NULL COMMENT '原始总分',
  `adjusted_score` decimal(10,3) DEFAULT NULL COMMENT '调整后总分',
  `difficulty_coefficient` decimal(5,2) DEFAULT '1.00' COMMENT '难度系数',
  `final_score` decimal(10,3) DEFAULT NULL COMMENT '最终得分(总分*系数)',
  `adjust_range` decimal(10,3) DEFAULT '0.005' COMMENT '允许调整范围',
  `adjust_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '调整说明',
  `ranking` int DEFAULT NULL COMMENT '排名',
  `medal` int DEFAULT NULL COMMENT '奖牌(1-金牌,2-银牌,3-铜牌)',
  `is_final` int DEFAULT '0' COMMENT '是否最终成绩(0-否,1-是)',
  `publish_time` datetime DEFAULT NULL COMMENT '发布时间',
  `chief_judge_score` decimal(10,2) DEFAULT NULL COMMENT '主裁判评分',
  `chief_judge_id` bigint DEFAULT NULL COMMENT '主裁判ID',
  `chief_judge_time` datetime DEFAULT NULL COMMENT '主裁判评分时间',
  `chief_judge_note` varchar(500) DEFAULT NULL COMMENT '主裁判备注',
  `general_judge_score` decimal(10,2) DEFAULT NULL COMMENT '副裁判评分',
  `general_judge_id` bigint DEFAULT NULL COMMENT '副裁判ID',
  `general_judge_time` datetime DEFAULT NULL COMMENT '副裁判评分时间',
  `general_judge_note` varchar(500) DEFAULT NULL COMMENT '副裁判备注',
  `score_status` int DEFAULT '0' COMMENT '评分状态',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-启用,2-禁用)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_competition_athlete` (`competition_id`,`athlete_id`,`project_id`) USING BTREE,
  KEY `idx_athlete` (`athlete_id`) USING BTREE,
  KEY `idx_project` (`project_id`) USING BTREE,
  KEY `idx_ranking` (`ranking`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='成绩表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule`
--

DROP TABLE IF EXISTS `martial_schedule`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `order_id` bigint DEFAULT NULL COMMENT '订单ID',
  `group_title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分组标题',
  `group_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '分组编码',
  `group_type` int DEFAULT '1' COMMENT '分组类型(1-个人,2-双人,3-集体)',
  `venue_id` bigint DEFAULT NULL COMMENT '场地ID',
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `schedule_date` date DEFAULT NULL COMMENT '比赛日期',
  `time_slot` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '时间段',
  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `participant_count` int DEFAULT '0' COMMENT '参赛队伍数/人数',
  `estimated_duration` int DEFAULT '0' COMMENT '预估时长(分钟)',
  `is_confirmed` int DEFAULT '0' COMMENT '是否已确认(0-未确认,1-已确认)',
  `status` int DEFAULT '0' COMMENT '状态(0-待开始,1-进行中,2-已完成)',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_venue` (`venue_id`) USING BTREE,
  KEY `idx_date_time` (`schedule_date`,`time_slot`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='赛程编排表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_adjustment_log`
--

DROP TABLE IF EXISTS `martial_schedule_adjustment_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_adjustment_log` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `plan_id` bigint DEFAULT NULL COMMENT '编排方案ID',
  `action_type` varchar(50) DEFAULT NULL COMMENT '操作类型: move/swap/delete/insert',
  `operator_id` bigint DEFAULT NULL COMMENT '操作人ID',
  `operator_name` varchar(100) DEFAULT NULL COMMENT '操作人姓名',
  `operator_role` varchar(50) DEFAULT NULL COMMENT '操作人角色: admin/referee',
  `before_data` text COMMENT '变更前数据(JSON)',
  `after_data` text COMMENT '变更后数据(JSON)',
  `reason` varchar(500) DEFAULT NULL COMMENT '调整原因',
  `action_time` datetime DEFAULT NULL COMMENT '操作时间',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_plan` (`plan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='编排调整日志表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_athlete`
--

DROP TABLE IF EXISTS `martial_schedule_athlete`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_athlete` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `schedule_id` bigint NOT NULL COMMENT '赛程ID',
  `athlete_id` bigint NOT NULL COMMENT '选手ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `order_num` int DEFAULT '0' COMMENT '出场顺序',
  `is_completed` int DEFAULT '0' COMMENT '是否已完赛(0-未完赛,1-已完赛)',
  `is_refereed` int DEFAULT '0' COMMENT '是否已裁判(0-未裁判,1-已裁判)',
  `create_user` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-启用,2-禁用)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_schedule` (`schedule_id`) USING BTREE,
  KEY `idx_athlete` (`athlete_id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='选手赛程关联表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_athlete_slot`
--

DROP TABLE IF EXISTS `martial_schedule_athlete_slot`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_athlete_slot` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `slot_id` bigint DEFAULT NULL COMMENT '时间槽ID',
  `athlete_id` bigint DEFAULT NULL COMMENT '运动员ID',
  `appearance_order` int DEFAULT '0' COMMENT '出场顺序',
  `estimated_time` time DEFAULT NULL COMMENT '预计出场时间',
  `check_in_status` int DEFAULT '0' COMMENT '签到状态: 0-未签到, 1-已签到',
  `performance_status` int DEFAULT '0' COMMENT '比赛状态: 0-未开始, 1-进行中, 2-已完成',
  `is_adjusted` int DEFAULT '0' COMMENT '是否调整过',
  `adjust_note` varchar(500) DEFAULT NULL COMMENT '调整备注',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_slot` (`slot_id`),
  KEY `idx_athlete` (`athlete_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='运动员时间槽关联表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_conflict`
--

DROP TABLE IF EXISTS `martial_schedule_conflict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_conflict` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `plan_id` bigint DEFAULT NULL COMMENT '编排方案ID',
  `conflict_type` int DEFAULT NULL COMMENT '冲突类型: 1-时间冲突, 2-场地冲突, 3-规则违反',
  `severity` int DEFAULT '1' COMMENT '严重程度: 1-警告, 2-错误, 3-致命',
  `entity_type` varchar(50) DEFAULT NULL COMMENT '实体类型: athlete/venue/slot',
  `entity_id` bigint DEFAULT NULL COMMENT '实体ID',
  `conflict_description` text COMMENT '冲突描述',
  `is_resolved` int DEFAULT '0' COMMENT '是否已解决',
  `resolve_method` varchar(500) DEFAULT NULL COMMENT '解决方法',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_plan` (`plan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='编排冲突记录表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_detail`
--

DROP TABLE IF EXISTS `martial_schedule_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_detail` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `schedule_group_id` bigint NOT NULL COMMENT '分组ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `venue_id` bigint NOT NULL COMMENT '场地ID',
  `venue_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '场地名称',
  `schedule_date` date NOT NULL COMMENT '比赛日期',
  `time_period` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '时间段(morning/afternoon)',
  `time_slot` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '时间点(08:30/13:30)',
  `time_slot_index` int DEFAULT '0' COMMENT '时间段索引...',
  `estimated_start_time` datetime DEFAULT NULL COMMENT '预计开始时间',
  `estimated_end_time` datetime DEFAULT NULL COMMENT '预计结束时间',
  `estimated_duration` int DEFAULT '0' COMMENT '预计时长(分钟)',
  `participant_count` int DEFAULT '0' COMMENT '参赛人数',
  `sort_order` int DEFAULT '0' COMMENT '场内顺序',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-未开始,2-进行中,3-已完成)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_group` (`schedule_group_id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_venue_time` (`venue_id`,`schedule_date`,`time_slot`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2012027048177651714 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='赛程编排明细表(场地时间段分配)';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_group`
--

DROP TABLE IF EXISTS `martial_schedule_group`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_group` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `group_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分组名称(如:太极拳男组)',
  `project_id` bigint NOT NULL COMMENT '项目ID',
  `project_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目名称',
  `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '组别(成年组、少年组等)',
  `project_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '项目类型(1=个人 2=集体)',
  `display_order` int NOT NULL DEFAULT '0' COMMENT '显示顺序(集体项目优先,数字越小越靠前)',
  `total_participants` int DEFAULT '0' COMMENT '总参赛人数',
  `total_teams` int DEFAULT '0' COMMENT '总队伍数(仅集体项目)',
  `estimated_duration` int DEFAULT '0' COMMENT '预计时长(分钟)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-启用,2-禁用)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_project` (`project_id`) USING BTREE,
  KEY `idx_display_order` (`display_order`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2012027048173457410 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='赛程编排分组表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_participant`
--

DROP TABLE IF EXISTS `martial_schedule_participant`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_participant` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `schedule_detail_id` bigint NOT NULL COMMENT '编排明细ID',
  `schedule_group_id` bigint NOT NULL COMMENT '分组ID',
  `participant_id` bigint NOT NULL COMMENT '参赛者ID(关联martial_athlete表)',
  `organization` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '单位名称',
  `player_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '选手姓名',
  `project_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目名称',
  `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '组别',
  `performance_order` int DEFAULT '0' COMMENT '出场顺序',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-待出场,2-已出场)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  `check_in_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '未签到' COMMENT '签到状态：未签到/已签到/异常',
  `schedule_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'draft' COMMENT '编排状态：draft/completed',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_detail` (`schedule_detail_id`) USING BTREE,
  KEY `idx_group` (`schedule_group_id`) USING BTREE,
  KEY `idx_participant` (`participant_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2012027048211206147 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='赛程编排参赛者关联表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_plan`
--

DROP TABLE IF EXISTS `martial_schedule_plan`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_plan` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `competition_id` bigint DEFAULT NULL COMMENT '赛事ID',
  `plan_name` varchar(100) DEFAULT NULL COMMENT '方案名称',
  `plan_type` int DEFAULT '1' COMMENT '方案类型: 1-自动生成, 2-手动调整',
  `status` int DEFAULT '0' COMMENT '状态: 0-草稿, 1-已确认, 2-已发布',
  `start_time` datetime DEFAULT NULL COMMENT '比赛开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '比赛结束时间',
  `venue_count` int DEFAULT '0' COMMENT '场地数量',
  `time_slot_duration` int DEFAULT '5' COMMENT '时间段长度(分钟)',
  `rules` text COMMENT '编排规则配置(JSON)',
  `total_matches` int DEFAULT '0' COMMENT '总场次',
  `conflict_count` int DEFAULT '0' COMMENT '冲突数量',
  `created_by` bigint DEFAULT NULL COMMENT '创建人ID',
  `approved_by` bigint DEFAULT NULL COMMENT '审批人ID',
  `approved_time` datetime DEFAULT NULL COMMENT '审批时间',
  `published_time` datetime DEFAULT NULL COMMENT '发布时间',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_competition` (`competition_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='编排方案表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_slot`
--

DROP TABLE IF EXISTS `martial_schedule_slot`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_slot` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `plan_id` bigint DEFAULT NULL COMMENT '编排方案ID',
  `venue_id` bigint DEFAULT NULL COMMENT '场地ID',
  `slot_date` date DEFAULT NULL COMMENT '比赛日期',
  `start_time` time DEFAULT NULL COMMENT '开始时间',
  `end_time` time DEFAULT NULL COMMENT '结束时间',
  `duration` int DEFAULT '5' COMMENT '时长(分钟)',
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `category` varchar(50) DEFAULT NULL COMMENT '组别',
  `sort_order` int DEFAULT '0' COMMENT '排序号',
  `status` int DEFAULT '0' COMMENT '状态: 0-未开始, 1-进行中, 2-已完成',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_plan` (`plan_id`),
  KEY `idx_venue` (`venue_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='编排时间槽表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_schedule_status`
--

DROP TABLE IF EXISTS `martial_schedule_status`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_schedule_status` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID(唯一)',
  `schedule_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '编排状态(0=未编排 1=编排中 2=已保存锁定)',
  `last_auto_schedule_time` datetime DEFAULT NULL COMMENT '最后自动编排时间',
  `locked_time` datetime DEFAULT NULL COMMENT '锁定时间',
  `locked_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '锁定人',
  `total_groups` int DEFAULT '0' COMMENT '总分组数',
  `total_participants` int DEFAULT '0' COMMENT '总参赛人数',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1' COMMENT '状态(1-启用,2-禁用)',
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_competition` (`competition_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE,
  KEY `idx_schedule_status` (`schedule_status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2011751091642900482 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='赛程编排状态表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_score`
--

DROP TABLE IF EXISTS `martial_score`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_score` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `athlete_id` bigint NOT NULL COMMENT '选手ID',
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `schedule_id` bigint DEFAULT NULL COMMENT '赛程ID',
  `venue_id` bigint DEFAULT NULL COMMENT '场地ID',
  `judge_id` bigint NOT NULL COMMENT '裁判ID',
  `judge_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '裁判姓名',
  `score` decimal(10,3) NOT NULL COMMENT '评分(5.000-10.000)',
  `original_score` decimal(10,3) DEFAULT NULL COMMENT '原始评分(修改前)',
  `deduction_items` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '选中的扣分项ID(JSON数组)',
  `note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '评分备注',
  `modify_reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '修改原因',
  `score_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '评分时间',
  `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
  `ip_address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '评分IP地址',
  `status` int DEFAULT '1' COMMENT '状态(1-正常,2-已修改,3-已作废)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_athlete` (`athlete_id`) USING BTREE,
  KEY `idx_judge` (`judge_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE,
  KEY `idx_venue` (`venue_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='评分记录表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_team`
--

DROP TABLE IF EXISTS `martial_team`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_team` (
  `id` bigint NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `team_name` varchar(100) DEFAULT NULL COMMENT '集体名称',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  `member_count` int DEFAULT '0' COMMENT '成员数量',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` int DEFAULT '1',
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='集体/团队表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_team_member`
--

DROP TABLE IF EXISTS `martial_team_member`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_team_member` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `team_id` bigint DEFAULT NULL COMMENT '集体ID',
  `athlete_id` bigint DEFAULT NULL COMMENT '选手ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `is_deleted` int DEFAULT '0' COMMENT '是否删除',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  PRIMARY KEY (`id`),
  KEY `idx_team` (`team_id`),
  KEY `idx_athlete` (`athlete_id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='集体成员关联表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `martial_venue`
--

DROP TABLE IF EXISTS `martial_venue`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `martial_venue` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `competition_id` bigint NOT NULL COMMENT '赛事ID',
  `venue_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '场地名称',
  `venue_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '场地编码',
  `venue_type` varchar(50) DEFAULT NULL COMMENT '场地类型(indoor-室内,outdoor-室外)',
  `location` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '场地位置',
  `capacity` int DEFAULT '0' COMMENT '容纳人数',
  `facilities` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '设施说明',
  `status` int DEFAULT '1' COMMENT '状态(0-禁用,1-启用)',
  `create_user` bigint DEFAULT NULL,
  `create_dept` bigint DEFAULT NULL,
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_user` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` int DEFAULT '0',
  `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '000000',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_competition` (`competition_id`) USING BTREE,
  KEY `idx_tenant` (`tenant_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='场地信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-01-16  8:03:19
