CREATE TABLE `devops_form_component`  (
  `component_id` bigint NOT NULL COMMENT '表单组件id',
  `component_category_id` bigint NOT NULL COMMENT '表单组件分类id',
  `component_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单组件名称',
  `component_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单组件编码',
  `component_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组件图标，来自iconfont',
  `mobile_enable_flag` tinyint NULL DEFAULT 0 COMMENT '启用移动端：1-开启，0-不开启',
  `code_generator_flag` tinyint NULL DEFAULT 0 COMMENT '启用代码生成：1-开启，0-不开启',
  `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 '更新人',
  PRIMARY KEY (`component_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '表单组件' ROW_FORMAT = Dynamic;

INSERT INTO `devops_form_component` VALUES (1698947817889116161, 1698947502288687106, '单行文本', 'input', 'iform-danhangwenben', 1, 1, 10.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947826344833025, 1698947502288687106, '多行文本', 'textarea', 'iform-duohangwenben', 1, 1, 11.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947826344833136, 1698947502288687106, '数字', 'number', 'iform-shuzi', 1, 1, 12.00, NULL, 'N', '2023-10-26 17:31:51', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947836964810754, 1698947502288687106, '密码框', 'password', 'iform-mimakuang', 0, 1, 20.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947849719689218, 1698947502288687106, '下拉框', 'select', 'iform-xialadanxuan', 1, 1, 30.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947849719689329, 1698947502288687106, '单选框', 'radio', 'iform-danxuan', 1, 1, 31.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947849719689430, 1698947502288687106, '复选框', 'checkbox', 'iform-fuxuan', 1, 1, 32.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947849719689541, 1698947502288687106, '滑动开关', 'switch', 'iform-huadong', 0, 1, 33.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947860478078977, 1698947502288687106, '日期', 'date', 'iform-riqi', 1, 1, 40.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947917747105793, 1698947502288687106, '时间', 'time', 'iform-shijian', 1, 1, 50.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947958104698882, 1698947502288687106, '日期+时间', 'datetime', 'iform-riqishijian', 1, 1, 60.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698947979390791681, 1698947502288687106, '手机号', 'phone', 'iform-shoujihao', 0, 1, 70.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948028279599106, 1698947502288687106, '邮箱', 'email', 'iform-youxiang', 0, 1, 80.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948111653974018, 1698947502288687106, '身份证号', 'idcard', 'iform-shenfenzhenghao', 0, 1, 90.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948145720111105, 1698947502288687106, '上传文件', 'upload', 'iform-shangchuanwenjian', 1, 1, 100.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948201256890369, 1698947502288687106, '上传图片', 'upload-pic', 'iform-shangchuantupian', 1, 1, 110.00, NULL, 'N', '2023-09-05 14:35:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948235436273665, 1698947502288687126, '人员选择', 'select-user', 'iform-renyuanxuanze', 1, 1, 10.00, NULL, 'N', '2023-09-05 14:40:24', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948252414816257, 1698947502288687126, '机构选择', 'select-org', 'iform-jigouxuanze', 1, 1, 20.00, NULL, 'N', '2023-09-05 14:40:24', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948371642101762, 1698947502288687126, '职位选择', 'select-position', 'iform-zhiweixuanze', 0, 1, 30.00, NULL, 'N', '2023-09-05 14:40:24', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948371642101770, 1698947502288687126, '机构人员', 'org-user', 'iform-org-user', 0, 1, 35.00, NULL, 'N', '2024-01-26 16:55:09', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1698948371642101790, 1698947502288687126, '视图选择', 'view-select', 'iform-view-select', 0, 0, 40.00, NULL, 'N', '2024-01-29 16:02:32', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1729060557981179909, 1729060557981179906, '表格', 'table', 'iform-table', 1, 0, 10.00, NULL, 'N', '2023-11-27 16:53:03', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169514498, 1730771201415671809, '标题组件', 'title', 'iform-title', 0, 0, 20.00, NULL, 'N', '2023-12-02 10:11:07', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169514550, 1730771201415671809, '分割线', 'divide-line', 'iform-divide-line', 0, 0, 25.00, NULL, 'N', '2024-01-31 14:13:44', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169514655, 1730771201415671809, '折叠面板', 'collapse', 'iform-collapse', 0, 0, 30.00, NULL, 'N', '2024-02-19 17:47:15', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169515599, 1729060557981179906, '省市联动', 'city', 'iform-city', 0, 1, 20.00, NULL, 'N', '2023-12-08 09:03:40', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169515650, 1729060557981179906, '地图选择', 'map', 'iform-map', 0, 1, 35.00, NULL, 'N', '2024-01-26 16:55:39', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169515700, 1729060557981179906, '自定义下拉', 'custom-select', 'iform-custom-select', 0, 1, 40.00, NULL, 'N', '2024-01-26 16:55:39', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169515850, 1729060557981179906, '树形下拉', 'tree-select', 'iform-tree-select', 0, 1, 45.00, NULL, 'N', '2024-01-26 16:55:39', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169515900, 1729060557981179906, '级联选择', 'link-select', 'iform-link-select', 0, 0, 50.00, NULL, 'N', '2024-01-31 14:08:09', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1730771561169515950, 1729060557981179906, '纯文本', 'pure-text', 'iform-pure-text', 0, 0, 55.00, NULL, 'N', '2024-01-31 14:09:01', NULL, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1767791819107627009, 1729060557981179906, 'JSON', 'json', 'iform-pure-text', 0, 0, 60.00, 3, 'N', '2024-03-13 13:56:28', 1339550467939639299, '2024-03-13 16:16:47', 1339550467939639299);
INSERT INTO `devops_form_component` VALUES (1767805889441456130, 1698947502288687106, '进度条', 'progress', 'iform-xialadanxuan', 0, 1, 120.00, 1, 'N', '2024-03-13 14:52:23', 1339550467939639299, '2024-03-13 14:52:36', 1339550467939639299);
INSERT INTO `devops_form_component` VALUES (1767825312755769346, 1729060557981179906, '树形控件', 'tree', 'iform-tree-select', 0, 0, 70.00, 0, 'N', '2024-03-13 16:09:34', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1767859910386671618, 1729060557981179906, '步骤条', 'step', 'iform-table', 0, 0, 80.00, 0, 'N', '2024-03-13 18:27:03', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768096673873121282, 1729060557981179906, '轮播图', 'carousel', 'iform-custom-select', 0, 0, 90.00, 0, 'N', '2024-03-14 10:07:51', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768155256992055298, 1729060557981179906, '面包屑', 'breadcrumb', 'iform-shuzi', 0, 0, 100.00, 0, 'N', '2024-03-14 14:00:39', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768172129431371778, 1729060557981179906, '穿梭框', 'transfer', 'iform-org-user', 0, 0, 110.00, 0, 'N', '2024-03-14 15:07:41', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768461557672493057, 1698947502288687126, '角色选择', 'select-role', 'iform-renyuanxuanze', 0, 1, 31.00, 0, 'N', '2024-03-15 10:17:46', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768465882251575297, 1698947502288687126, '字典选择', 'select-dict', 'iform-pure-text', 0, 1, 32.00, 0, 'N', '2024-03-15 10:34:57', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768473134165442562, 1698947502288687106, '日期范围', 'date-range', 'iform-riqi', 0, 1, 65.00, 0, 'N', '2024-03-15 11:03:46', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768480833536049154, 1768480697531547649, '仪表盘', 'dashboard', 'iform-collapse', 0, 0, 10.00, 0, 'N', '2024-03-15 11:34:22', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768534496933625857, 1768480697531547649, '雷达图', 'radar', 'iform-collapse', 0, 0, 20.00, 0, 'N', '2024-03-15 15:07:37', 1339550467939639299, NULL, NULL);
INSERT INTO `devops_form_component` VALUES (1768555007298289665, 1698947502288687126, '弹框选择', 'select-modal', 'iform-custom-select', 0, 0, 50.00, 1, 'N', '2024-03-15 16:29:07', 1339550467939639299, '2024-03-15 16:29:13', 1339550467939639299);
INSERT INTO `devops_form_component` VALUES (1768821968808755202, 1729060557981179906, '弹框提示', 'modal-prompt', 'iform-collapse', 0, 0, 120.00, 0, 'N', '2024-03-16 10:09:55', 1339550467939639299, NULL, NULL);

CREATE TABLE `devops_form_component_category`  (
  `component_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 '更新人',
  PRIMARY KEY (`component_category_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '表单组件分类' ROW_FORMAT = Dynamic;

INSERT INTO `devops_form_component_category` VALUES (1698947502288687106, '基本组件', 'BASE', 10.00, NULL, 'N', '2023-09-05 14:34:04', NULL, NULL, NULL);
INSERT INTO `devops_form_component_category` VALUES (1698947502288687126, '业务组件', 'BUSINESS', 20.00, NULL, 'N', '2023-09-05 14:34:27', NULL, NULL, NULL);
INSERT INTO `devops_form_component_category` VALUES (1729060557981179906, '高级组件', 'ADVANCED', 30.00, NULL, 'N', '2023-11-27 16:52:31', NULL, NULL, NULL);
INSERT INTO `devops_form_component_category` VALUES (1730771201415671809, '内容分割', 'CONTENT', 40.00, NULL, 'N', '2023-12-02 10:10:43', NULL, NULL, NULL);
INSERT INTO `devops_form_component_category` VALUES (1768480697531547649, 'echarts图表', 'echarts', 50.00, 0, 'N', '2024-03-15 11:33:50', 1339550467939639299, NULL, NULL);

CREATE TABLE `devops_form_definition`  (
  `form_definition_id` bigint NOT NULL COMMENT '表单定义id',
  `business_category_id` bigint NOT NULL COMMENT '所属业务分类id',
  `business_id` bigint NOT NULL COMMENT '所属业务id',
  `form_model_id` bigint NOT NULL COMMENT '所属表单模型id',
  `fld_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型定义的版本号，例如：1.0',
  `form_config` json NULL COMMENT 'PC端-表单配置的JSON',
  `mobile_form_config` json NULL COMMENT '移动端-表单配置的JSON',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' 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 1 COMMENT '租户id',
  PRIMARY KEY (`form_definition_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '表单-定义' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_form_model`  (
  `form_model_id` bigint NOT NULL COMMENT '模型id',
  `business_category_id` bigint NOT NULL COMMENT '所属业务分类id',
  `business_id` bigint NOT NULL COMMENT '所属业务id',
  `form_model_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型名称',
  `form_model_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型编码',
  `system_code` int NOT NULL COMMENT '系统编码，这里用十进制存储，但是展示的时候是3位36进制的字符串',
  `system_code_show` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '系统编码，用于展示',
  `current_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'v1.0' COMMENT '当前版本号，默认1.0',
  `current_definition_id` bigint NULL DEFAULT NULL COMMENT '当前的模型定义id',
  `description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目描述',
  `flow_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否是流程表单：Y-是，N-否',
  `fld_sort` decimal(10, 2) NULL DEFAULT 1000.00 COMMENT '排序',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' 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 (`form_model_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '表单-模型' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_form_template`  (
  `id` bigint NOT NULL COMMENT '主键id',
  `template_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单模板的名称',
  `template_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单模板的编码',
  `template_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '表单模板排序',
  `form_config` json NULL COMMENT 'PC端-表单配置的JSON',
  `mobile_form_config` json NULL COMMENT '移动端-表单配置的JSON',
  `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 (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '表单模板' ROW_FORMAT = Dynamic;