/*

 Source Server         : mysql5-local
 Source Server Type    : MySQL
 Source Server Version : 50735
 Source Host           : localhost:3306
 Source Schema         : surveyking

 Target Server Type    : MySQL
 Target Server Version : 50735
 File Encoding         : 65001

 Date: 10/11/2022 08:06:16
*/


-- ----------------------------
-- Records of t_account
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_answer
-- ----------------------------
CREATE TABLE `t_answer` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `project_id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `temp_answer` text COLLATE utf8mb4_bin COMMENT '暂存答案',
  `survey` text COLLATE utf8mb4_bin COMMENT '问卷',
  `answer` text COLLATE utf8mb4_bin COMMENT '问卷答案',
  `attachment` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '问卷元数据',
  `meta_info` text COLLATE utf8mb4_bin COMMENT '问卷元数据',
  `temp_save` int(11) DEFAULT NULL COMMENT '0暂存 1已完成',
  `exam_info` text COLLATE utf8mb4_bin COMMENT '考试信息',
  `exam_score` float DEFAULT NULL COMMENT '考试分数',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `key_answer_pid` (`project_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='答案';

-- ----------------------------
-- Records of t_answer
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_comm_dict
-- ----------------------------

CREATE TABLE `t_comm_dict` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `code` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '字典编码',
  `name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '字典中文名称',
  `remark` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注信息',
  `dict_type` int(2) DEFAULT NULL COMMENT '字典类型 1:问卷字典',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_comm_dict
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_comm_dict_item
-- ----------------------------

CREATE TABLE `t_comm_dict_item` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `dict_code` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '字典编码',
  `item_name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '字典项中文名称',
  `item_value` varchar(256) COLLATE utf8mb4_bin NOT NULL COMMENT '字典项值',
  `item_order` int(8) DEFAULT NULL COMMENT '字典顺序',
  `item_level` int(4) DEFAULT NULL COMMENT '层级',
  `parent_item_value` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '父字典项值',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`,`item_value`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of t_comm_dict_item
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Records of t_dashboard
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_dept
-- ----------------------------

CREATE TABLE `t_dept` (
  `id` varchar(64) NOT NULL COMMENT 'ID',
  `parent_id` varchar(64) NOT NULL,
  `name` varchar(64) DEFAULT NULL COMMENT '名称',
  `short_name` varchar(64) NOT NULL COMMENT '简称',
  `code` varchar(64) DEFAULT NULL COMMENT '数据权限类型',
  `manager_id` varchar(64) DEFAULT NULL COMMENT '扩展字段',
  `sort_code` int(11) DEFAULT NULL,
  `property_json` varchar(256) DEFAULT NULL COMMENT '扩展字段',
  `status` varchar(20) DEFAULT NULL COMMENT '扩展字段',
  `remark` varchar(256) DEFAULT NULL COMMENT '扩展字段',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='组织机构';

-- ----------------------------
-- Records of t_dept
-- ----------------------------
BEGIN;
INSERT INTO `t_dept` VALUES ('1', '0', '卷王', 'juanwang', 'juanwang', '1457995481966747649', NULL, NULL, NULL, NULL, 0, '2021-11-21 14:12:08', NULL, '2021-11-21 14:22:58', '1457995481966747649');
COMMIT;

-- ----------------------------
-- Table structure for t_file
-- ----------------------------

CREATE TABLE `t_file` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `original_name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `file_name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `file_path` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL,
  `thumb_file_path` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL,
  `storage_type` int(11) DEFAULT NULL,
  `shared` int(11) DEFAULT '0',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='附件';

-- ----------------------------
-- Records of t_file
-- ----------------------------
BEGIN;
INSERT INTO `t_file` VALUES ('h1unm8OPTGeFVSLsKZjNC', 'surveyking-wechat.png', '1667805024068_surveyking-wechat.png', '1667805024068_surveyking-wechat.png', '1667805024068_surveyking-wechat_640x480.png', 3, 0, 0, '2022-11-07 15:21:20', '1457995481966747649', NULL, NULL);
INSERT INTO `t_file` VALUES ('kdypb56AEVdvTTjLzUmUH', 'iShot_2022-11-07_15.46.31 (1).png', '1667805024069_iShot_2022-11-07_15.46.31 (1).png', '1667805024069_iShot_2022-11-07_15.46.31 (1).png', '1667805024069_iShot_2022-11-07_15.46.31 (1)_640x480.png', 3, 0, 0, '2022-11-07 15:47:20', '1457995481966747649', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_position
-- ----------------------------

CREATE TABLE `t_position` (
  `id` varchar(64) NOT NULL COMMENT 'ID',
  `name` varchar(50) NOT NULL,
  `code` varchar(20) DEFAULT NULL,
  `is_virtual` tinyint(1) NOT NULL COMMENT '是否虚拟岗',
  `data_permission_type` varchar(256) DEFAULT NULL COMMENT '数据权限类型',
  `property_json` varchar(20) DEFAULT NULL COMMENT '扩展字段',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='岗位';

-- ----------------------------
-- Records of t_position
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_project
-- ----------------------------

CREATE TABLE `t_project` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `parent_id` varchar(64) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '父ID',
  `name` text COLLATE utf8mb4_bin COMMENT '项目名称',
  `survey` longtext COLLATE utf8mb4_bin COMMENT '问卷',
  `setting` text COLLATE utf8mb4_bin COMMENT '问卷设置',
  `status` int(11) DEFAULT '0' COMMENT '0未发布 1已发布',
  `mode` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '问卷模式',
  `priority` int(8) DEFAULT '1000' COMMENT '优先级',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='项目';

-- ----------------------------
-- Records of t_project
-- ----------------------------
BEGIN;
INSERT INTO `t_project` VALUES ('RzsRh8', '0', '快速开始', '{\"id\":\"RzsRh8\",\"title\":\"快速开始\",\"description\":\"<a href=\\\"https://surveyking.cn/\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\" style=\\\"font-size: 18px;\\\">点击查看官方文档</a>\",\"type\":\"Survey\",\"attribute\":{\"suffix\":\"您已完成本次问卷，感谢您的帮助与支持\",\"submitButton\":\"提交\"},\"children\":[{\"id\":\"179c\",\"title\":\"<p><span style=\\\"color: rgb(230, 0, 0);\\\">注意，卷王问卷系统的逻辑和设置是分开的，</span><strong style=\\\"color: rgb(230, 0, 0);\\\">点击题目显示题目设置</strong><span style=\\\"color: rgb(230, 0, 0);\\\">，</span><strong style=\\\"color: rgb(230, 0, 0);\\\">点击选项显示选项设置</strong><span style=\\\"color: rgb(230, 0, 0);\\\">！</span></p><p><br></p><p><span style=\\\"font-size: 18px;\\\">常见问题：</span></p><p><br></p><p><span style=\\\"font-size: 16px;\\\">1、 如何修改系统名称和开启用户注册</span></p><p>在<strong>系统管理-&gt;个人设置-&gt;系统设置</strong>里面可以修改当前系统名称和系统图标，开启用户注册，开启登录验证码</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">2、问题如何添加图片</span></p><p>点击题目，点击高级设置，在弹窗里面上传图片，支持剪贴板复制粘贴图片。无论是问题、选项还是考试的答题解析都是支持富文本的（包含图片、视频、音频、数学公式等）</p><p><img src=\\\"data:image/png;base64,[BLOB]\\\" width=\\\"286\\\"></p><p><span style=\\\"font-size: 16px;\\\">3、如何开启投票</span></p><p>单选题和多选题的问题设置里面，打开<strong>显示投票结果</strong>开关即可</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">4、如何设置问卷关联</span></p><p>参考<a href=\\\"https://surveyking.cn/docs/guides/link\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\">问卷关联设置</a>，可以在一个问卷里面引用其他问卷的答案</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">5、首页我的问卷里面如何才能显示问卷信息</span></p><p>打开系统设置，回收设置，添加<strong>系统用户白名单</strong></p><p><br></p><p><span style=\\\"font-size: 16px;\\\">6、如何创建公开查询（</span><span style=\\\"font-size: 16px; color: rgb(0, 102, 204);\\\">类似易查分和金山快查</span><span style=\\\"font-size: 16px;\\\">）</span></p><p>打开系统设置，投放与分享，公开查询设置，新建查询页面</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">7、如何快速入门公式</span></p><p>请参考<a href=\\\"https://hc.jiandaoyun.com/doc/9032\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\">简单云-公式规则文档</a> 和 卷王的<a href=\\\"https://surveyking.cn/docs/guides/formula\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\">公式文档</a>(使用方式和原理基本一样)，目前卷王支持显示逻辑、结束逻辑、跳转逻辑、计算逻辑、校验逻辑、答卷完自定义提示语逻辑、文本替换逻辑，理论上支持比问卷星强大的多的逻辑设置。</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">8、如何设置计算公式，比如根据身份证号计算年龄和性别</span></p><p>参考<a href=\\\"https://surveyking.cn/docs/guides/logic/calculate\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\">计算逻辑文档</a></p><p><br></p><p><span style=\\\"font-size: 16px;\\\">9、如何设置题目的显示隐藏</span></p><p>参考<a href=\\\"https://surveyking.cn/docs/guides/logic/show\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\">显示逻辑文档</a></p><p><br></p><p><span style=\\\"font-size: 16px;\\\">10、如果自定义答卷后的页面显示</span></p><p>打开系统设置，投放与分享，答题后自定义跳转页面</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">11、需要更多功能，提交一个 bug</span></p><p>如果您需要一个新的功能，或者在使用过程中发现了一个问题，可以通过这个链接 <a href=\\\"https://wj.surveyking.cn/s/start\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\">https://wj.surveyking.cn/s/start</a> 来提交</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">12、系统商用免费吗？</span></p><p>无论公司还是个人，都可以免费使用</p><p><br></p><p><span style=\\\"font-size: 16px;\\\">13、捐助作者</span></p><p><span style=\\\"font-size: 14px;\\\">坚持不易，如果对您有帮助，可以捐助作者或者在 </span><a href=\\\"https://gitee.com/surveyking/surveyking\\\" rel=\\\"noopener noreferrer\\\" target=\\\"_blank\\\" style=\\\"font-size: 14px;\\\">https://gitee.com/surveyking/surveyking&nbsp;</a><span style=\\\"font-size: 14px;\\\">给一个 star，非常感谢 🙏</span></p><p><img src=\\\"data:image/png;base64,[BLOB]\\\" width=\\\"216\\\"></p>\",\"type\":\"Remark\",\"attribute\":{}}]}', '{\"status\":1,\"answerSetting\":{\"progressBar\":true,\"questionNumber\":true,\"autoSave\":false,\"whitelistType\":3,\"triggerType\":\"onBlur\"},\"submittedSetting\":{},\"examSetting\":{}}', 1, 'survey', 1000, 0, '2022-11-07 15:13:20', '1457995481966747649', '2022-11-09 12:44:52', '1457995481966747649');
INSERT INTO `t_project` VALUES ('g5GacM', '0', '快速考试', '{\"id\":\"g5GacM\",\"title\":\"快速考试\",\"description\":\"感谢您能抽出几分钟时间来参加本次答题，现在我们就马上开始吧！\",\"type\":\"Survey\",\"attribute\":{\"suffix\":\"您已完成本次考试。\",\"submitButton\":\"提交\"}}', '{\"status\":0,\"answerSetting\":{\"progressBar\":true,\"questionNumber\":true,\"autoSave\":true,\"triggerType\":\"onBlur\"},\"submittedSetting\":{},\"examSetting\":{}}', 0, 'exam', 1001, 0, '2022-11-07 15:44:45', '1457995481966747649', NULL, NULL);
INSERT INTO `t_project` VALUES ('nK2Kxr', '0', '请输入标题', '{\"id\":\"nK2Kxr\",\"title\":\"请输入标题\",\"description\":\"感谢您能抽出几分钟时间来参加本次答题，现在我们就马上开始吧！\",\"type\":\"Survey\",\"attribute\":{\"suffix\":\"您已完成本次问卷，感谢您的帮助与支持\",\"submitButton\":\"提交\"},\"children\":[{\"id\":\"la1q\",\"title\":\"多项填空\",\"type\":\"MultipleBlank\",\"attribute\":{\"required\":true},\"children\":[{\"id\":\"8u31\",\"title\":\"填空1\",\"attribute\":{}},{\"id\":\"xw5a\",\"title\":\"填空2\",\"attribute\":{}}]}]}', '{\"status\":0,\"answerSetting\":{\"progressBar\":true,\"questionNumber\":true,\"autoSave\":true,\"triggerType\":\"onBlur\",\"copyEnabled\":true},\"submittedSetting\":{},\"examSetting\":{}}', 0, 'survey', 1002, 0, '2022-11-09 20:59:58', '1457995481966747649', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_project_partner
-- ----------------------------

CREATE TABLE `t_project_partner` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `uid` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '项目内唯一ID',
  `project_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '项目id',
  `type` int(2) DEFAULT NULL COMMENT '参与者类型',
  `status` int(2) DEFAULT '0' COMMENT '0未访问 1已访问 2已答题',
  `user_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '参与者id',
  `user_name` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '参与者姓名',
  `group_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '参与组id',
  `data_permission` text COLLATE utf8mb4_bin COMMENT '数据权限',
  `initial_value` text COLLATE utf8mb4_bin COMMENT '初始值',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of t_project_partner
-- ----------------------------
BEGIN;
INSERT INTO `t_project_partner` VALUES ('1589516331894464513', NULL, 'RzsRh8', 1, 0, '1457995481966747649', NULL, NULL, NULL, NULL, '2022-11-07 15:13:20', '1457995481966747649', NULL, NULL);
INSERT INTO `t_project_partner` VALUES ('1589524102907977729', NULL, 'RzsRh8', 3, 1, '1457995481966747649', NULL, NULL, NULL, NULL, '2022-11-07 15:44:13', '1457995481966747649', '2022-11-07 15:44:21', '1457995481966747649');
INSERT INTO `t_project_partner` VALUES ('1589524239029919745', NULL, 'g5GacM', 1, 0, '1457995481966747649', NULL, NULL, NULL, NULL, '2022-11-07 15:44:45', '1457995481966747649', NULL, NULL);
INSERT INTO `t_project_partner` VALUES ('1590328341582356482', NULL, 'nK2Kxr', 1, 0, '1457995481966747649', NULL, NULL, NULL, NULL, '2022-11-09 20:59:58', '1457995481966747649', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_repo
-- ----------------------------

CREATE TABLE `t_repo` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '标题',
  `description` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
  `mode` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'survey问卷 exam考试',
  `shared` tinyint(1) DEFAULT '0' COMMENT '1共享 0私有',
  `tag` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '标签',
  `priority` int(11) DEFAULT NULL COMMENT '排序优先级',
  `setting` text COLLATE utf8mb4_bin COMMENT '设置',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='模板组';

-- ----------------------------
-- Records of t_repo
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_repo_template
-- ----------------------------

CREATE TABLE `t_repo_template` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `template_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模板id',
  `repo_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模板库id',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='模板库模板';

-- ----------------------------
-- Records of t_repo_template
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_role
-- ----------------------------

CREATE TABLE `t_role` (
  `id` varchar(64) NOT NULL COMMENT 'ID',
  `name` varchar(50) NOT NULL COMMENT '名称',
  `code` varchar(50) NOT NULL COMMENT '编码',
  `remark` varchar(100) DEFAULT NULL COMMENT '备注',
  `authority` varchar(3000) DEFAULT NULL COMMENT '权限列表',
  `status` tinyint(1) DEFAULT '1' COMMENT '1激活 0失活',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色';

-- ----------------------------
-- Records of t_role
-- ----------------------------
BEGIN;
INSERT INTO `t_role` VALUES ('1457995481928998914', 'Admin', 'admin', '系统初始化角色', 'answer,answer:list,answer:detail,answer:create,answer:update,answer:delete,answer:export,file,file:detail,file:list,file:import,file:delete,project,project:list,project:detail,project:create,project:update,project:delete,project:report,system,system:role,system:role:list,system:user,system:user:list,system:role:create,system:role:update,system:role:delete,system:user:create,system:user:update,system:user:updatePosition,system:user:delete,position,position:list,position:create,system:position,system:position:update,system:position:delete,system:org,system:org:list,system:org:create,system:org:update,system:org:delete,template,template:list,template:create,template:update,template:delete,system:position:list,system:position:create,system:dept,system:dept:list,system:dept:create,system:dept:update,system:dept:delete,repo,repo:list,repo:detail,repo:create,repo:update,repo:delete,user,user:update,answer:upload,system:dict,system:dict:update,system:dict:delete,system:dictItem,system:dictItem:list,system:dictItem:create,system:dictItem:import,system:dictItem:delete,system:dict:list,system:dict:create', 1, 0, '2021-11-09 16:56:26', NULL, '2022-08-10 12:55:19', '1457995481966747649');
COMMIT;

-- ----------------------------
-- Table structure for t_sys_info
-- ----------------------------

CREATE TABLE `t_sys_info` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '主键',
  `name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '系统名称',
  `description` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '系统描述信息',
  `avatar` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '图标',
  `locale` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '默认语言',
  `version` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '版本号',
  `setting` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '其他系统设置',
  `register_info` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '注册信息',
  `is_default` tinyint(1) DEFAULT NULL COMMENT '是否默认设置',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='系统信息';

-- ----------------------------
-- Records of t_sys_info
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_info` VALUES ('1', '卷王问卷考试系统', '做更好的调查问卷系统', NULL, 'zh-CN', '{}', NULL, NULL, 1, '2022-02-11 10:13:19', NULL, '2022-11-07 15:13:02', NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_tag
-- ----------------------------

CREATE TABLE `t_tag` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `entity_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '实体ID',
  `name` varchar(128) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '名称',
  `category` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '分类',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='模板组';

-- ----------------------------
-- Records of t_tag
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_template
-- ----------------------------

CREATE TABLE `t_template` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `repo_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
  `name` varchar(1024) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模板标题',
  `question_type` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '问题类型',
  `template` longtext COLLATE utf8mb4_bin COMMENT '模板',
  `mode` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模板模式 survey/exam',
  `category` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模板分类',
  `tag` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '标签',
  `priority` int(11) DEFAULT NULL COMMENT '排序优先级',
  `preview_url` varchar(512) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '预览地址',
  `shared` tinyint(1) DEFAULT '0',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of t_template
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------

CREATE TABLE `t_user` (
  `id` varchar(64) NOT NULL COMMENT 'ID',
  `name` varchar(50) NOT NULL COMMENT '真实姓名',
  `dept_id` varchar(20) DEFAULT NULL,
  `gender` varchar(10) DEFAULT NULL COMMENT '性别',
  `birthday` date DEFAULT NULL COMMENT '出生日期',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机号',
  `email` varchar(50) DEFAULT NULL COMMENT 'Email',
  `avatar` varchar(200) DEFAULT NULL COMMENT '头像地址',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '用户状态',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) DEFAULT NULL,
  `profile` varchar(255) DEFAULT NULL COMMENT '个人简介',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户';

-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
INSERT INTO `t_user` VALUES ('1457995481966747649', 'Admin', '1', 'F', NULL, '13800138000', 'surveyking@qq.com', NULL, 1, 0, '2021-11-09 16:56:26', NULL, '2022-02-11 13:29:17', '1457995481966747649', 'hello surveyking~');
COMMIT;

-- ----------------------------
-- Table structure for t_user_book
-- ----------------------------

CREATE TABLE `t_user_book` (
  `id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `name` varchar(2048) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '问题名称',
  `template_id` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '模板ID',
  `wrong_times` int(4) DEFAULT NULL COMMENT '错误次数',
  `note` text COLLATE utf8mb4_bin COMMENT '笔记',
  `status` int(2) DEFAULT NULL COMMENT '1标记为简单',
  `type` int(2) DEFAULT NULL COMMENT '1错题 2收藏',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='错题本';

-- ----------------------------
-- Records of t_user_book
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_user_position
-- ----------------------------

CREATE TABLE `t_user_position` (
  `id` varchar(64) NOT NULL COMMENT 'ID',
  `user_id` varchar(64) NOT NULL,
  `dept_id` varchar(64) DEFAULT NULL,
  `position_id` varchar(64) DEFAULT NULL COMMENT '数据权限类型',
  `is_primary_position` tinyint(1) DEFAULT NULL COMMENT '是否主岗',
  `propertyJson` varchar(256) DEFAULT NULL COMMENT '扩展字段',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户岗位';

-- ----------------------------
-- Records of t_user_position
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_user_role
-- ----------------------------

CREATE TABLE `t_user_role` (
  `id` varchar(64) NOT NULL COMMENT 'ID',
  `user_type` varchar(100) NOT NULL DEFAULT 'SysUser' COMMENT '用户类型',
  `user_id` varchar(64) NOT NULL COMMENT '用户ID',
  `role_id` varchar(64) NOT NULL COMMENT '角色ID',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(256) DEFAULT NULL,
  `update_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_t_user_role` (`user_type`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色关联';

-- ----------------------------
-- Records of t_user_role
-- ----------------------------
BEGIN;
INSERT INTO `t_user_role` VALUES ('1488542015867121666', 'SysUser', '1457995481966747649', '1457995481928998914', '2022-02-01 23:57:27', '1457995481966747649', NULL, NULL);
COMMIT;

