-- ============================================================
-- edu_manage schema_upgrade_v6.sql
-- 功能: 学生/合同/员工字段补充 + 8个新功能模块(学校/申请/录取/成绩/活动/薪酬/发票/渠道)
-- 执行前提: 已执行 schema.sql + v1~v5 升级脚本
-- ============================================================

-- ============================
-- 一、ALTER TABLE — 学生表补充 22 字段
-- ============================
ALTER TABLE edu_student
  ADD COLUMN english_name         varchar(128)  DEFAULT NULL     COMMENT '英文名'                     AFTER name,
  ADD COLUMN exam_language       varchar(16)   DEFAULT NULL     COMMENT '高考语种(英语/日语等)'        AFTER subjects,
  ADD COLUMN exam_identity       varchar(16)   DEFAULT NULL     COMMENT '高考身份(内地高考生/国际生)'   AFTER exam_language,
  ADD COLUMN nationality         varchar(16)   DEFAULT NULL     COMMENT '国籍(内地/港/澳/台/其他)'     AFTER exam_identity,
  ADD COLUMN exam_location       varchar(64)   DEFAULT NULL     COMMENT '高考所在地'                  AFTER nationality,
  ADD COLUMN curriculum_system   varchar(16)   DEFAULT NULL     COMMENT '课程体系(高考/AP/A-Level/DSE)' AFTER exam_location,
  ADD COLUMN selected_subjects    varchar(128)  DEFAULT NULL     COMMENT '选科(与subjects学习科目区分)'   AFTER curriculum_system,
  ADD COLUMN has_health_condition char(1)      DEFAULT 'N'      COMMENT '色盲/身体特殊情况 Y/N'         AFTER selected_subjects,
  ADD COLUMN health_condition_note varchar(500) DEFAULT NULL    COMMENT '特殊情况说明'                  AFTER has_health_condition,
  ADD COLUMN need_political_review char(1)     DEFAULT 'N'      COMMENT '是否需政审院校 Y/N'           AFTER health_condition_note,
  ADD COLUMN application_plan    text           DEFAULT NULL     COMMENT '申请方案(多校列表)'           AFTER need_political_review,
  ADD COLUMN academic_test_score  varchar(255)  DEFAULT NULL     COMMENT '学水成绩'                     AFTER application_plan,
  ADD COLUMN personal_experience  text           DEFAULT NULL     COMMENT '个人经历'                     AFTER academic_test_score,
  ADD COLUMN english_score       varchar(64)   DEFAULT NULL     COMMENT '英语语言成绩(托福/雅思)'       AFTER personal_experience,
  ADD COLUMN listening_score     varchar(64)   DEFAULT NULL     COMMENT '高考听说成绩'                 AFTER english_score,
  ADD COLUMN target_region       varchar(128)  DEFAULT NULL     COMMENT '意向升学地区'                 AFTER target_school,
  ADD COLUMN admission_pathway   varchar(64)   DEFAULT NULL     COMMENT '升学途径(多元升学等)'         AFTER target_region,
  ADD COLUMN target_major        varchar(255)  DEFAULT NULL     COMMENT '意向专业方向'                 AFTER admission_pathway,
  ADD COLUMN target_major_reason text           DEFAULT NULL     COMMENT '选专业原因'                   AFTER target_major,
  ADD COLUMN special_remark      varchar(1000) DEFAULT NULL     COMMENT '特殊情况备注(区别于remark)'    AFTER remark;

-- ============================
-- 二、ALTER TABLE — 合同表补充 30 字段
-- ============================
ALTER TABLE edu_contract
  ADD COLUMN contract_category     varchar(16)    DEFAULT NULL     COMMENT '合同分类(初中/高中/大学/高端)'  AFTER contract_type,
  ADD COLUMN selected_subject     varchar(128)   DEFAULT NULL     COMMENT '选科或专业'                   AFTER contract_category,
  ADD COLUMN service_period_text   varchar(128)   DEFAULT NULL     COMMENT '服务时间描述(如2022.12-2024.7)' AFTER expire_date,
  ADD COLUMN service_contract_name varchar(128)   DEFAULT NULL     COMMENT '升学服务合同名'               AFTER service_period_text,
  ADD COLUMN payment_received_date date           DEFAULT NULL     COMMENT '收到款日期'                   AFTER payment_method,
  ADD COLUMN is_installment       char(1)        DEFAULT 'N'      COMMENT '是否分期 Y/N'                AFTER payment_received_date,
  ADD COLUMN installment_second   decimal(14,2)   DEFAULT 0.00     COMMENT '第二次付款'                   AFTER is_installment,
  ADD COLUMN installment_third    decimal(14,2)   DEFAULT 0.00     COMMENT '第三次付款'                   AFTER installment_second,
  ADD COLUMN actual_total_received decimal(14,2) DEFAULT 0.00    COMMENT '实际总收费'                   AFTER installment_third,
  ADD COLUMN settlement_date      date           DEFAULT NULL     COMMENT '结算日期'                     AFTER actual_total_received,
  ADD COLUMN sign_person          varchar(64)    DEFAULT NULL     COMMENT '签约负责人'                   AFTER settlement_date,
  ADD COLUMN contract_recovered   char(1)        DEFAULT 'N'      COMMENT '合同是否已收回 Y/N'          AFTER sign_person,
  ADD COLUMN remittance_name      varchar(64)    DEFAULT NULL     COMMENT '汇款名'                       AFTER contract_recovered,
  ADD COLUMN need_invoice         char(1)        DEFAULT 'N'      COMMENT '是否开发票 Y/N'              AFTER remittance_name,
  ADD COLUMN guardian_name         varchar(64)    DEFAULT NULL     COMMENT '委托代理人(监护人)'           AFTER need_invoice,
  ADD COLUMN guardian_id_card      varchar(32)   DEFAULT NULL     COMMENT '监护人身份证'                 AFTER guardian_name,
  ADD COLUMN guardian_phone        varchar(20)   DEFAULT NULL     COMMENT '监护人电话'                   AFTER guardian_id_card,
  ADD COLUMN guardian_email        varchar(128)  DEFAULT NULL     COMMENT '监护人邮箱'                   AFTER guardian_phone,
  ADD COLUMN home_address          varchar(500)  DEFAULT NULL     COMMENT '住址'                         AFTER guardian_email,
  ADD COLUMN apply_school_count    int           DEFAULT 0        COMMENT '申请院校数量'                AFTER home_address,
  ADD COLUMN apply_region_scope    varchar(255)  DEFAULT NULL     COMMENT '院校地区范围'                 AFTER apply_school_count,
  ADD COLUMN interview_camp        varchar(64)    DEFAULT NULL     COMMENT '面试集训营'                   AFTER apply_region_scope,
  ADD COLUMN major_camp            varchar(64)    DEFAULT NULL     COMMENT '专业探索营'                   AFTER interview_camp,
  ADD COLUMN volunteer_camp         varchar(64)    DEFAULT NULL     COMMENT '志愿填报营'                   AFTER major_camp,
  ADD COLUMN freshman_camp          varchar(64)    DEFAULT NULL     COMMENT '大学新生营'                   AFTER volunteer_camp,
  ADD COLUMN gvi_project           varchar(64)    DEFAULT NULL     COMMENT 'GVI项目'                     AFTER freshman_camp,
  ADD COLUMN research_project       varchar(64)    DEFAULT NULL     COMMENT '科研'                         AFTER gvi_project,
  ADD COLUMN internship_project    varchar(64)    DEFAULT NULL     COMMENT '实习'                         AFTER research_project;

-- ============================
-- 三、ALTER TABLE — 员工表补充 5 字段
-- ============================
ALTER TABLE edu_staff
  ADD COLUMN base_salary          decimal(12,2)  DEFAULT 0.00     COMMENT '基础工资'                     AFTER commission_rate,
  ADD COLUMN bank_account         varchar(64)    DEFAULT NULL     COMMENT '银行账号(薪酬打款)'            AFTER base_salary,
  ADD COLUMN major_error_count    int            DEFAULT 0        COMMENT '重大错误次数(满5次影响奖金)'   AFTER bank_account,
  ADD COLUMN emergency_contact    varchar(64)    DEFAULT NULL     COMMENT '紧急联系人'                   AFTER major_error_count,
  ADD COLUMN emergency_phone      varchar(20)    DEFAULT NULL     COMMENT '紧急联系电话'                 AFTER emergency_contact;

-- ============================
-- 四、CREATE TABLE — 学校管理
-- ============================
CREATE TABLE IF NOT EXISTS edu_school (
  id            bigint        NOT NULL AUTO_INCREMENT COMMENT '学校ID',
  tenant_id     varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  name_cn       varchar(128)  NOT NULL COMMENT '学校中文名',
  name_en       varchar(256)  DEFAULT NULL COMMENT '学校英文名',
  country       varchar(32)   DEFAULT NULL COMMENT '所在国家/地区',
  nature        varchar(32)   DEFAULT NULL COMMENT '学校性质(公立/私立/综合等)',
  ranking       varchar(64)   DEFAULT NULL COMMENT '排名(QS/THE/国内)',
  intro         text          DEFAULT NULL COMMENT '学校简介',
  history       text          DEFAULT NULL COMMENT '校史',
  advantages    text          DEFAULT NULL COMMENT '优势专业',
  fees          varchar(500)  DEFAULT NULL COMMENT '费用信息',
  language_req  varchar(255)  DEFAULT NULL COMMENT '语言要求(雅思/托福)',
  materials     text          DEFAULT NULL COMMENT '申请材料清单',
  official_url  varchar(500)  DEFAULT NULL COMMENT '官网',
  contact_info  varchar(500)  DEFAULT NULL COMMENT '联系方式',
  brochure_url  varchar(500)  DEFAULT NULL COMMENT '招生简章URL',
  del_flag      char(1)       DEFAULT '0' COMMENT '删除标志',
  remark        varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept   bigint        DEFAULT NULL COMMENT '创建部门',
  create_by     bigint        DEFAULT NULL COMMENT '创建者',
  create_time   datetime      DEFAULT NULL COMMENT '创建时间',
  update_by     bigint        DEFAULT NULL COMMENT '更新者',
  update_time   datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_name (tenant_id, name_cn),
  KEY idx_tenant_country (tenant_id, country)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='学校管理';

-- ============================
-- 五、CREATE TABLE — 申请管理
-- ============================
CREATE TABLE IF NOT EXISTS edu_application (
  id              bigint        NOT NULL AUTO_INCREMENT COMMENT '申请ID',
  tenant_id       varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  student_id      bigint        NOT NULL COMMENT '学生ID',
  school_id       bigint        DEFAULT NULL COMMENT '申请学校ID(edu_school)',
  school_name     varchar(256)  DEFAULT NULL COMMENT '学校名称(冗余)',
  apply_teacher_id bigint        DEFAULT NULL COMMENT '申请老师ID',
  doc_writer_id   bigint        DEFAULT NULL COMMENT '文书老师ID',
  application_no  varchar(64)   DEFAULT NULL COMMENT '申请编号',
  apply_year      varchar(16)   DEFAULT NULL COMMENT '申请年份',
  publish_date    date          DEFAULT NULL COMMENT '发布日期',
  deadline        date          DEFAULT NULL COMMENT '截止日期',
  submit_date     date          DEFAULT NULL COMMENT '提交日期',
  status          char(1)       DEFAULT '0' COMMENT '状态 0=待申请 1=已提交 2=审核中 3=已录取 4=被拒 5=撤回',
  system_url      varchar(500)  DEFAULT NULL COMMENT '申请系统网址',
  system_account  varchar(128)  DEFAULT NULL COMMENT '申请系统账号',
  system_pwd      varchar(256)  DEFAULT NULL COMMENT '申请系统密码(加密)',
  mistake_note    varchar(500)  DEFAULT NULL COMMENT '失误记录',
  overtime_note   varchar(500)  DEFAULT NULL COMMENT '超时记录',
  salary_status   char(1)       DEFAULT '0' COMMENT '薪酬状态 0=未发放 1=已发放',
  del_flag        char(1)       DEFAULT '0' COMMENT '删除标志',
  remark          varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept     bigint        DEFAULT NULL COMMENT '创建部门',
  create_by       bigint        DEFAULT NULL COMMENT '创建者',
  create_time     datetime      DEFAULT NULL COMMENT '创建时间',
  update_by       bigint        DEFAULT NULL COMMENT '更新者',
  update_time     datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_student (tenant_id, student_id),
  KEY idx_tenant_school (tenant_id, school_id),
  KEY idx_tenant_status (tenant_id, status)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='申请管理';

-- ============================
-- 六、CREATE TABLE — 录取结果
-- ============================
CREATE TABLE IF NOT EXISTS edu_admission (
  id               bigint        NOT NULL AUTO_INCREMENT COMMENT '录取ID',
  tenant_id        varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  student_id       bigint        NOT NULL COMMENT '学生ID',
  school_id        bigint        DEFAULT NULL COMMENT '录取学校ID',
  school_name      varchar(256)  DEFAULT NULL COMMENT '录取学校名称',
  enrolled         char(1)       DEFAULT 'N' COMMENT '是否最终就读 Y/N',
  major            varchar(128)  DEFAULT NULL COMMENT '录取专业',
  is_comprehensive char(1)       DEFAULT 'N' COMMENT '是否综评录取 Y/N',
  exam_score       varchar(64)   DEFAULT NULL COMMENT '高考成绩',
  exam_ranking     varchar(64)   DEFAULT NULL COMMENT '排位',
  english_score    varchar(64)   DEFAULT NULL COMMENT '高考英语分数',
  scholarship      varchar(255)  DEFAULT NULL COMMENT '奖学金信息',
  admit_date       date          DEFAULT NULL COMMENT '录取日期',
  admit_term       varchar(32)   DEFAULT NULL COMMENT '录取学期',
  del_flag         char(1)       DEFAULT '0' COMMENT '删除标志',
  remark           varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept      bigint        DEFAULT NULL COMMENT '创建部门',
  create_by        bigint        DEFAULT NULL COMMENT '创建者',
  create_time      datetime      DEFAULT NULL COMMENT '创建时间',
  update_by        bigint        DEFAULT NULL COMMENT '更新者',
  update_time      datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_student (tenant_id, student_id),
  KEY idx_tenant_school (tenant_id, school_id)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='录取结果';

-- ============================
-- 七、CREATE TABLE — 成绩记录
-- ============================
CREATE TABLE IF NOT EXISTS edu_student_score (
  id            bigint        NOT NULL AUTO_INCREMENT COMMENT '成绩ID',
  tenant_id     varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  student_id    bigint        NOT NULL COMMENT '学生ID',
  exam_name     varchar(128)  NOT NULL COMMENT '考试名称',
  exam_type     varchar(32)   DEFAULT NULL COMMENT '考试类型(雅思/托福/学水/高考/月考等)',
  subject       varchar(64)   DEFAULT NULL COMMENT '科目',
  score         decimal(8,2)  DEFAULT NULL COMMENT '成绩',
  total_score   decimal(8,2)  DEFAULT NULL COMMENT '满分',
  ranking       varchar(64)   DEFAULT NULL COMMENT '排名',
  grade_level   varchar(16)   DEFAULT NULL COMMENT '等级(A/B/C/D/F)',
  exam_date     date          DEFAULT NULL COMMENT '考试日期',
  del_flag      char(1)       DEFAULT '0' COMMENT '删除标志',
  remark        varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept   bigint        DEFAULT NULL COMMENT '创建部门',
  create_by     bigint        DEFAULT NULL COMMENT '创建者',
  create_time   datetime      DEFAULT NULL COMMENT '创建时间',
  update_by     bigint        DEFAULT NULL COMMENT '更新者',
  update_time   datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_student (tenant_id, student_id),
  KEY idx_tenant_type (tenant_id, exam_type)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='学生成绩记录';

-- ============================
-- 八、CREATE TABLE — 背景活动
-- ============================
CREATE TABLE IF NOT EXISTS edu_student_activity (
  id            bigint        NOT NULL AUTO_INCREMENT COMMENT '活动ID',
  tenant_id     varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  student_id    bigint        NOT NULL COMMENT '学生ID',
  activity_type varchar(32)   NOT NULL COMMENT '活动类型(GVI/实习/科研/支教/竞赛/NUS在线课等)',
  title         varchar(255)  DEFAULT NULL COMMENT '活动名称',
  provider      varchar(128)  DEFAULT NULL COMMENT '提供方/平台',
  period        varchar(128)  DEFAULT NULL COMMENT '参与时间段',
  description   text          DEFAULT NULL COMMENT '活动描述',
  achievement   varchar(500)  DEFAULT NULL COMMENT '成果/证书',
  del_flag      char(1)       DEFAULT '0' COMMENT '删除标志',
  remark        varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept   bigint        DEFAULT NULL COMMENT '创建部门',
  create_by     bigint        DEFAULT NULL COMMENT '创建者',
  create_time   datetime      DEFAULT NULL COMMENT '创建时间',
  update_by     bigint        DEFAULT NULL COMMENT '更新者',
  update_time   datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_student (tenant_id, student_id),
  KEY idx_tenant_type (tenant_id, activity_type)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='学生背景活动';

-- ============================
-- 九、CREATE TABLE — 薪酬管理
-- ============================
CREATE TABLE IF NOT EXISTS edu_salary_record (
  id              bigint         NOT NULL AUTO_INCREMENT COMMENT '薪酬ID',
  tenant_id       varchar(20)    DEFAULT '000000' COMMENT '租户ID',
  staff_id        bigint         NOT NULL COMMENT '员工ID',
  student_id      bigint         DEFAULT NULL COMMENT '关联学生ID',
  service_type    varchar(32)    NOT NULL COMMENT '服务类型(报名/续费/补购/申请/文书等)',
  amount          decimal(14,2)   DEFAULT 0.00 COMMENT '金额',
  bonus_first     decimal(14,2)   DEFAULT 0.00 COMMENT '奖金先发',
  bonus_final     decimal(14,2)   DEFAULT 0.00 COMMENT '奖金尾发',
  penalty         decimal(14,2)   DEFAULT 0.00 COMMENT '罚款',
  pay_date        date           DEFAULT NULL COMMENT '发放日期',
  pay_status      char(1)        DEFAULT '0' COMMENT '发放状态 0=待发 1=已发',
  contract_id     bigint         DEFAULT NULL COMMENT '关联合同ID',
  del_flag        char(1)        DEFAULT '0' COMMENT '删除标志',
  remark          varchar(500)   DEFAULT NULL COMMENT '备注',
  create_dept     bigint         DEFAULT NULL COMMENT '创建部门',
  create_by       bigint         DEFAULT NULL COMMENT '创建者',
  create_time     datetime       DEFAULT NULL COMMENT '创建时间',
  update_by       bigint         DEFAULT NULL COMMENT '更新者',
  update_time     datetime       DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_staff (tenant_id, staff_id),
  KEY idx_tenant_type (tenant_id, service_type),
  KEY idx_tenant_pay_status (tenant_id, pay_status)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='薪酬管理';

-- ============================
-- 十、CREATE TABLE — 发票管理
-- ============================
CREATE TABLE IF NOT EXISTS edu_invoice (
  id              bigint        NOT NULL AUTO_INCREMENT COMMENT '发票ID',
  tenant_id       varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  student_id      bigint        DEFAULT NULL COMMENT '学生ID',
  contract_id     bigint        DEFAULT NULL COMMENT '关联合同ID',
  invoice_no      varchar(64)   DEFAULT NULL COMMENT '发票号码',
  amount          decimal(14,2) DEFAULT 0.00 COMMENT '发票金额',
  title           varchar(128)  DEFAULT NULL COMMENT '发票抬头',
  tax_no          varchar(64)   DEFAULT NULL COMMENT '税号',
  requirement     varchar(500)  DEFAULT NULL COMMENT '开票要求',
  status          char(1)       DEFAULT '0' COMMENT '状态 0=待开票 1=已开票 2=已作废',
  file_url        varchar(1000) DEFAULT NULL COMMENT '发票文件URL',
  invoice_date    date          DEFAULT NULL COMMENT '开票日期',
  del_flag        char(1)       DEFAULT '0' COMMENT '删除标志',
  remark          varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept     bigint        DEFAULT NULL COMMENT '创建部门',
  create_by       bigint        DEFAULT NULL COMMENT '创建者',
  create_time     datetime      DEFAULT NULL COMMENT '创建时间',
  update_by       bigint        DEFAULT NULL COMMENT '更新者',
  update_time     datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_student (tenant_id, student_id),
  KEY idx_tenant_status (tenant_id, status)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='发票管理';

-- ============================
-- 十一、CREATE TABLE — 渠道管理
-- ============================
CREATE TABLE IF NOT EXISTS edu_channel (
  id                bigint        NOT NULL AUTO_INCREMENT COMMENT '渠道ID',
  tenant_id         varchar(20)   DEFAULT '000000' COMMENT '租户ID',
  channel_name      varchar(128)  NOT NULL COMMENT '渠道名称',
  channel_type      varchar(32)   DEFAULT NULL COMMENT '渠道类型(学校/机构/个人/网络等)',
  referrer          varchar(64)   DEFAULT NULL COMMENT '推荐人',
  contact_phone     varchar(20)   DEFAULT NULL COMMENT '联系电话',
  commission_rate   decimal(5,2)  DEFAULT 0.00 COMMENT '佣金比例(%)',
  commission_amount decimal(14,2) DEFAULT 0.00 COMMENT '佣金金额',
  student_count     int           DEFAULT 0 COMMENT '推荐学生数',
  converted_count   int           DEFAULT 0 COMMENT '转化学生数',
  status            char(1)       DEFAULT '0' COMMENT '状态 0=正常 1=停用',
  del_flag          char(1)       DEFAULT '0' COMMENT '删除标志',
  remark            varchar(500)  DEFAULT NULL COMMENT '备注',
  create_dept       bigint        DEFAULT NULL COMMENT '创建部门',
  create_by         bigint        DEFAULT NULL COMMENT '创建者',
  create_time       datetime      DEFAULT NULL COMMENT '创建时间',
  update_by         bigint        DEFAULT NULL COMMENT '更新者',
  update_time       datetime      DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  KEY idx_tenant_name (tenant_id, channel_name)
) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='渠道管理';

-- ============================
-- 十二、新字典数据 (ID 200-279)
-- ============================
DELETE FROM edu_dict WHERE id BETWEEN 200 AND 279;

-- 课程体系 200-206
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(200, '000000', 'student_curriculum_system', '高考', 'GAOKAO', 1, '0'),
(201, '000000', 'student_curriculum_system', 'AP', 'AP', 2, '0'),
(202, '000000', 'student_curriculum_system', 'A-Level', 'A_LEVEL', 3, '0'),
(203, '000000', 'student_curriculum_system', 'DSE', 'DSE', 4, '0'),
(204, '000000', 'student_curriculum_system', 'IB', 'IB', 5, '0'),
(205, '000000', 'student_curriculum_system', '其他', 'OTHER', 6, '0');

-- 国籍 210-215
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(210, '000000', 'student_nationality', '内地', 'MAINLAND', 1, '0'),
(211, '000000', 'student_nationality', '香港', 'HK', 2, '0'),
(212, '000000', 'student_nationality', '澳门', 'MO', 3, '0'),
(213, '000000', 'student_nationality', '台湾', 'TW', 4, '0'),
(214, '000000', 'student_nationality', '其他', 'OTHER', 5, '0');

-- 合同分类 220-226
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(220, '000000', 'contract_category', '初中', 'JUNIOR', 1, '0'),
(221, '000000', 'contract_category', '高中', 'SENIOR', 2, '0'),
(222, '000000', 'contract_category', '大学', 'UNIVERSITY', 3, '0'),
(223, '000000', 'contract_category', '高端', 'PREMIUM', 4, '0');

-- 新角色 227-230
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(227, '000000', 'staff_role', '申请老师', 'APPLY_TEACHER', 5, '0'),
(228, '000000', 'staff_role', '学业规划导师', 'ACADEMIC_PLANNER', 6, '0'),
(229, '000000', 'staff_role', '专业规划导师', 'MAJOR_PLANNER', 7, '0'),
(230, '000000', 'staff_role', '兼职管家', 'PART_TIME_HOUSEKEEPER', 8, '0');

-- 申请状态 240-245
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(240, '000000', 'application_status', '待申请', '0', 1, '0'),
(241, '000000', 'application_status', '已提交', '1', 2, '0'),
(242, '000000', 'application_status', '审核中', '2', 3, '0'),
(243, '000000', 'application_status', '已录取', '3', 4, '0'),
(244, '000000', 'application_status', '被拒', '4', 5, '0'),
(245, '000000', 'application_status', '撤回', '5', 6, '0');

-- 薪酬服务类型 250-258
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(250, '000000', 'salary_service_type', '报名', 'ENROLL', 1, '0'),
(251, '000000', 'salary_service_type', '续费', 'RENEW', 2, '0'),
(252, '000000', 'salary_service_type', '补购', 'ADDON', 3, '0'),
(253, '000000', 'salary_service_type', '申请', 'APPLICATION', 4, '0'),
(254, '000000', 'salary_service_type', '文书', 'DOC_WRITE', 5, '0'),
(255, '000000', 'salary_service_type', '面试辅导', 'INTERVIEW', 6, '0'),
(256, '000000', 'salary_service_type', '志愿填报', 'VOLUNTEER', 7, '0'),
(257, '000000', 'salary_service_type', '背景提升', 'BACKGROUND', 8, '0'),
(258, '000000', 'salary_service_type', '其他', 'OTHER', 9, '0');

-- 发票状态 260-263
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(260, '000000', 'invoice_status', '待开票', '0', 1, '0'),
(261, '000000', 'invoice_status', '已开票', '1', 2, '0'),
(262, '000000', 'invoice_status', '已作废', '2', 3, '0');

-- 渠道类型 270-274
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(270, '000000', 'channel_type', '学校', 'SCHOOL', 1, '0'),
(271, '000000', 'channel_type', '机构', 'ORGANIZATION', 2, '0'),
(272, '000000', 'channel_type', '个人', 'PERSONAL', 3, '0'),
(273, '000000', 'channel_type', '网络', 'ONLINE', 4, '0');

-- 成绩考试类型 275-282
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(275, '000000', 'student_score_type', '雅思', 'IELTS', 1, '0'),
(276, '000000', 'student_score_type', '托福', 'TOEFL', 2, '0'),
(277, '000000', 'student_score_type', '学水', 'ACADEMIC', 3, '0'),
(278, '000000', 'student_score_type', '高考', 'GAOKAO', 4, '0'),
(279, '000000', 'student_score_type', '月考', 'MONTHLY', 5, '0'),
(280, '000000', 'student_score_type', '期中', 'MIDTERM', 6, '0'),
(281, '000000', 'student_score_type', '期末', 'FINAL', 7, '0'),
(282, '000000', 'student_score_type', '竞赛', 'CONTEST', 8, '0');

-- 活动类型 290-296
INSERT INTO edu_dict (id, tenant_id, dict_type, dict_label, dict_value, sort_order, status) VALUES
(290, '000000', 'activity_type', 'GVI', 'GVI', 1, '0'),
(291, '000000', 'activity_type', '实习', 'INTERNSHIP', 2, '0'),
(292, '000000', 'activity_type', '科研', 'RESEARCH', 3, '0'),
(293, '000000', 'activity_type', '支教', 'VOLUNTEER_TEACH', 4, '0'),
(294, '000000', 'activity_type', '竞赛', 'COMPETITION', 5, '0'),
(295, '000000', 'activity_type', 'NUS在线课', 'NUS_ONLINE', 6, '0'),
(296, '000000', 'activity_type', '其他', 'OTHER', 7, '0');

-- ============================
-- 十三、新菜单数据 (ID 2400-2794)
-- ============================
DELETE FROM sys_menu WHERE menu_id BETWEEN 2400 AND 2794;

-- 学校管理 2400
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2400, '000000', '学校管理', 2000, 10, 'school', 'edu/school/index', 1, 0, 'C', '0', '0', 'edu:school:list', '#', 103, 1, sysdate(), NULL, NULL, '学校管理菜单'),
(2410, '000000', '学校查询', 2400, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:school:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2411, '000000', '学校新增', 2400, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:school:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2412, '000000', '学校修改', 2400, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:school:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2413, '000000', '学校删除', 2400, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:school:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2414, '000000', '学校导出', 2400, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:school:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 申请管理 2500
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2500, '000000', '申请管理', 2000, 11, 'application', 'edu/application/index', 1, 0, 'C', '0', '0', 'edu:application:list', '#', 103, 1, sysdate(), NULL, NULL, '申请管理菜单'),
(2510, '000000', '申请查询', 2500, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:application:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2511, '000000', '申请新增', 2500, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:application:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2512, '000000', '申请修改', 2500, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:application:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2513, '000000', '申请删除', 2500, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:application:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2514, '000000', '申请导出', 2500, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:application:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 录取结果 2600
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2600, '000000', '录取结果', 2000, 12, 'admission', 'edu/admission/index', 1, 0, 'C', '0', '0', 'edu:admission:list', '#', 103, 1, sysdate(), NULL, NULL, '录取结果菜单'),
(2610, '000000', '录取查询', 2600, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:admission:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2611, '000000', '录取新增', 2600, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:admission:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2612, '000000', '录取修改', 2600, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:admission:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2613, '000000', '录取删除', 2600, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:admission:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2614, '000000', '录取导出', 2600, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:admission:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 成绩记录 2700
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2700, '000000', '成绩记录', 2000, 13, 'score', 'edu/score/index', 1, 0, 'C', '0', '0', 'edu:score:list', '#', 103, 1, sysdate(), NULL, NULL, '成绩记录菜单'),
(2710, '000000', '成绩查询', 2700, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:score:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2711, '000000', '成绩新增', 2700, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:score:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2712, '000000', '成绩修改', 2700, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:score:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2713, '000000', '成绩删除', 2700, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:score:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2714, '000000', '成绩导出', 2700, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:score:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 背景活动 2720
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2720, '000000', '背景活动', 2000, 14, 'activity', 'edu/activity/index', 1, 0, 'C', '0', '0', 'edu:activity:list', '#', 103, 1, sysdate(), NULL, NULL, '背景活动菜单'),
(2730, '000000', '活动查询', 2720, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:activity:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2731, '000000', '活动新增', 2720, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:activity:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2732, '000000', '活动修改', 2720, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:activity:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2733, '000000', '活动删除', 2720, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:activity:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2734, '000000', '活动导出', 2720, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:activity:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 薪酬管理 2740
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2740, '000000', '薪酬管理', 2000, 15, 'salary', 'edu/salary/index', 1, 0, 'C', '0', '0', 'edu:salary:list', '#', 103, 1, sysdate(), NULL, NULL, '薪酬管理菜单'),
(2750, '000000', '薪酬查询', 2740, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:salary:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2751, '000000', '薪酬新增', 2740, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:salary:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2752, '000000', '薪酬修改', 2740, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:salary:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2753, '000000', '薪酬删除', 2740, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:salary:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2754, '000000', '薪酬导出', 2740, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:salary:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 发票管理 2760
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2760, '000000', '发票管理', 2000, 16, 'invoice', 'edu/invoice/index', 1, 0, 'C', '0', '0', 'edu:invoice:list', '#', 103, 1, sysdate(), NULL, NULL, '发票管理菜单'),
(2770, '000000', '发票查询', 2760, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:invoice:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2771, '000000', '发票新增', 2760, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:invoice:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2772, '000000', '发票修改', 2760, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:invoice:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2773, '000000', '发票删除', 2760, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:invoice:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2774, '000000', '发票导出', 2760, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:invoice:export', '#', NULL, 1, sysdate(), NULL, NULL, '');

-- 渠道管理 2780
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES
(2780, '000000', '渠道管理', 2000, 17, 'channel', 'edu/channel/index', 1, 0, 'C', '0', '0', 'edu:channel:list', '#', 103, 1, sysdate(), NULL, NULL, '渠道管理菜单'),
(2790, '000000', '渠道查询', 2780, 1, '', NULL, 1, 0, 'F', '0', '0', 'edu:channel:query',  '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2791, '000000', '渠道新增', 2780, 2, '', NULL, 1, 0, 'F', '0', '0', 'edu:channel:add',    '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2792, '000000', '渠道修改', 2780, 3, '', NULL, 1, 0, 'F', '0', '0', 'edu:channel:edit',   '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2793, '000000', '渠道删除', 2780, 4, '', NULL, 1, 0, 'F', '0', '0', 'edu:channel:remove', '#', NULL, 1, sysdate(), NULL, NULL, ''),
(2794, '000000', '渠道导出', 2780, 5, '', NULL, 1, 0, 'F', '0', '0', 'edu:channel:export', '#', NULL, 1, sysdate(), NULL, NULL, '');
