INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (89, '任务状态', NULL, 0, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);
INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (90, '待处理', '0', 89, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);
INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (91, '处理中', '1', 89, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);
INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (92, '取消中', '2', 89, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);
INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (93, '已取消', '3', 89, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);
INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (94, '处理成功', '4', 89, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);
INSERT INTO `nx_llm`.`com_dictionary` (`id`, `name`, `code`, `pid`, `type`, `status`, `note`, `priority`, `creator`,
                                       `update_time`, `create_time`, `updater`, `data_status`, `create_user_id`,
                                       `update_user_id`)
VALUES (95, '处理失败', '5', 89, 'task_status', '1', NULL, 0, NULL, NULL, CURRENT_TIMESTAMP, NULL, '1', NULL, NULL);

--  案件分析状态字典
INSERT INTO nx_llm.com_dictionary (id, name, code, pid, type, status, note, priority, creator, update_time, create_time, updater, data_status, create_user_id, update_user_id) VALUES (97, '分析状态', null, 0, 'case_analysis_status', '1', null, 0, null, null, '2024-12-31 14:26:52', null, '1', null, null);
INSERT INTO nx_llm.com_dictionary (id, name, code, pid, type, status, note, priority, creator, update_time, create_time, updater, data_status, create_user_id, update_user_id) VALUES (98, '未分析', '0', 97, 'case_analysis_status', '1', null, 0, null, null, '2024-12-31 14:26:52', null, '1', null, null);
INSERT INTO nx_llm.com_dictionary (id, name, code, pid, type, status, note, priority, creator, update_time, create_time, updater, data_status, create_user_id, update_user_id) VALUES (99, '正在分析', '1', 97, 'case_analysis_status', '1', null, 0, null, null, '2024-12-31 14:26:52', null, '1', null, null);
INSERT INTO nx_llm.com_dictionary (id, name, code, pid, type, status, note, priority, creator, update_time, create_time, updater, data_status, create_user_id, update_user_id) VALUES (100, '分析成功', '2', 97, 'case_analysis_status', '1', null, 0, null, null, '2024-12-31 14:26:52', null, '1', null, null);
INSERT INTO nx_llm.com_dictionary (id, name, code, pid, type, status, note, priority, creator, update_time, create_time, updater, data_status, create_user_id, update_user_id) VALUES (101, '分析失败', '3', 97, 'case_analysis_status', '1', null, 0, null, null, '2024-12-31 14:26:52', null, '1', null, null);

-- 添加运营管理菜单
INSERT INTO nx_llm.system_menu (id, label, label_code, label_type, parent_id, create_user_id, create_time, update_user_id, update_time) VALUES ('16', '运营管理', 'p_operationManagement', 0, null, null, '2025-01-02 14:29:10', null, '2025-01-02 14:29:10');
INSERT INTO nx_llm.system_menu (id, label, label_code, label_type, parent_id, create_user_id, create_time, update_user_id, update_time) VALUES ('17', '任务列表', 'p_taskList', 0, '16', null, '2025-01-02 14:29:47', null, '2025-01-02 14:29:47');
INSERT INTO nx_llm.system_menu (id, label, label_code, label_type, parent_id, create_user_id, create_time, update_user_id, update_time) VALUES ('18', '案件批量处理', 'p_handleCases', 0, '16', null, '2025-01-02 16:13:47', null, '2025-01-02 16:13:47');

-- 给管理员角色添加权限
INSERT INTO nx_llm.system_role_menu_relation (id, role_id, menu_id, create_user_id, create_time, update_user_id, update_time) VALUES ('1830865690704818280', '1820688378166366209', '16', null, '2025-01-02 15:09:31', null, '2025-01-02 15:09:31');
INSERT INTO nx_llm.system_role_menu_relation (id, role_id, menu_id, create_user_id, create_time, update_user_id, update_time) VALUES ('1830865690704818281', '1820688378166366209', '17', null, '2025-01-02 15:09:31', null, '2025-01-02 15:09:31');
INSERT INTO nx_llm.system_role_menu_relation (id, role_id, menu_id, create_user_id, create_time, update_user_id, update_time) VALUES ('1830865690704818282', '1820688378166366209', '18', null, '2024-09-03 15:09:31', null, '2024-09-03 15:09:31');


CREATE TABLE `task_record`
(
    `id`             varchar(64) NOT NULL,
    `name`           varchar(255) DEFAULT NULL COMMENT '名称',
    `prompt_id`      varchar(64)  DEFAULT NULL,
    `case_id`        text COMMENT '案件ID，英文逗号分隔',
    `record_id`      text COMMENT '笔录ID，英文逗号分隔',
    `evidence_id`    text COMMENT '证据ID，英文逗号分隔',
    `type`           varchar(1)   DEFAULT NULL COMMENT '0：全部案件 1：部分案件 2：部分笔录 3：部分证据',
    `status`         varchar(1)   DEFAULT '0' COMMENT '0：待处理 1：处理中 2：取消中 3：已取消 4：处理成功 5：处理失败',
    `cancel_time`    datetime     DEFAULT NULL COMMENT '取消时间',
    `create_user_id` varchar(64)  DEFAULT NULL COMMENT '创建人ID',
    `create_time`    datetime     DEFAULT NULL COMMENT '创建时间',
    `update_user_id` varchar(64)  DEFAULT NULL COMMENT '更新人ID',
    `update_time`    datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;

CREATE TABLE `task_case_record`
(
    `id`             varchar(64) NOT NULL,
    `task_record_id` varchar(64) DEFAULT NULL COMMENT '任务ID',
    `case_id`        varchar(64) DEFAULT NULL COMMENT '案件ID',
    `waiting_id`     text COMMENT '等待处理的ID，逗号分隔',
    `processed_id`   text COMMENT '处理完成的ID，逗号分隔',
    `exception_id`   text COMMENT '异常ID，逗号分隔',
    `status`         varchar(1)  DEFAULT NULL COMMENT '0：待处理 1：处理中 2：取消中 3：已取消 4：处理成功 5：处理失败',
    `create_user_id` varchar(64) DEFAULT NULL COMMENT '创建人ID',
    `create_time`    datetime    DEFAULT NULL COMMENT '创建时间',
    `update_user_id` varchar(64) DEFAULT NULL COMMENT '更新人ID',
    `update_time`    datetime    DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;