CREATE TABLE `devops_business`  (
  `business_id` bigint NOT NULL COMMENT '业务id',
  `business_category_id` bigint NOT NULL COMMENT '业务所属分类id',
  `business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务名称',
  `business_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务编码',
  `system_code` int NOT NULL COMMENT '系统编码，这里用十进制存储',
  `system_code_show` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '系统编码，用于展示，展示的时候是8位10进制的字符串，例如展示的时候可能显示：#A00000000',
  `business_icon_type` int NULL DEFAULT NULL COMMENT '图标类型：1-文件id，2-选择图片',
  `business_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标编码',
  `business_icon_file_id` bigint NULL DEFAULT NULL COMMENT '图标文件id',
  `fld_sort` decimal(20, 2) NULL DEFAULT NULL COMMENT '排序',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记：Y-已删除，N-未删除',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '更新人',
  `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`business_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '业务' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_business_category`  (
  `business_category_id` bigint NOT NULL COMMENT '业务分类id',
  `category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
  `category_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类编码',
  `fld_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记：Y-已删除，N-未删除',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '更新人',
  `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`business_category_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '业务分类' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_business_diagram`  (
  `diagram_id` bigint NOT NULL COMMENT '业务流程图id',
  `business_id` bigint NOT NULL COMMENT '所属业务id',
  `diagram_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图纸名称',
  `system_code` int NOT NULL COMMENT '系统编码，这里用十进制存储',
  `system_code_show` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '系统编码，用于展示，展示的时候是8位10进制的字符串，例如展示的时候可能显示：#A00000000',
  `diagram_file_id` bigint NULL DEFAULT NULL COMMENT '图纸缩略图文件id',
  `diagram_content` json NULL COMMENT '流程图的具体配置json',
  `fld_sort` decimal(20, 2) NULL DEFAULT NULL COMMENT '排序',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记：Y-已删除，N-未删除',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '更新人',
  `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`diagram_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '业务流程图' ROW_FORMAT = Dynamic;