CREATE DATABASE `spdm_baseline` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

-- spdm_baseline.dimension_template definition

CREATE TABLE `dimension_template` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `templateName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '模板名称',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '模板描述',
  `tenantId` bigint DEFAULT NULL COMMENT '租户ID',
  `createdBy` bigint DEFAULT NULL COMMENT '创建者',
  `updatedBy` bigint DEFAULT NULL COMMENT '修改者',
  `createdAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `templateType` tinyint DEFAULT NULL COMMENT '数据维度类：1、插入维度 2、查询维度',
  PRIMARY KEY (`id`),
  UNIQUE KEY `templateName` (`templateName`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='维度模板主表';


-- spdm_baseline.dimension_template_hierarchy definition

CREATE TABLE `dimension_template_hierarchy` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `templateId` bigint NOT NULL COMMENT '关联的模板ID',
  `displayName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '显示名称',
  `sortOrder` int NOT NULL DEFAULT '0' COMMENT '排序序号（从0开始或从1开始）',
  `tenantId` bigint DEFAULT NULL,
  `createdBy` bigint DEFAULT NULL COMMENT '创建者',
  `updatedBy` bigint DEFAULT NULL COMMENT '修改者',
  `createdAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_template_order` (`templateId`,`sortOrder`)
) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模板层级明细表';


-- spdm_baseline.file_metadata_extension definition

CREATE TABLE `file_metadata_extension` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID，自增',
  `tFilemetaId` bigint NOT NULL COMMENT '关联file_metadata_info表的主键ID',
  `extensionKey` varchar(100) NOT NULL COMMENT '扩展字段名',
  `extensionValue` text COMMENT '扩展字段值',
  `dataType` varchar(20) DEFAULT NULL COMMENT '值的数据类型（string, number, boolean, json等）',
  `createdAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_file_key` (`tFilemetaId`,`extensionKey`) COMMENT '确保每个文件的每个扩展字段唯一',
  KEY `idx_file_id` (`tFilemetaId`) COMMENT '加速按文件ID查询',
  KEY `idx_extension_key` (`extensionKey`) COMMENT '加速按扩展字段名查询'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件元数据扩展表（键值对模式）';


-- spdm_baseline.file_metadata_info definition

CREATE TABLE `file_metadata_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID，自增',
  `relatedResourceUuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所有可能的关联对象uuid（node/task/run/ 后续新增的表）',
  `relatedResourceUuidOwnType` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '关联对象类型（node,task,run,performance）',
  `fileGroupId` bigint DEFAULT NULL COMMENT '逻辑文件组ID（同一文件的所有版本共享一个ID）',
  `versionNo` bigint NOT NULL DEFAULT '1' COMMENT '版本号（从1开始递增）',
  `isLatest` tinyint NOT NULL DEFAULT '1' COMMENT '是否最新版本：1-是，0-否',
  `bucketName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'MinIO的存储桶名称',
  `objectKey` varchar(700) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'MinIO的文件object_key（与业务层绝对路径abs_path一致）',
  `originalName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '文件原始名称',
  `dirType` int DEFAULT NULL COMMENT '文件夹数据类型（仅文件夹有效，data_type=2时非空）1 知识库文件夹，2 项目节点文件夹，3 头像库文件夹，4 仿真参数库文件夹,5 训练模型文件夹',
  `dirStatus` int DEFAULT NULL COMMENT '文件夹数据状态（仅文件夹有效，data_type=2时非空）',
  `fileStatus` int DEFAULT NULL COMMENT '文件数据状态（仅文件有效，data_type=1时非空）',
  `fileType` int DEFAULT NULL COMMENT '文件数据类型（标识模型文件/仿真报告/计算文件/结果曲线/结果云图）',
  `dataType` int NOT NULL COMMENT '数据类型：1-文件夹，2-文件',
  `isRoot` tinyint NOT NULL DEFAULT '0' COMMENT '是否根目录：1-是，0-不是',
  `parentId` bigint DEFAULT NULL COMMENT '父文件ID（根目录时为NULL，非根目录时非空）',
  `creatorId` bigint DEFAULT NULL COMMENT '创建者ID',
  `tenantId` bigint DEFAULT NULL COMMENT '租户ID',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updaterId` bigint DEFAULT NULL COMMENT '更新者ID',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `projectId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所属项目ID（关联的项目uuid）',
  `analysisDirectionId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '分析方向ID（关联的分析项目id）',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注信息',
  `fileSize` bigint unsigned DEFAULT NULL COMMENT '文件大小（单位：字节，仅文件有效，data_type=1时非空）',
  `tag1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag4` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag6` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag7` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag8` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag9` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `tag10` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `approvalStatus` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审批状态：如pending（待审批）、approved（已通过）、rejected（已拒绝）等',
  `approveType` tinyint NOT NULL DEFAULT '0' COMMENT '操作类型：1-文件上传审核中；2-文件修改审核中；3-文件删除审核中；4-文件元数据修改中',
  `tempMetadata` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '待审批的临时JSON数据（修改操作时存储待审核的修改内容）',
  `cidFlowId` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'cid审核电子流程id',
  `uploadTaskId` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '本次新增数据的任务id,毫秒值时间戳',
  `uploadStatus` tinyint DEFAULT '0' COMMENT '文件上传状态，0上传中，1上传完成',
  `templateName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '评审流程模版名称',
  `templateId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '评审流程模版ID',
  PRIMARY KEY (`id`),
  KEY `idx_is_root` (`isRoot`) COMMENT '快速查询根目录',
  KEY `idx_parent_id` (`parentId`) COMMENT '查询子文件/文件夹',
  KEY `idx_data_type` (`dataType`) COMMENT '按文件/文件夹类型筛选',
  KEY `idx_object_key_prefix` (`objectKey`) COMMENT '优化单桶内的路径前缀匹配查询（如查询某目录下的所有子路径）',
  FULLTEXT KEY `ft_idx_name` (`originalName`) /*!50100 WITH PARSER `ngram` */ 
) ENGINE=InnoDB AUTO_INCREMENT=4668 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件元数据信息表（存储MinIO文件的元数据及层级关系）';


-- spdm_baseline.file_permission_dict definition

CREATE TABLE `file_permission_dict` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '权限ID，自增主键',
  `permissionCode` varchar(64) NOT NULL COMMENT '权限编码（如READ、WRITE、DELETE等，唯一标识权限类型）',
  `permissionValue` tinyint NOT NULL COMMENT '权限值（用于位运算的整数，如1、2、4等）',
  `permissionDesc` varchar(255) DEFAULT NULL COMMENT '权限描述（如"读取文件权限"）',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_permission_code` (`permissionCode`) COMMENT '确保权限编码唯一',
  UNIQUE KEY `uk_permission_value` (`permissionValue`) COMMENT '确保权限值唯一，避免位运算冲突'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限字典表（定义系统中所有可用的权限类型及对应值）';


-- spdm_baseline.file_simulation_mapping definition

CREATE TABLE `file_simulation_mapping` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `fileId` bigint NOT NULL COMMENT '文件ID',
  `simulationPoolId` int NOT NULL COMMENT '所属工况库ID',
  `simulationPoolVersion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '工况库版本',
  `simulationPoolTaskId` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关联工况任务ID',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ukFilePoolTask` (`fileId`,`simulationPoolId`,`simulationPoolVersion`,`simulationPoolTaskId`),
  KEY `idxFileId` (`fileId`),
  KEY `idxSimulationPoolId` (`simulationPoolId`),
  KEY `idxSimulationPoolTaskId` (`simulationPoolTaskId`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='文件与工况任务绑定关系表';


-- spdm_baseline.file_storage definition

CREATE TABLE `file_storage` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID（自增）',
  `fileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名（含后缀）',
  `fileId` bigint unsigned NOT NULL COMMENT '文件唯一标识ID（关联文件元数据表）',
  `userGroupId` bigint DEFAULT NULL COMMENT '用户组ID',
  `tenantId` bigint DEFAULT NULL COMMENT '租户ID',
  `userId` bigint unsigned DEFAULT NULL COMMENT '文件所属用户ID',
  `dirId` bigint NOT NULL COMMENT '保存所有父目录ID（项目/学科等目录的唯一标识）',
  `fileBizType` int DEFAULT NULL COMMENT '文件业务类型（1：模型文件 2：仿真报告、3：计算文件、4：曲线文件、5：云图文件，6：网格文件，7：计算过程文件）',
  `fileSuffix` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件后缀（如txt、jpg、pdf）',
  `fileSize` bigint unsigned NOT NULL COMMENT '文件大小（字节数，存储占用计算依据）',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '文件创建时间（精确到秒，自动填充当前时间）',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录更新时间（自动更新）',
  `fullPath` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件完整路径（冗余字段，优化查询）',
  `createYearMonth` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建时间年月（冗余列，格式YYYY-MM，用于分组统计）',
  PRIMARY KEY (`id`),
  KEY `idx_dirid_size` (`dirId`,`fileSize`),
  KEY `idx_userid_size` (`userId`,`fileSize`),
  KEY `idx_dirid_createtime_size` (`dirId`,`createTime`,`fileSize`),
  KEY `idx_userid_createtime_size` (`userId`,`createTime`,`fileSize`),
  KEY `idx_dirid_createmonth_size` (`dirId`,`createYearMonth`,`fileSize`),
  KEY `idx_userid_createmonth_size` (`userId`,`createYearMonth`,`fileSize`),
  KEY `idx_dir_file_suffix_biz_createtime_size` (`dirId`,`fileName`,`fileSuffix`,`fileBizType`,`createTime`,`fileSize`),
  FULLTEXT KEY `idx_filename` (`fileName`)
) ENGINE=InnoDB AUTO_INCREMENT=2311 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='文件存储统计主表（支持项目/学科/用户维度的存储占用统计）';


-- spdm_baseline.file_storage_quota definition

CREATE TABLE `file_storage_quota` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID（自增）',
  `userId` bigint NOT NULL COMMENT '关联用户表sys_user的id（唯一标识用户）',
  `tenantId` bigint NOT NULL COMMENT '租户ID',
  `quotaValue` bigint NOT NULL COMMENT '存储阈值（单位：字节）',
  `quotaUnit` varchar(10) NOT NULL COMMENT '阈值显示单位（枚举：TB/GB/MB/KB）',
  `usedValue` bigint NOT NULL DEFAULT '0' COMMENT '已使用存储（单位：字节）',
  `status` varchar(20) NOT NULL DEFAULT 'NORMAL' COMMENT '配额状态（枚举：NORMAL-正常/WARNING-临界/EXCEED-超限）',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_userId` (`userId`) COMMENT '唯一索引：用户ID（避免重复配额）',
  KEY `idx_status` (`status`) COMMENT '普通索引：按状态筛选（如查询超限用户）',
  KEY `idx_tenantId` (`tenantId`) COMMENT '普通索引：按租户ID查询'
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件存储-用户存储配额表（支持TB/GB/MB/KB多单位）';


-- spdm_baseline.file_user_permission definition

CREATE TABLE `file_user_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID，自增',
  `tFilemetaId` bigint DEFAULT NULL COMMENT '关联的文件元数据ID（关联file_metadata_info表的id）',
  `permission` tinyint DEFAULT NULL COMMENT '权限标识（如1-读、2-写、4-删除等，支持位运算组合）',
  `userId` bigint DEFAULT NULL COMMENT '用户ID（关联系统用户表）',
  `tenantId` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_filemeta_user` (`tFilemetaId`,`userId`) COMMENT '确保权限唯一，同时用于查询用户对特定文件的权限',
  KEY `idx_userid` (`userId`),
  KEY `idx_filemeta_id` (`tFilemetaId`)
) ENGINE=InnoDB AUTO_INCREMENT=2248 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件权限表（存储用户对文件的具体权限）';


-- spdm_baseline.simulation_app_configure definition

CREATE TABLE `simulation_app_configure` (
  `id` int NOT NULL AUTO_INCREMENT,
  `appId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用UUID',
  `appName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '应用名称',
  `configName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '配置名称',
  `configValue` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '配置内容',
  `configType` tinyint NOT NULL DEFAULT '0' COMMENT '配置类型，目前没用用到',
  `comment` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '配置描述',
  `creator` bigint NOT NULL COMMENT '创建人',
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='仿真应用配置';


-- spdm_baseline.simulation_app_repository definition

CREATE TABLE `simulation_app_repository` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用唯一ID',
  `appName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用名称',
  `appType` tinyint NOT NULL DEFAULT '0' COMMENT '应用类型 1：本地应用 2：云应用 3：hpc求解应用 4：web应用',
  `appPath` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用启动路径',
  `appStatus` tinyint NOT NULL DEFAULT '1' COMMENT '应用状态 0：禁用 1：可用',
  `appImage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用图标',
  `appVersion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用版本',
  `appVendor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用供应商',
  `machineCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '本地应用所属机器机器码',
  `comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '应用描述',
  `tenantId` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '应用创建时间',
  PRIMARY KEY (`id`),
  KEY `uuid` (`uuid`),
  KEY `appName` (`appName`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_approve_flow definition

CREATE TABLE `simulation_approve_flow` (
  `id` int NOT NULL AUTO_INCREMENT,
  `approveTitle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '评审主题',
  `approveStatus` tinyint NOT NULL DEFAULT '1' COMMENT '评审状态 1: 评审中 2：评审通过 3：评审不通过 4：评审终止',
  `approveType` tinyint NOT NULL DEFAULT '0' COMMENT '评审类型 1：仿真地图评审 2：知识库评审 3：仿真流程模版评审',
  `approveAction` tinyint NOT NULL DEFAULT '0' COMMENT '评审动作 1：新增评审 2：修改评审',
  `approveContents` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '评审内容',
  `templateName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '评审流程模版名称',
  `templateId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '评审流程模版ID',
  `replyUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '状态通知URL',
  `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '评审描述',
  `tenantId` bigint DEFAULT NULL,
  `replyStatus` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '状态是否回复给调用模块 0：未回复 1：已回复',
  `userId` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '评审创建时间',
  `cidFlowId` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'cid审核电子流程id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=423 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_command_placeholder definition

CREATE TABLE `simulation_command_placeholder` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `keyEnName` varchar(255) NOT NULL COMMENT '占位符英文名称',
  `keyCnName` varchar(255) NOT NULL COMMENT '占位符中文名称',
  `valueType` varchar(50) NOT NULL COMMENT '占位符值的类型（file_exact_match:文件完全匹配；file_regex_match:文件正则匹配，hpc_file_select：Hpc节点文件选择，hpc_file_regex_match：Hpc节点目录正则，local_file_select：本地文件选择，custom_input：用户自定义输入值）',
  `creatorId` bigint DEFAULT NULL COMMENT '创建者ID',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updaterId` bigint DEFAULT NULL COMMENT '更新者ID',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_keyEnName` (`keyEnName`) COMMENT '占位符名称唯一约束'
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仿真工具命令占位符配置表';


-- spdm_baseline.simulation_data_dictionary definition

CREATE TABLE `simulation_data_dictionary` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '数据字段唯一ID',
  `dictName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '字典名称',
  `dictValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '字典值',
  `valueType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '字典值类型',
  `aliasName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '字典别名',
  `dictOrder` tinyint DEFAULT NULL COMMENT '排序序号',
  `dictClass` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '字典分类名称',
  `classType` varchar(255) DEFAULT NULL COMMENT '字典分类类型',
  `comment` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '描述信息',
  `tenantId` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  PRIMARY KEY (`id`,`uuid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=490 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_demand definition

CREATE TABLE `simulation_demand` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '需求的唯一标识',
  `demand_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '需求名称',
  `demand_code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '需求编码',
  `demand_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `sim_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `demand_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 'SVW' COMMENT '需求状态：未分配、未开始、进行中、暂停、已关闭、已闭环、已驳回',
  `achieve_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '达成情况',
  `progress` tinyint DEFAULT '0' COMMENT '进度',
  `approval_status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '审批状态',
  `begin_time` varchar(100) DEFAULT NULL COMMENT '计划开始实际',
  `end_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '' COMMENT '计划结束时间',
  `finish_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '实际结束时间',
  `project_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '项目名称',
  `phase_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '阶段名称',
  `node_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '学科名称',
  `tenant_id` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `loadcaseName` (`uuid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=192 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_demand_extra definition

CREATE TABLE `simulation_demand_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varbinary(255) DEFAULT NULL,
  `demand_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeId` varchar(255) DEFAULT NULL,
  `property_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `property_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `value_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `property_class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_demand_member definition

CREATE TABLE `simulation_demand_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `demand_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `type` tinyint DEFAULT NULL COMMENT '0：仿真负责人 1：仿真执行人',
  `identity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=183 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_dictionary_class definition

CREATE TABLE `simulation_dictionary_class` (
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '字典分类唯一ID',
  `className` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '分类名称',
  `classType` varchar(255) DEFAULT NULL COMMENT '分类类别',
  `titleName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '分类标题',
  `tenantId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属租户ID',
  `comment` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '描述信息',
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_file definition

CREATE TABLE `simulation_file` (
  `id` int NOT NULL,
  `fileName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `fileType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `fileSize` bigint DEFAULT NULL,
  `fileOwner` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `fileNodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `securityLevel` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `fileId` varchar(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `fileStatus` tinyint DEFAULT NULL,
  `tenantId` bigint DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_file_extra definition

CREATE TABLE `simulation_file_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `file_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `value_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_flow_instance definition

CREATE TABLE `simulation_flow_instance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '仿真流程实例唯一ID',
  `flowName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程实例名称',
  `templateName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属流程模版名称',
  `templateId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属流程模版UUID',
  `nodeId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属节点UUID',
  `nodeName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属节点名称',
  `taskId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属任务UUID',
  `taskName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属任务名称',
  `runId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属Run UUID',
  `runName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属Run名称',
  `flowStatus` tinyint NOT NULL DEFAULT '0' COMMENT '流程状态 0：未开始 1：进行中 2：已完成 3：异常',
  `workPath` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程工作路径',
  `currentPhase` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程当前阶段',
  `planEndTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '计划完成时间',
  `beginTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '开始时间',
  `endTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '结束时间',
  `tenantId` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '流程创建时间',
  PRIMARY KEY (`id`),
  KEY `runId` (`runId`),
  KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_flow_member definition

CREATE TABLE `simulation_flow_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `flowId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程UUID',
  `flowName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程名称',
  `memberName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '成员名称',
  `memberId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '成员Id',
  `role` tinyint NOT NULL DEFAULT '1' COMMENT '成员在流程中的角色',
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `flowId` (`flowId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_flow_node definition

CREATE TABLE `simulation_flow_node` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程节点唯一ID',
  `nodeName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程节点名称',
  `nodeId` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程引擎中的nodeId',
  `nodeType` tinyint DEFAULT NULL COMMENT '节点类型',
  `inputDirId` bigint DEFAULT NULL COMMENT '输入文件夹id',
  `outputDirId` bigint DEFAULT NULL COMMENT '输出文件夹id',
  `creator` bigint DEFAULT NULL COMMENT '创建人',
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updater` bigint DEFAULT NULL COMMENT '更新人',
  `updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `runId` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所属算例uuid',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=456 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='流程实例节点表';


-- spdm_baseline.simulation_flow_node_member definition

CREATE TABLE `simulation_flow_node_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `flowId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程UUID',
  `flowName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程名称',
  `nodeId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '节点uuid',
  `nodeName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '节点名称',
  `memberName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '成员名称',
  `memberId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '成员Id',
  `role` tinyint NOT NULL DEFAULT '1' COMMENT '成员在流程中的角色',
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `nodeId` (`nodeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_flow_template definition

CREATE TABLE `simulation_flow_template` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程模版唯一ID',
  `processDefinitionId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'flowable流程完成部署后的流程定义id',
  `templateName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程模版名称',
  `templateVersion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程模版版本',
  `templateContent` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '流程模版信息',
  `viewContent` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '流程模版显示信息',
  `parentUuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '集成父版本UUID',
  `templateStatus` tinyint NOT NULL DEFAULT '1' COMMENT '流程模版状态 0：禁用 1：启用',
  `templateCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '流程模版编码',
  `templateType` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程模版类型',
  `approveType` tinyint NOT NULL DEFAULT '0' COMMENT '流程模版审批状态 0：未审批 1：审批中 2：审批通过 3：审批未通过 ',
  `approveFlowId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程模版评审流ID',
  `comment` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '流程模版描述信息',
  `tenantId` bigint NOT NULL DEFAULT '0' COMMENT '租户ID',
  `updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `createName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者名称',
  `creator` bigint NOT NULL DEFAULT '0' COMMENT '模版创建者ID',
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '模版创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_job definition

CREATE TABLE `simulation_job` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID，自增',
  `jobName` varchar(255) NOT NULL COMMENT '计算任务名称',
  `coreNum` int DEFAULT NULL COMMENT '计算所需要核数',
  `software` varchar(100) DEFAULT NULL COMMENT '计算软件的名称',
  `jobType` varchar(255) DEFAULT NULL COMMENT '计算任务类型',
  `independence` tinyint(1) NOT NULL DEFAULT '0' COMMENT '计算任务是否独立存在 0：非独立任务 1：独立任务',
  `inputFiles` text COMMENT '求解文件（JSON格式存储文件UUID列表）',
  `masterFile` varchar(255) DEFAULT NULL COMMENT '计算主文件（文件UUID）',
  `taskId` varchar(64) DEFAULT NULL COMMENT '计算任务所属任务ID',
  `taskName` varchar(255) DEFAULT NULL COMMENT '计算任务所属任务名称',
  `runId` varchar(64) DEFAULT NULL COMMENT '计算任务所属算力ID',
  `runName` varchar(255) DEFAULT NULL COMMENT '计算任务所属算力名称',
  `softwareId` varchar(128) DEFAULT NULL COMMENT '使用软件的id',
  `inputFileId` bigint NOT NULL COMMENT '求解文件对应的文件Id',
  `jobId` varchar(255) DEFAULT NULL COMMENT '计算任务Id,job new 生成',
  `jobDetailId` varchar(255) DEFAULT NULL COMMENT '计算任务添加时Id,job add 生成',
  `stdoutHpcFilePath` varchar(512) DEFAULT NULL COMMENT '任务执行输出的文件在Hpc的绝对路径，共享目录+jobName（文件回传)+uuid，下面可能有多个文件',
  `stdoutSpdmMinoFilePath` varchar(1024) DEFAULT NULL COMMENT '任务执行输出的文件在 MinIO 上的路径（baseDir+jobName+uuid，可能包含多个文件）',
  `nodeName` varchar(256) NOT NULL DEFAULT '' COMMENT '节点名称',
  `executCommand` text COMMENT '记录最终执行的执行对应工具命令',
  `startTime` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '任务开始时间',
  `endTime` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '任务结束时间',
  `jobStatus` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '任务状态，spdm,+hpc返回的其他状态（定时任务维护）',
  `solverName` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '求解器名称',
  `totalKernelTime` bigint DEFAULT NULL COMMENT '总内核态时间（单位：毫秒）',
  `totalUserTime` bigint DEFAULT NULL COMMENT '总用户态时间（单位：毫秒）',
  `totalElapsedTime` bigint DEFAULT NULL COMMENT '作业耗费总秒数（单位：秒）',
  `uuid` varchar(64) DEFAULT NULL COMMENT '配置提交前端生成不带横线的uuid',
  `fileStatus` varchar(16) DEFAULT NULL COMMENT '任务结果回传状态，generating,uploading,finished',
  `creatorId` bigint DEFAULT NULL COMMENT '创建者ID',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updaterId` bigint DEFAULT NULL COMMENT '更新者ID',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `stdoutSpdmNasFilePath` varchar(1024) DEFAULT NULL COMMENT '任务执行输出的文件在 NAS 上的路径（baseDir+jobName+uuid，可能包含多个文件）',
  PRIMARY KEY (`id`),
  KEY `idx_task_id` (`taskId`) COMMENT '按所属任务ID查询',
  KEY `idx_run_id` (`runId`) COMMENT '按所属算力ID查询',
  KEY `idx_job_name` (`jobName`) COMMENT '按任务名称查询',
  KEY `idx_job_status` (`jobStatus`) COMMENT '按任务状态查询',
  KEY `idx_node_name` (`nodeName`) COMMENT '按节点名称查询'
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仿真计算任务表';


-- spdm_baseline.simulation_model definition

CREATE TABLE `simulation_model` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `model_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `file_id` int DEFAULT NULL,
  `parent_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_model_extra definition

CREATE TABLE `simulation_model_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `model_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `value_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_node definition

CREATE TABLE `simulation_node` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `ownRootNodeUuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属根节点uuid',
  `nodeName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `nodeCode` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `englishName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeSubType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeStatus` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `parentId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `folderId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeLevel` tinyint NOT NULL DEFAULT '0',
  `beginTime` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `endTime` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `finishTime` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `progress` tinyint DEFAULT '0',
  `achieveStatus` tinyint DEFAULT NULL,
  `nodeVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tenantId` bigint DEFAULT NULL,
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `detailImgUrl` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  `pid` int DEFAULT NULL,
  `exe_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '1',
  `tag1` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag3` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag4` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag5` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag6` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag7` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag8` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag9` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag10` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1363 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_node_extra definition

CREATE TABLE `simulation_node_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `propertyName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `propertyValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `valueType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `propertyClass` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_node_member definition

CREATE TABLE `simulation_node_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `identity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  `type` tinyint DEFAULT NULL COMMENT '0：仿真负责人 1：仿真执行人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_node_tree definition

CREATE TABLE `simulation_node_tree` (
  `id` int NOT NULL AUTO_INCREMENT,
  `node_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `node_level` tinyint NOT NULL,
  `node_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `node_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `pre_node_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `pre_node_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `pre_node_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `pre_node_level` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_node_versions definition

CREATE TABLE `simulation_node_versions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `parentVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `childVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `versionContents` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_parameter_library definition

CREATE TABLE `simulation_parameter_library` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键ID',
  `parameter_library_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '参数库名称',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `tenantId` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_library_name` (`parameter_library_name`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仿真参数库表';


-- spdm_baseline.simulation_parameter_library_category definition

CREATE TABLE `simulation_parameter_library_category` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键ID',
  `parameter_library_id` bigint NOT NULL COMMENT '参数库id',
  `parameter_library_category_name` varchar(100) NOT NULL COMMENT '参数库分类名称',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  KEY `idx_parameter_library_id` (`parameter_library_id`),
  KEY `idx_parameter_library_category_name` (`parameter_library_category_name`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仿真参数库分类表';


-- spdm_baseline.simulation_parameter_library_category_object definition

CREATE TABLE `simulation_parameter_library_category_object` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键ID',
  `parameter_library_id` bigint NOT NULL COMMENT '参数库id\r\n',
  `parameter_library_category_id` bigint NOT NULL COMMENT '参数分类id',
  `parameter_library_category_object_name` varchar(100) NOT NULL COMMENT '参数对象名',
  `file_id` bigint NOT NULL COMMENT '文件ID，关联file_metadata_info文件表id',
  `file_name` varchar(255) NOT NULL COMMENT '文件名',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  KEY `idx_parameter_library_id` (`parameter_library_id`),
  KEY `idx_parameter_library_category_id` (`parameter_library_category_id`),
  KEY `idx_parameter_library_category_object_name` (`parameter_library_category_object_name`),
  KEY `idx_file_id` (`file_id`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仿真参数库-参数对象表';


-- spdm_baseline.simulation_performance definition

CREATE TABLE `simulation_performance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `taskId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `runId` varchar(255) DEFAULT NULL COMMENT '算列runId',
  `performanceName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `englishName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeCode` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `performanceType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `targetValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `lowValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `highValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `method` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `completeStatus` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标完成情况  未完成 不合格，风险可控，未分析，合格',
  `resultValue` varchar(255) DEFAULT NULL COMMENT '计算及结果值',
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `taskName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `standard` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tenantId` bigint DEFAULT NULL,
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `pid` int DEFAULT NULL,
  `tag1` varchar(255) DEFAULT NULL,
  `tag2` varchar(255) DEFAULT NULL,
  `tag3` varchar(255) DEFAULT NULL,
  `tag4` varchar(255) DEFAULT NULL,
  `tag5` varchar(255) DEFAULT NULL,
  `tag6` varchar(255) DEFAULT NULL,
  `tag7` varchar(255) DEFAULT NULL,
  `tag8` varchar(255) DEFAULT NULL,
  `tag9` varchar(255) DEFAULT NULL,
  `tag10` varchar(255) DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `updater` bigint DEFAULT NULL,
  `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1218 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_performance_extra definition

CREATE TABLE `simulation_performance_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `performanceId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `taskId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `propertyName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `propertyValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `valueType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `propertyClass` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_pool definition

CREATE TABLE `simulation_pool` (
  `id` int NOT NULL AUTO_INCREMENT,
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '分析项库名称',
  `currentVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '分析项库当前版本',
  `parentVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '当前版本的父版本',
  `comment` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '描述信息',
  `tenantId` bigint DEFAULT '0',
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_pool_node definition

CREATE TABLE `simulation_pool_node` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '节点唯一标识ID',
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属分析项库名称',
  `nodeName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '节点名称',
  `nodeCode` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '节点编码',
  `englishName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '节点英文名称',
  `nodeType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '节点类型，如：项目节点，阶段节点等',
  `nodeSubType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '节点子类型，类型下再细分的类型',
  `parentId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属父节点的UUID',
  `nodeLevel` tinyint NOT NULL DEFAULT '0' COMMENT '节点在分析项库树结构中的层级',
  `nodeOrder` tinyint DEFAULT NULL COMMENT '节点在兄弟节点中的位置',
  `poolVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '节点所属分析项库',
  `tenantId` bigint DEFAULT NULL,
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '节点描述信息',
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '节点创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uuid` (`uuid`),
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=577 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_pool_node_extra definition

CREATE TABLE `simulation_pool_node_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '节点附加属性唯一ID',
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性所属节点UUID',
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性所属分析项库名称',
  `propertyName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性名称',
  `propertyValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性具体值',
  `valueType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性数据类型，（int，string，float等）',
  `propertyClass` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '附加属性所属分类',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `nodeId` (`nodeId`),
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=850 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_pool_performance definition

CREATE TABLE `simulation_pool_performance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '指标唯一ID',
  `taskId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '指标所属任务UUID',
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标所属节点UUID',
  `nodeName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标所属节点名称',
  `englishName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标英文名称',
  `nodeCode` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标所属节点编码',
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标所属分析项库名称',
  `performanceType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标类型',
  `unit` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标单位',
  `lowValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '最小值',
  `highValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '最大值',
  `method` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标判定方法',
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '描述信息',
  `taskName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标所属分析项名称',
  `standard` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '指标遵循标准',
  `tenantId` bigint DEFAULT NULL,
  `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uuid` (`uuid`),
  KEY `taskId` (`taskId`),
  KEY `nodeId` (`nodeId`),
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=645 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_pool_performance_extra definition

CREATE TABLE `simulation_pool_performance_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性唯一ID',
  `performanceId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属指标UUID',
  `taskId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属分析项UUID',
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属节点UUID',
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属分析项库名称',
  `propertyName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性名称',
  `propertyValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性值',
  `valueType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性值类型',
  `propertyClass` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '附加属性所属分类',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uuid` (`uuid`),
  KEY `performanceId` (`performanceId`),
  KEY `taskId` (`taskId`),
  KEY `nodeId` (`nodeId`),
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=1168 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_pool_task definition

CREATE TABLE `simulation_pool_task` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '分析项唯一ID',
  `nodeName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属节点名称',
  `englishName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '英文名称',
  `nodeCode` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '节点编码',
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT ' ' COMMENT '所属分析项库名称',
  `poolVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属分析项库版本',
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '0' COMMENT '所属节点UUID',
  `days` int NOT NULL DEFAULT '0' COMMENT '预估的工作周期',
  `standard` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ' ' COMMENT '参照的标准',
  `flowTemplate` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '流程模版名称',
  `analyseTarget` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '分析目标描述',
  `confidence` float DEFAULT NULL COMMENT '置信度',
  `analyseSoftware` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '涉及的分析软件',
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '描述',
  `difficult` float(30,0) NOT NULL COMMENT '难度系数',
  `imageFileId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '' COMMENT '图片文件id',
  `bCapacity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '是否具备分析能力',
  `department` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属部门',
  `section` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属科室',
  `group` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属组',
  `tenantId` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uuid` (`uuid`),
  KEY `nodeId` (`nodeId`),
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=79634 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_pool_task_extra definition

CREATE TABLE `simulation_pool_task_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '附加属性唯一ID',
  `taskId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属分析项UUID',
  `nodeId` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属节点UUID',
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '所属分析库名称',
  `propertyName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '属性名称',
  `propertyValue` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '属性值',
  `valueType` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '属性值类型',
  `propertyClass` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '属性分类',
  PRIMARY KEY (`id`,`uuid` DESC) USING BTREE,
  KEY `uuid` (`uuid`),
  KEY `taskId` (`taskId`),
  KEY `nodeId` (`nodeId`),
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=819 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_pool_versions definition

CREATE TABLE `simulation_pool_versions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `poolName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '分析项库名称',
  `poolVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '分析项库版本号',
  `parentVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属父版本版本号',
  `childVersion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '所属子版本版本号',
  `versionContents` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '版本内容（JSON字符串）',
  `poolId` int DEFAULT '0' COMMENT '分析项库ID',
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `poolName` (`poolName`)
) ENGINE=InnoDB AUTO_INCREMENT=215 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_run definition

CREATE TABLE `simulation_run` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `runName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `type` tinyint DEFAULT '1' COMMENT '1:server 2:pbs 3:local only',
  `taskId` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `flowTemplate` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '流程模板id',
  `status` tinyint DEFAULT '0' COMMENT 'Run状态 0:未执行 1：执行中 2：完成 3：失败',
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ' ' COMMENT 'run描述信息（算例说明）',
  `totalStep` int DEFAULT '0' COMMENT 'Run总共的流程步骤',
  `currentStep` int DEFAULT '0' COMMENT '当前的步骤（第几步）',
  `currentStepName` varchar(120) DEFAULT NULL COMMENT '当前的步骤名称',
  `achieveStatus` tinyint DEFAULT '0' COMMENT 'Run执行结果  0:gray 1:red 2:yellow 3:green',
  `folderId` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Run对应在文件系统中的路径',
  `parentId` varchar(120) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '父算例ID',
  `isPersonalTemplate` int DEFAULT NULL,
  `tenantId` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'run创建时间',
  `updater` bigint DEFAULT NULL,
  `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `englishName` varchar(120) DEFAULT NULL COMMENT '英文名',
  `processDefinitionId` varchar(120) DEFAULT NULL COMMENT 'flowable流程完成部署后的流程定义id，根据这个发起流程实例',
  `flowInstanceId` varchar(120) DEFAULT NULL COMMENT '流程实例id（流程引擎返回的）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_run_extra definition

CREATE TABLE `simulation_run_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `value_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `property_class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_run_key_result definition

CREATE TABLE `simulation_run_key_result` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '关键结果唯一ID',
  `runId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '所属Run UUID',
  `keyResultType` int DEFAULT NULL COMMENT '关键性能结果类型 1-图片/动画 2-曲线 3-报告 4-数值',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '结果名称',
  `fileId` bigint DEFAULT NULL COMMENT '关联文件id',
  `quantityType` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '物理量类型',
  `units` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '结果单位',
  `max` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最大数值',
  `min` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最小数值',
  `value` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '数值',
  `description` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '描述信息',
  `xQuantityType` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'x轴物理量（曲线结果使用）',
  `xUnits` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'x轴结果单位（曲线结果使用）',
  `yQuantityType` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'y轴物理量（曲线结果使用）',
  `yUnits` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'y轴结果单位（曲线结果使用）',
  `creator` bigint NOT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updater` bigint NOT NULL,
  `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `simulation_key_result_image_uuid_IDX` (`uuid`) USING BTREE,
  KEY `simulation_key_result_image_runId_IDX` (`runId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='任务执行-图片/动画/数值/文件关键性能结果';


-- spdm_baseline.simulation_run_member definition

CREATE TABLE `simulation_run_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `run_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `identity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_soft_config definition

CREATE TABLE `simulation_soft_config` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `softName` varchar(255) NOT NULL COMMENT '软件名称',
  `softVersion` varchar(32) NOT NULL COMMENT '软件版本号',
  `functionDsc` varchar(255) DEFAULT NULL COMMENT '功能描述（如：电池仿真）',
  `command` text NOT NULL COMMENT '功能对应的CMD命令',
  `creatorId` bigint DEFAULT NULL COMMENT '创建者ID',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updaterId` bigint DEFAULT NULL COMMENT '更新者ID',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  KEY `idx_soft_name` (`softName`) COMMENT '按软件名称查询',
  KEY `idx_soft_function` (`softName`,`functionDsc`) COMMENT '按软件名称+功能联合查询'
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仿真软件命令配置表';


-- spdm_baseline.simulation_task definition

CREATE TABLE `simulation_task` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'loadcase名称',
  `task_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'loadcase所属学科名称',
  `task_code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `task_pool_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'loadcase 库名称',
  `task_pool_version` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `node_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '0' COMMENT 'task所属节点Id，0表示不从属任何节点',
  `days` int DEFAULT '0' COMMENT 'loadcase预估的工作周期',
  `real_days` int DEFAULT NULL,
  `standard` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'loadcase参照的标准',
  `fold_id` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
  `status` tinyint NOT NULL DEFAULT '3' COMMENT 'loadcase当前状态 1:red 2:yellow 3:grey  4:green',
  `achieve_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `begin_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '' COMMENT 'loadcase开始时间',
  `end_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '' COMMENT 'loadcase执行结束时间',
  `finish_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `progress` tinyint NOT NULL DEFAULT '0' COMMENT 'loadcase进度',
  `exe_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'SVW' COMMENT '上汽大众：SVW 德国大众：VW',
  `confidence` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '置信度',
  `analyse_target` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `analyse_software` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '分析软件',
  `approval_status` int DEFAULT NULL COMMENT '1-进行中 2-评审通过 3-评审驳回',
  `comfirm_status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `description` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `difficult` float(30,0) DEFAULT NULL,
  `tenant_Id` bigint DEFAULT NULL,
  `pid` int DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  `department` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '部门',
  `sectionName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '科',
  `groupName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '组',
  `bCapacity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '仿真能力',
  `flowTemplate` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '任务流程模板',
  `englishName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `demand_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '关联的需求id',
  `tag1` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag3` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag4` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag5` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag6` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag7` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag8` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag9` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tag10` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `cidFlowId` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '关联cid交付物审批流程id',
  `imageFileId` bigint DEFAULT NULL COMMENT '3D图示的文件id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `loadcaseName` (`uuid`) USING BTREE,
  KEY `fk_loadcase_nodeId` (`node_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=723 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- spdm_baseline.simulation_task_attention definition

CREATE TABLE `simulation_task_attention` (
  `id` int NOT NULL AUTO_INCREMENT,
  `task_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `identity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_task_extra definition

CREATE TABLE `simulation_task_extra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varbinary(255) DEFAULT NULL,
  `task_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `nodeId` varchar(255) DEFAULT NULL,
  `property_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `property_value` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `value_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `property_class` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_task_member definition

CREATE TABLE `simulation_task_member` (
  `id` int NOT NULL AUTO_INCREMENT,
  `task_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `identity` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '',
  `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `create_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建时间',
  `updater` bigint DEFAULT NULL,
  `update_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '更新时间',
  `type` tinyint DEFAULT NULL COMMENT '0：仿真负责人 1：仿真执行人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.simulation_taskpool_flowtemplate_relate definition

CREATE TABLE `simulation_taskpool_flowtemplate_relate` (
  `id` int NOT NULL AUTO_INCREMENT,
  `poolName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分析项库名称',
  `version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分析项库版本',
  `taskUuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务ID',
  `flowCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '流程模版编号',
  `tenantId` bigint DEFAULT '0' COMMENT '租户ID',
  `creator` bigint NOT NULL DEFAULT '0' COMMENT '创建人ID',
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.simulation_taskpool_standard_relate definition

CREATE TABLE `simulation_taskpool_standard_relate` (
  `id` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- spdm_baseline.sys_role definition

CREATE TABLE `sys_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID',
  `roleCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '角色编码（系统唯一）',
  `roleName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '角色名称',
  `description` varchar(500) DEFAULT NULL COMMENT '角色描述',
  `tenantId` bigint DEFAULT '0' COMMENT '所属租户ID（0为系统租户）',
  `isDeleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除标识（0=正常，1=删除）',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_tenant_role_code` (`tenantId`,`roleCode`),
  KEY `idx_tenant_id` (`tenantId`),
  KEY `idx_role_name` (`roleName`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统角色表（用于权限控制）';


-- spdm_baseline.sys_tenant definition

CREATE TABLE `sys_tenant` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '租户ID',
  `tenantCode` varchar(64) NOT NULL COMMENT '租户编码',
  `contactUserName` varchar(128) DEFAULT NULL COMMENT '联系人姓名',
  `contactPhone` varchar(20) DEFAULT NULL COMMENT '联系电话',
  `companyName` varchar(255) NOT NULL COMMENT '公司名称',
  `licenseNumber` varchar(128) DEFAULT NULL COMMENT '营业执照编号',
  `address` text COMMENT '地址',
  `description` text COMMENT '描述信息',
  `startTime` varchar(32) DEFAULT NULL COMMENT '开始时间',
  `endTime` varchar(32) DEFAULT NULL COMMENT '结束时间',
  `status` tinyint(1) DEFAULT '1' COMMENT '租户状态（1:正常、0:禁用）',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_code` (`tenantCode`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='租户信息表';


-- spdm_baseline.sys_user definition

CREATE TABLE `sys_user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID（自增，唯一标识用户记录）',
  `username` varchar(50) DEFAULT NULL COMMENT '用户名（登录或展示用，可选，建议唯一）',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机号（需符合手机号格式，可选，建议唯一）',
  `nickname` varchar(50) DEFAULT NULL COMMENT '用户昵称（展示用，可选）',
  `avatar` int DEFAULT NULL COMMENT '头像URL（存储头像图片的网络地址或本地路径，可选）',
  `password` varchar(100) DEFAULT NULL COMMENT '密码（存储加密后的密码，如MD5、BCrypt加密结果，可选）',
  `salt` varchar(50) DEFAULT NULL COMMENT '盐值（用于密码加密的随机字符串，与password配套使用，可选）',
  `email` varchar(100) DEFAULT NULL COMMENT '个人电子邮箱（需符合邮箱格式，可选，建议唯一）',
  `status` tinyint(1) DEFAULT '1' COMMENT '用户状态（1:正常、0:禁用）',
  `id_card` varchar(18) DEFAULT NULL COMMENT '身份证号（18位，符合身份证格式，可选，建议唯一）',
  `real_name` varchar(50) DEFAULT NULL COMMENT '真实姓名（用户真实身份信息，可选）',
  `birth_province` varchar(50) DEFAULT NULL COMMENT '出生省份（如“广东省”，可选）',
  `birth_city` varchar(50) DEFAULT NULL COMMENT '出生城市（如“深圳市”，可选）',
  `birth_date` date DEFAULT NULL COMMENT '出生日期（存储格式为YYYY-MM-DD，可选）',
  `sex` tinyint(1) DEFAULT '0' COMMENT '性别（0-未知，1-男性，2-女性；默认值为0）',
  `no_sys_staff` tinyint(1) DEFAULT '0' COMMENT '是否有员工账号（0-无，1-有；布尔类型映射为tinyint，默认0）',
  `tenant_id` bigint DEFAULT NULL COMMENT '用户所属租户ID（多租户场景下的租户标识，可选）',
  `tenant_name` varchar(100) DEFAULT NULL COMMENT '用户所属租户名称（多租户场景下的租户名称，可选）',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间（默认取当前时间，无需手动插入）',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '记录更新时间（每次更新数据时自动刷新）',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_phone` (`phone`) USING BTREE COMMENT '手机号唯一索引（避免同一手机号重复注册）',
  UNIQUE KEY `uk_email` (`email`) USING BTREE COMMENT '邮箱唯一索引（避免同一邮箱重复注册）',
  UNIQUE KEY `uk_id_card` (`id_card`) USING BTREE COMMENT '身份证号唯一索引（避免同一身份证重复绑定）',
  KEY `idx_tenant_id` (`tenant_id`) USING BTREE COMMENT '租户ID普通索引（多租户场景下查询优化）',
  KEY `idx_status` (`status`) USING BTREE COMMENT '用户状态普通索引（按状态筛选用户时优化）'
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户信息表（存储用户基本信息、账号状态、租户关联等数据）';


-- spdm_baseline.sys_user_group definition

CREATE TABLE `sys_user_group` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '组唯一标识ID',
  `groupName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '组名',
  `description` varchar(100) DEFAULT NULL COMMENT '组描述',
  `createdTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_group_name` (`groupName`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户组表';


-- spdm_baseline.sys_user_group_relation definition

CREATE TABLE `sys_user_group_relation` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `userId` bigint NOT NULL COMMENT '用户ID（关联用户表）',
  `groupId` bigint NOT NULL COMMENT '用户组ID（关联用户组表）',
  `role` tinyint NOT NULL DEFAULT '0' COMMENT '角色在用户组的角色（0-普通成员，1-管理员）',
  `joinTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '加入时间',
  `status` tinyint(1) DEFAULT '1' COMMENT '用户状态（1:正常、0:禁用）',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_user_group` (`userId`,`groupId`),
  KEY `idx_user_id` (`userId`),
  KEY `idx_group_id` (`groupId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户与用户组的关联表';


-- spdm_baseline.sys_user_role_relation definition

CREATE TABLE `sys_user_role_relation` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '关联记录主键ID',
  `user_id` bigint NOT NULL COMMENT '用户ID（关联用户表主键）',
  `role_id` bigint NOT NULL COMMENT '角色ID（关联角色表主键）',
  `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '关联关系创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_user_role` (`user_id`,`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关联表';


-- spdm_baseline.system_form_configure definition

CREATE TABLE `system_form_configure` (
  `id` int NOT NULL AUTO_INCREMENT,
  `formName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '表单名称',
  `formConfig` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '表单配置信息',
  `comment` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '描述信息',
  `tenantId` bigint DEFAULT NULL,
  `creator` bigint DEFAULT NULL,
  `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=290 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;


-- spdm_baseline.training_model definition

CREATE TABLE `training_model` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录唯一ID',
  `modelName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模型名称',
  `algorithmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '算法类型',
  `trainer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '训练人',
  `handleStatus` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '待开始' COMMENT '数据处理状态（待开始/处理中/成功/失败）',
  `trainingStatus` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '待开始' COMMENT '训练状态（待开始/训练中/成功/失败）',
  `predStatus` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '待开始' COMMENT '预测状态（待开始/预测中/成功/失败）\r\n',
  `trainingDataFileId` bigint DEFAULT NULL COMMENT '原始训练数据文件id',
  `trainingDataFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '原始训练数据文件名',
  `trainingDataHandleFileId` bigint DEFAULT NULL COMMENT 'handle脚本训练数据处理结果文件id',
  `trainingDataHandleErrorLogFileId` bigint DEFAULT NULL COMMENT 'handle脚本训练脚本错误日志文件id',
  `trainingTime` datetime DEFAULT NULL COMMENT '训练开始时间',
  `trainingDuration` int DEFAULT NULL COMMENT '训练耗时（单位：毫秒）',
  `normalizerMax` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'handle脚本训练数据归一化最大值',
  `normalizerMin` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'handle脚本训练数据归一化最小值',
  `inputSize` int DEFAULT NULL COMMENT '特征输入列数量',
  `inputLabel` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '输入列的json格式',
  `outputSize` int DEFAULT NULL COMMENT '特征输出列数量',
  `outputLabel` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '输出列的JSON格式',
  `trainingDataResultFileId` bigint DEFAULT NULL COMMENT 'training脚本处理数据结果文件id',
  `trainingDataLogFileId` bigint DEFAULT NULL COMMENT 'training脚本处理日志文件id',
  `trainingDataExportModelFileId` bigint DEFAULT NULL COMMENT 'training脚本处理后模型文件id',
  `trainingDataErrorLogFileId` bigint DEFAULT NULL COMMENT 'training训练脚本错误日志文件id',
  `algorithmUsed` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用算法',
  `inputPredLabelValue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '预测使用---输入的列-值的json格式',
  `outputPredLabelValue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '预测使用---输出的列-值的json格式',
  `predErrorLogFileId` bigint DEFAULT NULL COMMENT '预测脚本错误日志',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '说明',
  `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `creator` bigint DEFAULT NULL,
  `tenantId` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='训练模型基础信息表，存储模型训练的核心属性及关联数据';


-- spdm_baseline.training_model_algorithm_param definition

CREATE TABLE `training_model_algorithm_param` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '参数记录唯一ID',
  `modelId` bigint DEFAULT NULL COMMENT '关联的模型ID（关联training_model表的id）',
  `algorithm` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '算法类型（如：多项式拟合）',
  `activateFun` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '激活函数（如：sigmod）',
  `lossFun` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '损失函数（如：l1）',
  `optimizeFun` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优化函数（如：sgd）',
  `exportFormat` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '导出格式（如：.onnx）',
  `trainingRatio` int DEFAULT NULL COMMENT '训练集比例(百分比)（如：80）',
  `loadSize` int DEFAULT NULL COMMENT '加载大小（如：32）',
  `studyPercent` decimal(10,6) DEFAULT NULL COMMENT '学习率（如：0.001）',
  `stepCounts` int DEFAULT NULL COMMENT '步数（如：3）',
  `roundPrint` int DEFAULT NULL COMMENT '轮次打印间隔（如：11）',
  `round` int DEFAULT NULL COMMENT '总轮次（如：1001）',
  `preDisposeData` tinyint(1) DEFAULT NULL COMMENT '是否预处理数据（如：false）',
  `disposeMethod` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '数据处理方法（如：minmax）',
  `dataNoOrder` tinyint(1) DEFAULT NULL COMMENT '数据是否无序（如：false）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='算法参数表，存储模型训练时的各类算法配置参数';