-- tall3-通用表 -- 文件表 CREATE TABLE `t_file_commit` ( `id` bigint(20) NOT NULL, `name` varchar(64) DEFAULT '' COMMENT '文件名', `path` varchar(128) DEFAULT '' COMMENT '文件路径', `visit_path` varchar(512) DEFAULT '' COMMENT '访问路径', `md5` varchar(32) DEFAULT '', `sha1` varchar(40) DEFAULT '', `time` bigint(20) DEFAULT 0 COMMENT '上传的时间', `count` int(11) DEFAULT 0 COMMENT '被引用的次数', `status` tinyint(1) unsigned DEFAULT 1 COMMENT '文件状态 0:未上传 1:全部上传', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件信息表'; -- 机构表 -- 名字 -- 上级id CREATE TABLE `t_organization` ( `id` bigint(20) NOT NULL, `organization_type` tinyint(2) DEFAULT 0 COMMENT '职位归属0:体育局 1:省跳协 2:市跳协', `code` varchar(64) DEFAULT '' COMMENT '机构编码', `name` varchar(64) DEFAULT '' COMMENT '机构名称', `short_name` varchar(64) DEFAULT '' COMMENT '机构简称', `introduce` varchar(256) DEFAULT '' COMMENT '机构介绍', `parent_id` bigint(20) DEFAULT 0 COMMENT '上级机构id', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `organization_index` (`parent_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机构表'; -- 协会成员表 -- 姓名 -- 手机号 -- 机构id -- userId CREATE TABLE `t_organization_member` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) DEFAULT 0 COMMENT 'userId', `name` varchar(64) DEFAULT '' COMMENT '成员名称', `phone` varchar(64) DEFAULT '' COMMENT '联系方式', `organization_id` bigint(20) DEFAULT 0 COMMENT '机构id', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `member_user_index` (`user_id`) USING BTREE, KEY `member_organization_index` (`organization_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机构成员表'; -- 成员职位表 DROP TABLE IF EXISTS `t_organization_member_position`; CREATE TABLE `t_organization_member_position` ( `id` bigint(20) NOT NULL, `org_member_id` bigint(20) DEFAULT 0 COMMENT '机构成员id', `org_id` bigint(20) DEFAULT 0 COMMENT '机构id', `position` tinyint(2) unsigned DEFAULT 0 COMMENT '职位 0运动员 1裁判员 2导师 3秘书长 4主席', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `position_member_index` (`org_member_id`) USING BTREE, KEY `position_org_index` (`org_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='成员职位表'; -- 导师表 -- 机构成员id -- 培训计划id -- 是否接受委托 DROP TABLE IF EXISTS `t_training_plan_teacher`; CREATE TABLE `t_training_plan_teacher` ( `id` bigint(20) NOT NULL, `organization_member_id` bigint(20) DEFAULT 0 COMMENT '机构成员id', `training_plan_id` bigint(20) NULL DEFAULT 0 COMMENT '培训计划id', `check_status` tinyint(1) unsigned DEFAULT 0 COMMENT '是否已经接受委托 0未接受 1已接受 2已拒绝', `reject_cause` varchar(512) DEFAULT '' COMMENT '驳回原因', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `teacher_member_index` (`organization_member_id`) USING BTREE, KEY `teacher_plan_index` (`training_plan_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='培训导师表'; -- 红头文件模板表 -- 文件名 -- 所属机构 -- 文件id -- 上传人 -- 类型 CREATE TABLE `t_official_documents` ( `id` bigint(20) NOT NULL, `submit_id` bigint(20) DEFAULT 0 COMMENT 'userId', `name` varchar(64) DEFAULT '' COMMENT '名称', `organization_id` bigint(20) DEFAULT 0 COMMENT '机构id', `file_id` bigint(20) NULL DEFAULT 0 COMMENT '文件id', `type` tinyint(2) unsigned DEFAULT 0 COMMENT '类型 0培训计划 1运动员证书 2教练证书 ', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `official_documents_submit_index` (`submit_id`) USING BTREE, KEY `official_documents_organization_index` (`organization_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='红头文件模板表'; -- 项目模板关联表 -- 项目id -- 模板id CREATE TABLE `t_project_official_documents` ( `id` bigint(20) NOT NULL, `project_id` bigint(20) DEFAULT 0 COMMENT '项目id', `documents_id` bigint(20) DEFAULT 0 COMMENT '模板id', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `project_official_project_index` (`project_id`) USING BTREE, KEY `project_official_documents_index` (`documents_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目模板关联表'; -- 培训计划表 -- 名称 -- 详情 -- 开始时间 -- 结束时间 -- 文件id -- 文件路径 -- 提交人 -- 项目id -- 是否审批 CREATE TABLE `t_training_plan` ( `id` bigint(20) NOT NULL, -- `name` varchar(255) DEFAULT '' COMMENT '名称', -- `description` varchar(1024) DEFAULT '' COMMENT '详情', -- `start_time` bigint(20) NULL DEFAULT 0 COMMENT '开始时间', -- `end_time` bigint(20) NULL DEFAULT 0 COMMENT '结束时间', -- `file_id` bigint(20) NULL DEFAULT 0 COMMENT '文件id', -- `visit_path` varchar(512) DEFAULT '' COMMENT '访问路径', `submit_id` bigint(20) DEFAULT 0 COMMENT '提交人id', `project_id` bigint(20) DEFAULT 0 COMMENT '项目id', `template_id` bigint(20) DEFAULT 0 COMMENT '模板id', `check_status` tinyint(2) unsigned DEFAULT 0 COMMENT '审核状态 0已提交 1通过 2驳回', `checker_id` bigint(20) DEFAULT 0 COMMENT '审核人id', `reject_cause` varchar(512) DEFAULT '' COMMENT '驳回原因', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `plan_submit_index` (`submit_id`) USING BTREE, KEY `plan_project_index` (`project_id`) USING BTREE, KEY `plan_checker_index` (`checker_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='培训计划表'; -- 选手表 -- 姓名 -- 年龄 -- 性别 -- 联系地址 -- 手机号 -- 等级id(爱好者,专业X级,教练) DROP TABLE IF EXISTS `t_player`; CREATE TABLE `t_player` ( `id` bigint(20) NOT NULL, `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '姓名', `age` int(11) NULL DEFAULT 0 COMMENT '年龄', `gender` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '性别 0女 1男', `phone` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系方式', `address` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系地址', `id_card` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '身份证号', `level_id` bigint(20) DEFAULT 0 COMMENT '等级id', `user_id` bigint(20) DEFAULT 0 COMMENT 'userId', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `player_level_idndex` (`level_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='选手信息表'; -- 报名表(学员报名的信息表,没有学员表) -- 选手id -- 培训目标(专业,教练员) -- 是否缴费 -- 是否结业 -- 证书颁发状态 -- 证书文件id DROP TABLE IF EXISTS `t_player_apply`; CREATE TABLE `t_player_apply` ( `id` bigint(20) NOT NULL, `training_plan_id` bigint(20) DEFAULT 0 COMMENT '培训计划id', `player_id` bigint(20) DEFAULT 0 COMMENT '选手id', `target_id` bigint(20) NULL DEFAULT 0 COMMENT '培训目标id', `pay_status` tinyint(1) unsigned DEFAULT 0 COMMENT '缴费状态 0未交费 1已缴费', `target_id` bigint(20) NULL DEFAULT 0 COMMENT '缴费凭证id', `complete_status` tinyint(2) unsigned DEFAULT 0 COMMENT '结业状态 0未结业 1已申请 2已通过 3已驳回', `certificate_status` tinyint(1) unsigned DEFAULT 0 COMMENT '证书颁发状态 0未发证 1已发证', `file_id` bigint(20) DEFAULT 0 COMMENT '证书文件id', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `apply_player_index` (`player_id`) USING BTREE, KEY `apply_target_index` (`target_id`) USING BTREE, KEY `apply_training_plan_index` (`training_plan_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='选手报名信息表'; -- 运动员等级表 -- 名字 -- 描述 CREATE TABLE `t_player_level` ( `id` bigint(20) NOT NULL, `name` varchar(255) DEFAULT '' COMMENT '名称', `description` varchar(1024) DEFAULT '' COMMENT '详情', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运动员等级表'; -- 运动员等级关联表 -- 等级id -- 可报名的等级id CREATE TABLE `t_player_level_relevance` ( `id` bigint(20) NOT NULL, `level_id` bigint(20) DEFAULT 0 COMMENT '等级id', `can_apply_level_id` bigint(20) DEFAULT 0 COMMENT '可以报名的等级id', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `relevance_level_index` (`level_id`) USING BTREE, KEY `relevance_can_apply_level_index` (`can_apply_level_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运动员等级关联表'; -- 修改模板相关表 -- 红头文件模板表 -- 文件名 -- 所属机构 -- 文件id -- 上传人 -- 类型 CREATE TABLE `t_official_documents` ( `id` bigint(20) NOT NULL, `submit_id` bigint(20) DEFAULT 0 COMMENT 'userId', `name` varchar(64) DEFAULT '' COMMENT '名称', `organization_id` bigint(20) DEFAULT 0 COMMENT '机构id', `file_id` bigint(20) NULL DEFAULT 0 COMMENT '文件id', `type` tinyint(2) unsigned DEFAULT 0 COMMENT '类型 0培训计划 1运动员证书 2教练证书 ', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `official_documents_submit_index` (`submit_id`) USING BTREE, KEY `official_documents_organization_index` (`organization_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='红头文件模板表'; -- 模板信息选项表 CREATE TABLE `t_question` ( `id` bigint(20) NOT NULL, `templete_id` bigint(20) DEFAULT 0 COMMENT '模板id', `question` varchar(64) DEFAULT '' COMMENT '题目标题', `sort` int(11) DEFAULT 0 COMMENT '排序', `type` tinyint(3) unsigned DEFAULT 1 COMMENT '1单行文本,2多行文本,3单选,4多选,5下拉菜单,6日期,7图片(文件)', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `question_templete_idndex` (`templete_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='模板信息表'; -- 选项表 CREATE TABLE `t_question_option` ( `id` bigint(20) NOT NULL, `question_id` bigint(20) DEFAULT 0 COMMENT ' 试题ID', `sort` int(11) DEFAULT 1 COMMENT ' 排序 ', `show_value` varchar(512) DEFAULT '' COMMENT '显示值', `submit_value` varchar(512) DEFAULT '' COMMENT '提交值', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `option_question_index` (`question_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='选项表'; -- 答题记录表 CREATE TABLE `t_question_record` ( `id` bigint(20) NOT NULL, `business_type` bigint(20) DEFAULT 0 COMMENT '记录类型 0培训计划 1运动员证书 2教练证书 ', `business_Id` bigint(20) DEFAULT 0 COMMENT '业务id 培训记录id/运动员报名记录id', `question_id` bigint(20) DEFAULT 0 COMMENT ' 试题ID', `contents` varchar(512) DEFAULT '' COMMENT '内容', `submit_id` bigint(20) DEFAULT 0 COMMENT '提交人id(机构成员id)', `operator` bigint(20) DEFAULT 0 COMMENT '操作人id', `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `rec_status` tinyint(1) unsigned DEFAULT 0 COMMENT '状态,0正常 1禁用 2删除', PRIMARY KEY (`id`) USING BTREE, KEY `record_business_Index` (`business_Id`) USING BTREE, KEY `record_question_index` (`question_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='选项表';