﻿-- PostgreSQL Database Schema for iMeeting (Multi-tenant)
-- 0 为系统预留租户 ID

-- ----------------------------
-- 0. 租户与组织
-- ----------------------------
CREATE EXTENSION IF NOT EXISTS vector;
-- 租户表
CREATE TABLE sys_tenant (
                            id              BIGSERIAL PRIMARY KEY,
                            tenant_code     VARCHAR(64) NOT NULL UNIQUE,
                            tenant_name     VARCHAR(128) NOT NULL,
                            status          SMALLINT NOT NULL DEFAULT 1,
                            expire_time     TIMESTAMP(6),
                            contact_name    VARCHAR(64),
                            contact_phone   VARCHAR(32),
                            remark          VARCHAR(255),
                            created_at      TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
                            updated_at      TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
                            is_deleted      SMALLINT DEFAULT 0
);
CREATE  INDEX uk_tenant_code ON sys_tenant (tenant_code) WHERE is_deleted = 0;

-- 组织架构表
DROP TABLE IF EXISTS sys_org CASCADE;

CREATE TABLE sys_org (
                         id          BIGSERIAL PRIMARY KEY,
                         tenant_id   BIGINT NOT NULL,
                         parent_id   BIGINT,
                         org_name    VARCHAR(128) NOT NULL,
                         org_code    VARCHAR(64),
                         org_path    VARCHAR(512),
                         sort_order  INTEGER DEFAULT 0,
                         status      SMALLINT DEFAULT 1,
                         created_at  TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
                         updated_at  TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
                         is_deleted  SMALLINT DEFAULT 0,
                         CONSTRAINT fk_org_parent FOREIGN KEY (parent_id)
                             REFERENCES sys_org(id),
                         CONSTRAINT fk_org_tenant FOREIGN KEY (tenant_id)
                             REFERENCES sys_tenant(id)
);

CREATE INDEX idx_org_tenant ON sys_org (tenant_id);

-- ----------------------------
-- 1. 用户与角色
-- ----------------------------

-- 用户表
DROP TABLE IF EXISTS sys_user CASCADE;

CREATE TABLE sys_user (
                          user_id            BIGSERIAL PRIMARY KEY,
                          username           VARCHAR(50) NOT NULL UNIQUE,
                          display_name       VARCHAR(50) NOT NULL,
                          email              VARCHAR(100),
                          phone              VARCHAR(30) UNIQUE,
                          password_hash      VARCHAR(255) NOT NULL,
                          status             SMALLINT NOT NULL DEFAULT 1,
                          is_deleted         SMALLINT NOT NULL DEFAULT 0,
                          pwd_reset_required SMALLINT DEFAULT 1,
                          created_at         TIMESTAMP(6) NOT NULL DEFAULT now(),
                          updated_at         TIMESTAMP(6) NOT NULL DEFAULT now(),
                          is_platform_admin  BOOLEAN DEFAULT false
);
CREATE  INDEX uk_user_username ON sys_user (username) WHERE is_deleted = 0;

-- 角色表
DROP TABLE IF EXISTS sys_role CASCADE;

CREATE TABLE sys_role (
                          role_id    BIGSERIAL PRIMARY KEY,
                          tenant_id  BIGINT NOT NULL,
                          role_code  VARCHAR(50) NOT NULL,
                          role_name  VARCHAR(50) NOT NULL,
                          status     SMALLINT NOT NULL DEFAULT 1,
                          remark     TEXT,
                          is_deleted SMALLINT NOT NULL DEFAULT 0,
                          created_at TIMESTAMP(6) NOT NULL DEFAULT now(),
                          updated_at TIMESTAMP(6) NOT NULL DEFAULT now()
);

CREATE INDEX idx_sys_role_tenant ON sys_role (tenant_id);
CREATE  INDEX uk_role_code ON sys_role (tenant_id, role_code) WHERE is_deleted = 0;

-- 用户-角色关联表 (按 tenant_id 强约束，避免跨租户角色污染)
DROP TABLE IF EXISTS sys_user_role CASCADE;

CREATE TABLE sys_user_role (
                               id         BIGSERIAL PRIMARY KEY,
                               tenant_id  BIGINT NOT NULL,
                               user_id    BIGINT NOT NULL,
                               role_id    BIGINT NOT NULL,
                               is_deleted SMALLINT NOT NULL DEFAULT 0,
                               created_at TIMESTAMP(6) NOT NULL DEFAULT now(),
                               updated_at TIMESTAMP(6) NOT NULL DEFAULT now(),
                               UNIQUE (tenant_id, user_id, role_id)
);

-- ----------------------------
-- 2. 权限/字典/参数 (全局共享, 无 tenant_id)
-- ----------------------------

DROP TABLE IF EXISTS sys_permission CASCADE;

CREATE TABLE sys_permission (
                                perm_id     BIGSERIAL PRIMARY KEY,
                                parent_id   BIGINT,
                                name        VARCHAR(100) NOT NULL,
                                code        VARCHAR(100) NOT NULL ,
                                perm_type   VARCHAR(20) NOT NULL,
                                level       INTEGER NOT NULL,
                                path        VARCHAR(255),
                                component   VARCHAR(255),
                                icon        VARCHAR(100),
                                sort_order  INTEGER NOT NULL DEFAULT 0,
                                is_visible  SMALLINT NOT NULL DEFAULT 1,
                                status      SMALLINT NOT NULL DEFAULT 1,
                                description TEXT,
                                meta        JSONB,
                                is_deleted  SMALLINT NOT NULL DEFAULT 0,
                                created_at  TIMESTAMP(6) NOT NULL DEFAULT now(),
                                updated_at  TIMESTAMP(6) NOT NULL DEFAULT now()
);

DROP TABLE IF EXISTS sys_tenant_user CASCADE;

CREATE TABLE sys_tenant_user (
                                 id         BIGSERIAL PRIMARY KEY,
                                 user_id    BIGINT NOT NULL,
                                 tenant_id  BIGINT NOT NULL,
                                 org_id     BIGINT,
                                 status     SMALLINT DEFAULT 1,
                                 is_deleted SMALLINT DEFAULT 0,
                                 created_at TIMESTAMP(6) NOT NULL DEFAULT now(),
                                 updated_at TIMESTAMP(6) NOT NULL DEFAULT now()
);

CREATE  INDEX uk_tenant_user
    ON sys_tenant_user (user_id, tenant_id)
    WHERE is_deleted = 0;
CREATE TABLE sys_dict_type (
    dict_type_id BIGSERIAL PRIMARY KEY,
    type_code VARCHAR(50) UNIQUE NOT NULL,
    type_name VARCHAR(50) NOT NULL,
    status SMALLINT DEFAULT 1,
    remark TEXT,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
    is_deleted SMALLINT DEFAULT 0
);

CREATE TABLE sys_dict_item (
    dict_item_id BIGSERIAL PRIMARY KEY,
    type_code VARCHAR(50) NOT NULL,
    item_label VARCHAR(100) NOT NULL,
    item_value VARCHAR(100) NOT NULL,
    sort_order INT DEFAULT 0,
    status SMALLINT DEFAULT 1,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
    is_deleted SMALLINT DEFAULT 0,
    remark varchar(255)
);
CREATE INDEX idx_dict_item_type ON sys_dict_item (type_code);
CREATE  INDEX uk_dict_item_value ON sys_dict_item (type_code, item_value);

CREATE TABLE sys_param (
    param_id BIGSERIAL PRIMARY KEY,
    param_key VARCHAR(100) UNIQUE NOT NULL,
    param_value TEXT NOT NULL,
    param_type VARCHAR(20) NOT NULL,
    is_system SMALLINT DEFAULT 0,
    status SMALLINT DEFAULT 1,
    description TEXT,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
    is_deleted SMALLINT DEFAULT 0
);

CREATE TABLE sys_role_permission (
                                     "id" BIGSERIAL PRIMARY KEY,
                                     "role_id" int8 NOT NULL,
                                     "perm_id" int8 NOT NULL,
                                     "is_deleted" int2 NOT NULL DEFAULT 0,
                                     "created_at" timestamp(6) NOT NULL DEFAULT now(),
                                     "updated_at" timestamp(6) NOT NULL DEFAULT now()
);
-- ----------------------------
-- 3. 日志 (租户隔离)
-- ----------------------------

CREATE TABLE sys_log (
    id BIGSERIAL PRIMARY KEY,
    tenant_id BIGINT NOT NULL DEFAULT 0,
    user_id BIGINT,
    username VARCHAR(50),
    log_type VARCHAR(20), -- LOGIN, OPERATION
    operation VARCHAR(100) NOT NULL,
    method VARCHAR(200),
    params TEXT,
    status SMALLINT DEFAULT 1,
    ip VARCHAR(50),
    duration BIGINT,
    created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_log_tenant_type ON sys_log (tenant_id, log_type, created_at);

-- ----------------------------
-- 4. 平台配置 (系统品牌化)
-- ----------------------------
DROP TABLE IF EXISTS sys_platform_config CASCADE;
CREATE TABLE sys_platform_config (
    id                BIGINT PRIMARY KEY, -- 固定为 1
    project_name      VARCHAR(128) NOT NULL,
    logo_url          VARCHAR(512),
    icon_url          VARCHAR(512),
    login_bg_url      VARCHAR(512),
    icp_info          VARCHAR(128),
    copyright_info    VARCHAR(255),
    system_description TEXT,
    created_at        TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP,
    updated_at        TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP,
    is_deleted        SMALLINT DEFAULT 0
);

INSERT INTO sys_platform_config (id, project_name, copyright_info) 
VALUES (1, 'iMeeting 智能会议系统', '© 2026 iMeeting Team. All rights reserved.');

-- ----------------------------
-- 6. 业务模块 - 声纹管理
-- ----------------------------
DROP TABLE IF EXISTS biz_speakers CASCADE;
CREATE TABLE biz_speakers (
    id              BIGSERIAL PRIMARY KEY,
    creator_id      BIGINT NOT NULL,           -- 创建人ID，用于声纹库管理归属
    user_id         BIGINT,                    -- 关联系统用户ID，可为空
    external_speaker_id VARCHAR(100),          -- 第三方声纹库中的人员ID
    name            VARCHAR(100) NOT NULL,     -- 发言人姓名
    voice_path      VARCHAR(512),              -- 原始声纹文件存储路径
    voice_ext       VARCHAR(10),               -- 文件后缀
    voice_size      BIGINT,                    -- 文件大小
    status          SMALLINT DEFAULT 1,        -- 状态: 1=已保存, 2=注册中, 3=已注册, 4=失败
    embedding       VECTOR(512),               -- 声纹特征向量 (预留 pgvector 字段)
    remark          TEXT,                      -- 备注
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    updated_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    is_deleted      SMALLINT NOT NULL DEFAULT 0
);

CREATE INDEX idx_speaker_creator ON biz_speakers (creator_id) WHERE is_deleted = 0;
CREATE INDEX idx_speaker_user ON biz_speakers (user_id) WHERE is_deleted = 0;
CREATE INDEX idx_speaker_external ON biz_speakers (external_speaker_id) WHERE is_deleted = 0;

COMMENT ON TABLE biz_speakers IS '声纹发言人基础信息表 (声纹库资源)';

-- ----------------------------
-- 7. 业务模块 - 热词管理
-- ----------------------------
DROP TABLE IF EXISTS biz_hot_words CASCADE;
CREATE TABLE biz_hot_words (
    id              BIGSERIAL PRIMARY KEY,
    tenant_id       BIGINT NOT NULL,           -- 租户ID (强制隔离)
    word            VARCHAR(100) NOT NULL,     -- 热词原文
    is_public       SMALLINT DEFAULT 0,        -- 1:租户公开, 0:个人私有
    creator_id      BIGINT,                     -- 创建者ID
    pinyin_list     text,                     -- 拼音数组(支持多音字, 如 ["i mi ting", "i mei ting"])
    match_strategy  SMALLINT DEFAULT 1,        -- 匹配策略: 1:精确匹配, 2:拼音模糊匹配
    category        VARCHAR(50),               -- 类别 (人名、术语、地名)
    weight          INTEGER DEFAULT 10,        -- 权重 (1-100)
    status          SMALLINT DEFAULT 1,        -- 状态: 1:启用, 0:禁用
    is_synced       SMALLINT DEFAULT 0,        -- 是否已同步至第三方引擎: 0:未同步, 1:已同步
    remark          TEXT,                      -- 备注
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    updated_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    is_deleted      SMALLINT NOT NULL DEFAULT 0
);

CREATE INDEX idx_hotword_tenant ON biz_hot_words (tenant_id);
CREATE INDEX idx_hotword_word ON biz_hot_words (word) WHERE is_deleted = 0;

COMMENT ON TABLE biz_hot_words IS '语音识别热词表';

-- ----------------------------
-- 8. 业务模块 - 提示词模板
-- ----------------------------
DROP TABLE IF EXISTS biz_prompt_templates CASCADE;
CREATE TABLE biz_prompt_templates (
    id              BIGSERIAL PRIMARY KEY,
    tenant_id       BIGINT NOT NULL DEFAULT 0,  -- 租户ID (0为系统级)
    template_name   VARCHAR(100) NOT NULL,      -- 模板名称
    category        VARCHAR(20),                -- 分类 (字典: biz_prompt_category)
    is_system       SMALLINT DEFAULT 0,         -- 是否系统预置 (1:是, 0:否)
    creator_id      BIGINT,                     -- 创建人ID
    tags            text,                      -- 标签数组 (JSONB)
    usage_count     INTEGER DEFAULT 0,          -- 使用次数
    prompt_content  TEXT NOT NULL,              -- 提示词内容
    status          SMALLINT DEFAULT 1,         -- 状态: 1:启用, 0:禁用
    remark          VARCHAR(255),               -- 备注
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    updated_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    is_deleted      SMALLINT NOT NULL DEFAULT 0
);

CREATE INDEX idx_prompt_tenant ON biz_prompt_templates (tenant_id);
CREATE INDEX idx_prompt_system ON biz_prompt_templates (is_system) WHERE is_deleted = 0;

COMMENT ON TABLE biz_prompt_templates IS '会议总结提示词模板表';

-- ----------------------------
-- 9. 业务模块 - AI 模型管理
-- ----------------------------
DROP TABLE IF EXISTS biz_asr_models CASCADE;
CREATE TABLE biz_asr_models (
    id              BIGSERIAL PRIMARY KEY,
    tenant_id       BIGINT NOT NULL DEFAULT 0,
    model_name      VARCHAR(100) NOT NULL,
    provider        VARCHAR(50),
    base_url        VARCHAR(255),
    api_key         VARCHAR(255),
    model_code      VARCHAR(100),
    ws_url          VARCHAR(255),
    media_config    text,
    is_default      SMALLINT DEFAULT 0,
    status          SMALLINT DEFAULT 1,
    remark          VARCHAR(255),
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    updated_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    is_deleted      SMALLINT NOT NULL DEFAULT 0
);

DROP TABLE IF EXISTS biz_llm_models CASCADE;
CREATE TABLE biz_llm_models (
    id              BIGSERIAL PRIMARY KEY,
    tenant_id       BIGINT NOT NULL DEFAULT 0,
    model_name      VARCHAR(100) NOT NULL,
    provider        VARCHAR(50),
    base_url        VARCHAR(255),
    api_path        VARCHAR(100),
    api_key         VARCHAR(255),
    model_code      VARCHAR(100),
    temperature     DECIMAL(3,2) DEFAULT 0.7,
    top_p           DECIMAL(3,2) DEFAULT 0.9,
    is_default      SMALLINT DEFAULT 0,
    status          SMALLINT DEFAULT 1,
    remark          VARCHAR(255),
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    updated_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    is_deleted      SMALLINT NOT NULL DEFAULT 0
);

CREATE INDEX idx_asr_model_tenant ON biz_asr_models (tenant_id);
CREATE INDEX idx_asr_model_default ON biz_asr_models (is_default) WHERE is_deleted = 0;
CREATE INDEX idx_llm_model_tenant ON biz_llm_models (tenant_id);
CREATE INDEX idx_llm_model_default ON biz_llm_models (is_default) WHERE is_deleted = 0;

COMMENT ON TABLE biz_asr_models IS 'ASR 模型配置表';
COMMENT ON TABLE biz_llm_models IS 'LLM 模型配置表';

-- ----------------------------
-- 10. 业务模块 - 会议主表
-- ----------------------------
DROP TABLE IF EXISTS biz_meetings CASCADE;
CREATE TABLE biz_meetings (
    id              BIGSERIAL PRIMARY KEY,
    tenant_id       BIGINT NOT NULL DEFAULT 0,
    title           VARCHAR(200) NOT NULL,
    meeting_time    TIMESTAMP(6),
    participants    TEXT,
    tags            VARCHAR(255),
    audio_url       VARCHAR(500),
    creator_id      BIGINT,                     -- 发起人ID
    creator_name    VARCHAR(100),               -- 发起人姓名
    latest_summary_task_id BIGINT,              -- 最新成功总结任务ID
    status          SMALLINT DEFAULT 0,         -- 0:待处理, 1:处理中, 2:成功, 3:失败
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    updated_at      TIMESTAMP(6) NOT NULL DEFAULT now(),
    is_deleted      SMALLINT NOT NULL DEFAULT 0
);

-- ----------------------------
-- 11. 业务模块 - 转录明细表
-- ----------------------------
DROP TABLE IF EXISTS biz_meeting_transcripts CASCADE;
CREATE TABLE biz_meeting_transcripts (
    id              BIGSERIAL PRIMARY KEY,
    meeting_id      BIGINT NOT NULL,
    speaker_id      VARCHAR(50),                -- ASR返回的发言人标识
    speaker_name    VARCHAR(100),               -- 修改后的发言人姓名
    speaker_label   VARCHAR(50),                -- 发言人标签
    content         TEXT,                       -- 转录内容
    start_time      INTEGER,                    -- 开始时间(ms)
    end_time        INTEGER,                    -- 结束时间(ms)
    sort_order      INTEGER,
    created_at      TIMESTAMP(6) NOT NULL DEFAULT now()
);

-- ----------------------------
-- 12. 业务模块 - AI 异步任务日志表
-- ----------------------------
DROP TABLE IF EXISTS biz_ai_tasks CASCADE;
CREATE TABLE biz_ai_tasks (
    id              BIGSERIAL PRIMARY KEY,
    meeting_id      BIGINT NOT NULL,
    task_type       VARCHAR(20),                -- ASR / SUMMARY
    status          SMALLINT DEFAULT 0,         -- 0:排队, 1:执行中, 2:成功, 3:失败
    request_data    text,                      -- 请求三方原始JSON
    response_data   text,                      -- 三方返回原始JSON
    task_config     text,                      -- 任务配置参数快照
    result_file_path VARCHAR(500),              -- 结果文件路径
    error_msg       TEXT,                       -- 错误堆栈
    started_at      TIMESTAMP(6),
    completed_at    TIMESTAMP(6)
);

CREATE INDEX idx_meeting_tenant ON biz_meetings (tenant_id);
CREATE INDEX idx_transcript_meeting ON biz_meeting_transcripts (meeting_id);
CREATE INDEX idx_aitask_meeting ON biz_ai_tasks (meeting_id);

COMMENT ON TABLE biz_meetings IS '会议管理主表';
COMMENT ON TABLE biz_meeting_transcripts IS '会议转录明细表';
COMMENT ON TABLE biz_ai_tasks IS 'AI 任务流水日志表';
DROP TABLE IF EXISTS "biz_prompt_template_user_config";
CREATE TABLE "biz_prompt_template_user_config" (
                                                   "id" BIGSERIAL PRIMARY KEY,
                                                   "tenant_id" int8 NOT NULL DEFAULT 0,
                                                   "user_id" int8 NOT NULL,
                                                   "template_id" int8 NOT NULL,
                                                   "status" int2 DEFAULT 1,
                                                   "created_at" timestamp(6) NOT NULL DEFAULT now(),
                                                   "updated_at" timestamp(6) NOT NULL DEFAULT now(),
                                                   "is_deleted" int2 NOT NULL DEFAULT 0
);


-- ----------------------------
-- 5. 基础初始化数据
-- ----------------------------

-- 字典初始化数据
-- sys_common_status
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_common_status', '通用状态', '0=禁用, 1=启用');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_common_status', '启用', '1', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_common_status', '禁用', '0', 2);

-- sys_permission_type
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_permission_type', '权限类型', 'directory=目录, menu=菜单, button=按钮');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_permission_type', '目录', 'directory', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_permission_type', '菜单', 'menu', 2);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_permission_type', '按钮', 'button', 3);

-- sys_common_visibility
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_common_visibility', '可见性', '0=隐藏, 1=显示');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_common_visibility', '显示', '1', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_common_visibility', '隐藏', '0', 2);

-- sys_permission_level
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_permission_level', '权限层级', '1=一级入口, 2=二级子项, 3=三级按钮');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_permission_level', '一级入口', '1', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_permission_level', '二级子项', '2', 2);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_permission_level', '三级按钮', '3', 3);

-- sys_log_type
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_log_type', '日志类型', 'LOGIN=登录, OPERATION=操作');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_log_type', '登录', 'LOGIN', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_log_type', '操作', 'OPERATION', 2);

-- sys_param_type
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_param_type', '参数类型', 'String, Number, Boolean, JSON');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_param_type', 'String', 'String', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_param_type', 'Number', 'Number', 2);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_param_type', 'Boolean', 'Boolean', 3);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_param_type', 'JSON', 'JSON', 4);

-- sys_log_status
INSERT INTO sys_dict_type (type_code, type_name, remark) VALUES ('sys_log_status', '操作状态', '1=成功, 0=失败');
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_log_status', '成功', '1', 1);
INSERT INTO sys_dict_item (type_code, item_label, item_value, sort_order) VALUES ('sys_log_status', '失败', '0', 2);
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (21, 18, '查询租户', 'sys_tenant:query', 'button', 3, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.647439', '2026-02-25 10:09:32.647439');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (28, 19, '删除组织', 'sys:org:delete', 'button', 3, NULL, NULL, NULL, 4, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.65871', '2026-02-25 10:09:32.65871');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (22, 18, '新增租户', 'sys_tenant:create', 'button', 3, NULL, NULL, NULL, 2, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.647439', '2026-02-25 10:09:32.647439');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (23, 18, '修改租户', 'sys_tenant:update', 'button', 3, NULL, NULL, NULL, 3, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.647439', '2026-02-25 10:09:32.647439');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (24, 18, '删除租户', 'sys_tenant:delete', 'button', 3, NULL, NULL, NULL, 4, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.647439', '2026-02-25 10:09:32.647439');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (48, 3, '权限查询', 'sys:permission:list', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 16:07:04.002702', '2026-02-26 16:07:04.003701');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (13, 12, '角色权限', 'menu:role:permission', 'menu', 2, '/role-permissions', NULL, NULL, 0, 1, 1, NULL, NULL, 1, '2026-02-10 18:01:32.999774', '2026-02-11 09:41:31.952294');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (39, 12, '平台管理', 'platform', 'menu', 2, '/platform-settings', NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 14:54:49.406968', '2026-02-26 14:54:49.407968');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (25, 19, '查询组织', 'sys:org:query', 'button', 3, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.65871', '2026-02-25 10:09:32.65871');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (26, 19, '新增组织', 'sys:org:create', 'button', 3, NULL, NULL, NULL, 2, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.65871', '2026-02-25 10:09:32.65871');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (27, 19, '修改组织', 'sys:org:update', 'button', 3, NULL, NULL, NULL, 3, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.65871', '2026-02-25 10:09:32.65871');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (3, 12, '角色管理', 'sys:role:list', 'menu', 2, '/roles', NULL, NULL, 3, 1, 1, '角色管理菜单', NULL, 0, '2026-02-10 07:24:30.148186', '2026-02-10 17:24:07.484806');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (40, 3, '角色查询', 'sys:role:query', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:35:35.692367', '2026-02-26 15:35:35.693366');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (41, 3, '角色创建', 'sys:role:create', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:35:50.081581', '2026-02-26 15:35:50.081581');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (42, 3, '角色更新', 'sys:role:update', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:36:03.385343', '2026-02-26 15:36:03.385343');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (43, 3, '角色删除', 'sys:role:delete', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:36:20.451039', '2026-02-26 15:36:20.451039');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (44, 3, '角色权限列表', 'sys:role:permission:list', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:36:39.902216', '2026-02-26 15:36:39.902216');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (45, 3, '角色权限更新', 'sys:role:permission:save', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:36:53.595974', '2026-02-26 15:36:53.595974');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (2, 12, '用户管理', 'sys:user:list', 'menu', 2, '/users', NULL, NULL, 2, 1, 1, '用户管理菜单', NULL, 0, '2026-02-10 07:24:30.148186', '2026-02-26 15:43:21.037142');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (29, 2, '查询用户', 'sys:user:query', 'button', 3, NULL, NULL, NULL, 1, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.669947', '2026-02-25 10:09:32.669947');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (30, 2, '新增用户', 'sys:user:create', 'button', 3, NULL, NULL, NULL, 2, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.669947', '2026-02-25 10:09:32.669947');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (31, 2, '修改用户', 'sys:user:update', 'button', 3, NULL, NULL, NULL, 3, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.669947', '2026-02-25 10:09:32.669947');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (32, 2, '删除用户', 'sys:user:delete', 'button', 3, NULL, NULL, NULL, 4, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.669947', '2026-02-25 10:09:32.669947');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (33, 2, '分配角色', 'sys:user:role:save', 'button', 3, NULL, NULL, NULL, 5, 1, 1, NULL, NULL, 0, '2026-02-25 10:09:32.669947', '2026-02-25 10:09:32.669947');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (46, 2, '用户角色查询', 'sys:user:role:list', 'button', 3, NULL, NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-02-26 15:45:14.890567', '2026-02-26 15:45:28.553231');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (54, NULL, '热词管理', 'menu:hotword', 'menu', 1, '/hotwords', NULL, 'hotword', 11, 1, 1, NULL, NULL, 0, '2026-02-28 16:51:49.158997', '2026-02-28 16:51:49.158997');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (55, NULL, '总结模板', 'menu:prompt', 'menu', 1, '/prompts', NULL, 'prompt', 12, 1, 1, NULL, NULL, 0, '2026-02-28 17:47:51.015282', '2026-02-28 17:47:51.015282');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (56, NULL, '模型配置', 'menu:aimodel', 'menu', 1, '/aimodels', NULL, 'aimodel', 13, 1, 1, NULL, NULL, 0, '2026-03-02 09:48:27.179055', '2026-03-02 09:48:27.179055');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (57, NULL, '会议中心', 'menu:meeting', 'menu', 1, '/meetings', NULL, 'meeting', 20, 1, 1, NULL, NULL, 0, '2026-03-02 11:02:58.089065', '2026-03-02 11:02:58.089065');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (52, NULL, '测试菜单', 'test', 'directory', 1, '/role-permissions', NULL, NULL, 0, 1, 1, NULL, NULL, 1, '2026-02-27 10:39:04.576329', '2026-03-03 10:03:45.999369');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (59, NULL, '声纹注册', 'speaker', 'menu', 1, '/speaker-reg', NULL, NULL, 0, 1, 1, NULL, NULL, 0, '2026-03-06 15:23:09.314321', '2026-03-06 15:23:51.715481');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (18, 12, '租户管理', 'menu:tenant', 'menu', 2, '/tenants', NULL, NULL, 1, 1, 1, NULL, NULL, 0, '2026-02-12 14:06:13.672548', '2026-03-06 16:31:45.006699');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (58, NULL, '发起会议', 'menu:meeting:create', 'menu', 1, '/meeting-create', NULL, 'audio', 19, 1, 1, NULL, NULL, 1, '2026-03-02 16:21:47.326202', '2026-03-05 09:05:49.301092');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (4, 12, '菜单管理', 'sys:permission:list', 'menu', 2, '/permissions', NULL, NULL, 4, 1, 1, '权限管理菜单', NULL, 0, '2026-02-10 07:24:30.148186', '2026-03-05 17:10:30.891258');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (5, 12, '设备管理', 'menu:devices', 'menu', 2, '/devices', NULL, NULL, 5, 0, 1, '设备管理菜单', NULL, 0, '2026-02-10 07:24:30.148186', '2026-03-05 17:11:48.867451');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (15, 12, '字典管理', 'menu:dict', 'menu', 2, '/dictionaries', NULL, NULL, 1, 1, 1, NULL, NULL, 0, '2026-02-11 13:54:56.100838', '2026-03-05 17:12:28.223844');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (17, 12, '日志管理', 'menu:log', 'menu', 2, '/logs', NULL, NULL, 1, 1, 1, NULL, NULL, 0, '2026-02-12 09:49:02.814427', '2026-03-05 17:12:57.94561');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (38, 12, '参数管理', 'params', 'menu', 2, '/params', NULL, NULL, 2, 1, 1, NULL, NULL, 0, '2026-02-26 14:34:16.903552', '2026-03-06 16:31:51.714937');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (1, NULL, '任务监控', 'menu:dashboard', 'menu', 1, '/', NULL, NULL, 1, 1, 1, 'Dashboard 菜单', NULL, 0, '2026-02-10 07:24:30.148186', '2026-03-05 18:01:31.515477');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (19, 12, '组织管理', 'sys:org:list', 'menu', 2, '/orgs', NULL, NULL, 3, 1, 1, NULL, NULL, 0, '2026-02-12 14:09:01.818807', '2026-03-06 16:32:00.114277');
INSERT INTO "sys_permission" ("perm_id", "parent_id", "name", "code", "perm_type", "level", "path", "component", "icon", "sort_order", "is_visible", "status", "description", "meta", "is_deleted", "created_at", "updated_at") VALUES (12, NULL, '系统管理', 'system', 'directory', 1, NULL, NULL, NULL, 110, 1, 1, NULL, NULL, 0, '2026-02-10 17:23:52.877017', '2026-03-06 14:00:20.182181');


INSERT INTO sys_param ("param_id", "param_key", "param_value", "param_type", "status", "is_system", "description", "is_deleted", "created_at", "updated_at") VALUES (2,  'security.token.refresh_ttl_days', '7', 'int', 1, 1, 'Refresh Token 有效期(天)', 0, '2026-02-09 09:54:21.893832', '2026-02-09 09:54:21.893832');
INSERT INTO sys_param ("param_id", "param_key", "param_value", "param_type", "status", "is_system", "description", "is_deleted", "created_at", "updated_at") VALUES (4,  'tenant.init.default.menu.codes', 'sys:user:list,sys:user:create,sys:user:query,sys:role:create,sys:user:role:save,sys:org:delete,sys:org:query,sys:role:permission:list,sys:org:update,sys:role:permission:save,sys:role:update,system,sys:user:delete,sys:user:role:list,sys:org:list,sys:role:delete,sys:role:list,sys:org:create,sys:user:update,sys:permission:list,sys:role:query', 'String', 1, 1, '新建租户时角色权限', 0, '2026-02-26 16:46:20.392789', '2026-02-26 16:46:38.137264');
INSERT INTO sys_param ("param_id", "param_key", "param_value", "param_type", "status", "is_system", "description", "is_deleted", "created_at", "updated_at") VALUES (5,  'tenant.init.default.password', '123456', 'String', 1, 1, NULL, 0, '2026-02-26 16:46:52.124755', '2026-02-26 16:46:52.124755');
INSERT INTO sys_param ("param_id", "param_key", "param_value", "param_type", "status", "is_system", "description", "is_deleted", "created_at", "updated_at") VALUES (3,  'security.captcha.enabled', 'false', 'boolean', 1, 1, '是否开启验证码', 0, '2026-02-11 02:45:31.097324', '2026-03-10 09:40:33.084368');
INSERT INTO sys_param ("param_id", "param_key", "param_value", "param_type", "status", "is_system", "description", "is_deleted", "created_at", "updated_at") VALUES (1,  'security.token.access_ttl_minutes', '120', 'int', 1, 1, 'Access Token 有效期(分钟)', 0, '2026-02-09 09:54:21.888052', '2026-03-10 10:15:39.55035');


INSERT INTO sys_user ( "username", "display_name", "email", "phone", "password_hash", "status", "is_deleted", "created_at", "updated_at", "is_platform_admin", "pwd_reset_required")
VALUES ( 'admin', '管理员', 'admin', NULL, '$2a$10$BOm1iCFj3ObfBeyQxOvjVO659vXvIRGOd4YR62r0TUHqSusWW5bFS', 1, 0, '2026-02-09 09:54:21.880637', '2026-02-28 17:57:32.63338', 't', NULL);


INSERT INTO "sys_dict_type" ("dict_type_id", "type_code", "type_name", "status", "remark", "created_at", "updated_at") VALUES (9, 'biz_hotword_category', '热词类别', 1, '语音识别纠错分类', '2026-02-28 17:08:52.362532', '2026-02-28 17:08:52.362532');
INSERT INTO "sys_dict_type" ("dict_type_id", "type_code", "type_name", "status", "remark", "created_at", "updated_at") VALUES (10, 'biz_prompt_category', '提示词分类', 1, '会议总结模板分类', '2026-02-28 17:47:50.999655', '2026-02-28 17:47:50.999655');
INSERT INTO "sys_dict_type" ("dict_type_id", "type_code", "type_name", "status", "remark", "created_at", "updated_at") VALUES (11, 'biz_ai_provider', '模型提供商', 1, 'AI 模型服务商分类', '2026-03-02 10:10:16.653182', '2026-03-02 10:10:16.653182');
INSERT INTO "sys_dict_type" ("dict_type_id", "type_code", "type_name", "status", "remark", "created_at", "updated_at") VALUES (12, 'biz_speaker_label', '发言人角色', 1, '会议发言人的身份标签', '2026-03-02 16:15:58.193117', '2026-03-02 16:15:58.193117');
INSERT INTO "sys_dict_type" ("dict_type_id", "type_code", "type_name", "status", "remark", "created_at", "updated_at") VALUES (13, 'biz_prompt_level', '提示词模板属性', 1, '用于定义提示词模板的层级属性：1-预置模板（系统或租户级），0-个人模板', '2026-03-04 10:54:30.49116', '2026-03-04 10:54:30.49116');

INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (22, 'biz_hotword_category', '人名', 'person', 1, 1, NULL, '2026-02-28 17:08:52.374667', '2026-02-28 17:08:52.374667');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (23, 'biz_hotword_category', '术语', 'term', 2, 1, NULL, '2026-02-28 17:08:52.374667', '2026-02-28 17:08:52.374667');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (24, 'biz_hotword_category', '地名', 'location', 3, 1, NULL, '2026-02-28 17:08:52.374667', '2026-02-28 17:08:52.374667');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (25, 'biz_hotword_category', '通用', 'general', 4, 1, NULL, '2026-02-28 17:08:52.374667', '2026-02-28 17:08:52.374667');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (26, 'biz_prompt_category', '全文纪要', 'summary', 1, 1, NULL, '2026-02-28 17:47:51.013288', '2026-02-28 17:47:51.013288');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (27, 'biz_prompt_category', '待办提取', 'todo', 2, 1, NULL, '2026-02-28 17:47:51.013288', '2026-02-28 17:47:51.013288');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (28, 'biz_prompt_category', '访谈整理', 'interview', 3, 1, NULL, '2026-02-28 17:47:51.013288', '2026-02-28 17:47:51.013288');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (29, 'biz_prompt_category', '创意构思', 'creative', 4, 1, NULL, '2026-02-28 17:47:51.013288', '2026-02-28 17:47:51.013288');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (30, 'biz_ai_provider', '阿里云', 'Aliyun', 1, 1, NULL, '2026-03-02 10:10:16.665646', '2026-03-02 10:10:16.665646');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (31, 'biz_ai_provider', 'OpenAI', 'OpenAI', 2, 1, NULL, '2026-03-02 10:10:16.665646', '2026-03-02 10:10:16.665646');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (32, 'biz_ai_provider', 'Gemini', 'Gemini', 3, 1, NULL, '2026-03-02 10:10:16.665646', '2026-03-02 10:10:16.665646');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (33, 'biz_ai_provider', 'DeepSeek', 'DeepSeek', 4, 1, NULL, '2026-03-02 10:10:16.665646', '2026-03-02 10:10:16.665646');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (34, 'biz_ai_provider', 'Kimi', 'Kimi', 5, 1, NULL, '2026-03-02 10:10:16.665646', '2026-03-02 10:10:16.665646');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (35, 'biz_ai_provider', '自定义/本地', 'Custom', 6, 1, NULL, '2026-03-02 10:10:16.665646', '2026-03-02 10:10:16.665646');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (36, 'biz_speaker_label', '主持人', 'host', 1, 1, NULL, '2026-03-02 16:15:58.205277', '2026-03-02 16:15:58.205277');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (37, 'biz_speaker_label', '汇报人', 'speaker', 2, 1, NULL, '2026-03-02 16:15:58.205277', '2026-03-02 16:15:58.205277');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (38, 'biz_speaker_label', '技术专家', 'expert', 3, 1, NULL, '2026-03-02 16:15:58.205277', '2026-03-02 16:15:58.205277');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (39, 'biz_speaker_label', '客户代表', 'customer', 4, 1, NULL, '2026-03-02 16:15:58.205277', '2026-03-02 16:15:58.205277');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (40, 'biz_prompt_level', '预置模板', '1', 1, 1, '平台系统预置或租户共享预置', '2026-03-04 10:55:42.163768', '2026-03-04 10:55:42.163768');
INSERT INTO "sys_dict_item" ("dict_item_id", "type_code", "item_label", "item_value", "sort_order", "status", "remark", "created_at", "updated_at") VALUES (41, 'biz_prompt_level', '个人模板', '0', 2, 1, '个人私有模板', '2026-03-04 10:55:42.175269', '2026-03-04 10:55:42.175269');

