DROP TABLE IF EXISTS `xjr_code_schema`;
CREATE TABLE `xjr_code_schema`  (
    `id` bigint NOT NULL COMMENT '主键',
    `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
    `type` int NULL DEFAULT NULL COMMENT '类型（0-数据优先模板,1-界面优先模板,2-简易模板）',
    `category` bigint NULL DEFAULT NULL COMMENT '分类（关联数据字典）',
    `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
    `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人主键',
    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
    `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人主键',
    `delete_mark` int NULL DEFAULT NULL COMMENT '删除标记',
    `enabled_mark` int NULL DEFAULT NULL COMMENT '有效标记',
    `status` int NULL DEFAULT NULL COMMENT '模板状态（0-草稿，1-正式）',
    `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '功能描述',
    `form_id` bigint NULL DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码模板' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for xjr_workflow_draft
-- ----------------------------
DROP TABLE IF EXISTS `xjr_workflow_draft`;
CREATE TABLE `xjr_workflow_draft`  (
   `id` bigint NOT NULL,
   `schema_id` bigint NULL DEFAULT NULL COMMENT '模板id',
   `form_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '表单数据',
   `task_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '流程任务id',
   `data_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '数据id',
   `delete_mark` int NOT NULL,
   `enabled_mark` int NOT NULL,
   `create_date` datetime NULL DEFAULT NULL,
   `create_user_id` bigint NULL DEFAULT NULL,
   `modify_date` datetime NULL DEFAULT NULL,
   `modify_user_id` bigint NULL DEFAULT NULL,
   PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for xjr_workflow_special_menu
-- ----------------------------
DROP TABLE IF EXISTS `xjr_workflow_special_menu`;
CREATE TABLE `xjr_workflow_special_menu`  (
  `id` bigint NOT NULL COMMENT '主键',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '功能名称',
  `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '功能编码',
  `menu_id` bigint NULL DEFAULT NULL COMMENT '菜单id',
  `schema_id` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '模板id',
  `schema_auth_type` int NULL DEFAULT NULL COMMENT '模板权限类型 0 所有 1 指定',
  `schema_auth_user_id` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专项菜单使用人 如果 schema_auth_type == 1 才会有',
  `field_auth_type` int NULL DEFAULT NULL COMMENT '字段权限 配置 0 所有 1指定',
  `field_auth_user_id` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专项菜单字段权限 指定成员 如果 field_auth_type == 1 才会有',
  `field_config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '表单字段配置',
  `query_config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '查询配置',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '专项菜单表' ROW_FORMAT = DYNAMIC;

ALTER TABLE xjr_form_template ADD COLUMN `config_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '界面设计及菜单设计部分json' AFTER enabled_mark;

ALTER TABLE xjr_department ADD COLUMN `department_type` int NULL DEFAULT NULL COMMENT '组织类别，1：公司，0：部门' AFTER enabled_mark;

ALTER TABLE xjr_file MODIFY COLUMN `process_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '关联的流程id';

ALTER TABLE xjr_file ADD COLUMN `th_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '缩略图路径' AFTER enabled_mark;
ALTER TABLE xjr_file ADD COLUMN `th_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '缩略图名称' AFTER enabled_mark;
ALTER TABLE xjr_file ADD COLUMN `th_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '缩略图大小' AFTER enabled_mark;
ALTER TABLE xjr_file ADD COLUMN `th_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '缩略图mini类型' AFTER enabled_mark;

ALTER TABLE xjr_form_template ADD COLUMN `config_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '界面设计及菜单设计部分json' AFTER enabled_mark;



ALTER TABLE xjr_menu MODIFY COLUMN `create_date` datetime NULL DEFAULT NULL;
ALTER TABLE xjr_menu MODIFY COLUMN `modify_date` datetime NULL DEFAULT NULL;


INSERT INTO `xjr_menu` VALUES (1419273699655498176, 1419273666632498176, 'DesktopDesign', '桌面设计', 'DesktopDesign', 'ant-design:gateway-outlined', 'desktop', '/generator/desktop/index', NULL, NULL, 1, 1, 0, 0, 0, 0, 5, '桌面设计', 0, NULL, 1000000000000000000, '2023-06-01 11:27:50', 0, 1, 1, NULL);
INSERT INTO `xjr_menu` VALUES (1589823150509592578, 1419273666632498176, 'BI', '数据大屏', 'BI', 'ant-design:dot-chart-outlined', 'http://114.116.210.204:3200', 'IFrame', NULL, 'http://114.116.210.204:3200', 1, 1, NULL, 1, 0, 0, 6, 'http://114.116.210.204:3200', 1, '2022-11-08 11:32:31', 1000000000000000000, '2023-05-30 19:50:36', 0, 1, 1, NULL);

ALTER TABLE xjr_user ADD COLUMN `wechat_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '微信号' AFTER enabled_mark;
ALTER TABLE xjr_user ADD COLUMN `qq_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'qq号码' AFTER enabled_mark;
ALTER TABLE xjr_user ADD COLUMN `birth_date` datetime(3) NULL DEFAULT NULL COMMENT '生日' AFTER enabled_mark;


ALTER TABLE xjr_menu ADD COLUMN `icon_url` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '图标地址' AFTER icon;

-- ----------------------------
-- Table structure for xjr_language_type
-- ----------------------------
DROP TABLE IF EXISTS `xjr_language_type`;
CREATE TABLE `xjr_language_type`  (
  `id` bigint NOT NULL COMMENT '主键',
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '语言名称',
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
  `is_main` int NULL DEFAULT NULL COMMENT '是否主语言',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '多语言类型' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of xjr_language_type
-- ----------------------------
INSERT INTO `xjr_language_type` VALUES (1, '中文', 'zh_CN', 1);
INSERT INTO `xjr_language_type` VALUES (1645590298908340225, '英文', 'en', 0);
INSERT INTO `xjr_language_type` VALUES (1654019180804169730, '中文繁体', 'zh_MO', NULL);


-- ----------------------------
-- Table structure for xjr_professional_report
-- ----------------------------
DROP TABLE IF EXISTS `xjr_professional_report`;
CREATE TABLE `xjr_professional_report`  (
    `id` bigint NOT NULL COMMENT '主键值',
    `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
    `code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
    `type_id` bigint NULL DEFAULT NULL COMMENT '报表类型id',
    `type_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '报表类型值',
    `file_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '文件json',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
    `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人主键值',
    `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人主键值',
    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
    `delete_mark` int NOT NULL COMMENT '删除标记，1-删除，0-未删除',
    `enabled_mark` int NOT NULL COMMENT '有效标记，1-有效，0-无效',
    `sort_code` int NULL DEFAULT NULL COMMENT '排序',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '专业报表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of xjr_professional_report
-- ----------------------------

-- ----------------------------
-- Table structure for xjr_report
-- ----------------------------
DROP TABLE IF EXISTS `xjr_report`;
CREATE TABLE `xjr_report`  (
    `id` bigint NOT NULL COMMENT '主键值',
    `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
    `code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
    `content` longblob NULL COMMENT '内容',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '排序码',
    `sort_code` int NULL DEFAULT NULL COMMENT '排序码',
    `create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
    `create_user_id` bigint NULL DEFAULT NULL COMMENT '创建人主键值',
    `modify_user_id` bigint NULL DEFAULT NULL COMMENT '修改人主键值',
    `modify_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
    `delete_mark` int NOT NULL COMMENT '删除标记，1-删除，0-未删除',
    `enabled_mark` int NOT NULL COMMENT '有效标记，1-有效，0-无效',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of xjr_report
-- ----------------------------
INSERT INTO `xjr_report` VALUES (1, 'xxx.ureport.xml', NULL, [encoded data, 5130 characters], NULL, NULL, '2022-05-23 14:05:14', 0, 0, '2022-06-09 10:11:03', 0, 1);
INSERT INTO `xjr_report` VALUES (1534719722912964610, 'tttt.ureport.xml', NULL, [encoded data, 5130 characters], NULL, NULL, '2022-06-09 10:11:10', 0, NULL, '2022-06-09 10:11:10', 0, 1);
INSERT INTO `xjr_report` VALUES (1658290522120114178, 'test.ureport.xml', NULL, [encoded data, 5150 characters], NULL, NULL, '2023-05-16 09:57:25', 0, 0, '2023-05-18 14:09:04', 0, 1);
INSERT INTO `xjr_report` VALUES (1669538987492253698, 'xxxxx.ureport.xml', NULL, [encoded data, 5118 characters], NULL, NULL, '2023-06-16 10:54:48', 0, 1000000000000000000, '2023-06-16 10:57:20', 1, 1);
INSERT INTO `xjr_report` VALUES (1669539085928374273, 'dfdfdfdfd.ureport.xml', NULL, [encoded data, 5126 characters], NULL, NULL, '2023-06-16 10:55:11', 0, 1000000000000000000, '2023-06-16 10:57:17', 1, 1);
INSERT INTO `xjr_report` VALUES (1670698824309161985, '报表.ureport.xml', NULL, [encoded data, 12098 characters], NULL, NULL, '2023-06-19 15:43:34', 0, 0, '2023-06-19 15:43:34', 0, 1);
INSERT INTO `xjr_report` VALUES (1670993988043423746, 'xxx.ureport.xml', NULL, [encoded data, 5116 characters], NULL, NULL, '2023-06-20 11:16:27', 0, 1000000000000000000, '2023-06-20 16:36:59', 1, 1);
INSERT INTO `xjr_report` VALUES (1670997943469228034, 'ytyyty.ureport.xml', NULL, [encoded data, 5136 characters], NULL, NULL, '2023-06-20 11:32:10', 0, 1000000000000000000, '2023-06-20 16:36:57', 1, 1);
INSERT INTO `xjr_report` VALUES (1671075378227376129, '报表案例.ureport.xml', NULL, [encoded data, 6008 characters], NULL, NULL, '2023-06-20 16:39:52', 0, 0, '2023-06-21 13:51:08', 0, 1);













