/*
 Navicat Premium Dump SQL

 Source Server         : db_mcyc
 Source Server Type    : MySQL
 Source Server Version : 100508 (10.5.8-MariaDB)
 Source Host           : localhost:3306
 Source Schema         : db_mcyc

 Target Server Type    : MySQL
 Target Server Version : 100508 (10.5.8-MariaDB)
 File Encoding         : 65001

 Date: 15/09/2025 14:23:40
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_file
-- ----------------------------
DROP TABLE IF EXISTS `sys_file`;
CREATE TABLE `sys_file`  (
  `file_id` bigint NOT NULL AUTO_INCREMENT COMMENT '文件ID',
  `folder_id` int NULL DEFAULT NULL,
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `file_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件类型',
  `file_size` bigint NULL DEFAULT 0 COMMENT '文件大小（字节）',
  `file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件存储路径',
  `download_count` int NULL DEFAULT 0 COMMENT '下载次数',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志（0存在 2删除）',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `dept_id` bigint NOT NULL COMMENT '部门ID',
  PRIMARY KEY (`file_id`) USING BTREE,
  INDEX `idx_folder_id`(`folder_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_file
-- ----------------------------
INSERT INTO `sys_file` VALUES (1, 2, '11111.txt', 'txt', 29736, 'files/machengzhishiku/huiyijilu/11111.txt', 2, '0', '0', 'XZL', '2025-07-02 14:15:07', 'XZL', '2025-07-03 11:11:30', 103);
INSERT INTO `sys_file` VALUES (2, 2, '11111(1).txt', 'txt', 29736, 'files/machengzhishiku/huiyijilu/11111(1).txt', 1, '0', '0', 'XZL', '2025-07-02 14:15:19', '', NULL, 103);
INSERT INTO `sys_file` VALUES (3, 1, '模板.doc', 'doc', 9216, 'files/machengzhishiku/模板.doc', 2, '0', '0', 'XZL', '2025-07-02 14:22:15', 'XZL', '2025-07-02 16:13:49', 103);
INSERT INTO `sys_file` VALUES (4, 1, '11111.txt', 'txt', 29736, 'files/machengzhishiku/11111.txt', 1, '0', '0', 'XZL', '2025-07-02 14:22:23', '', NULL, 103);
INSERT INTO `sys_file` VALUES (5, 1, '11.bmp', 'bmp', 0, 'files/machengzhishiku/11.bmp', 2, '0', '0', 'XZL', '2025-07-02 14:22:28', '', NULL, 103);
INSERT INTO `sys_file` VALUES (7, 9, '666.ppt', 'ppt', 20992, 'files/machengzhishiku/huiyijilu/bumenhuiyi/xiaozuhuiyi/666.ppt', 1, '1', '0', '小李', '2025-07-03 11:21:29', '小李', '2025-07-03 11:22:22', 201);
INSERT INTO `sys_file` VALUES (8, 9, '222.docx', 'docx', 0, 'files/machengzhishiku/huiyijilu/bumenhuiyi/xiaozuhuiyi/222.docx', 2, '0', '0', '小李', '2025-07-03 11:21:40', '', NULL, 201);
INSERT INTO `sys_file` VALUES (9, 9, '4.xls', 'xls', 18432, 'files/machengzhishiku/huiyijilu/bumenhuiyi/xiaozuhuiyi/4.xls', 2, '0', '0', '小李', '2025-07-03 11:21:49', '', NULL, 201);
INSERT INTO `sys_file` VALUES (25, 8, '11111.txt', 'txt', 29736, 'files/machengzhishiku/huiyijilu/bumenhuiyi/11111.txt', 0, '0', '0', 'XZL', '2025-07-03 16:03:06', '', NULL, 103);
INSERT INTO `sys_file` VALUES (28, 8, '666.ppt', 'ppt', 41984, 'files/machengzhishiku/huiyijilu/bumenhuiyi/666.ppt', 0, '0', '0', 'XZL', '2025-07-03 16:05:48', '', NULL, 103);
INSERT INTO `sys_file` VALUES (29, 8, '666(1).ppt', 'ppt', 41984, 'files/machengzhishiku/huiyijilu/bumenhuiyi/666(1).ppt', 0, '0', '0', 'XZL', '2025-07-03 16:06:18', '', NULL, 103);
INSERT INTO `sys_file` VALUES (30, 8, '222.docx', 'docx', 13809, 'files/machengzhishiku/huiyijilu/bumenhuiyi/222.docx', 0, '0', '0', 'XZL', '2025-07-03 16:07:18', '', NULL, 103);
INSERT INTO `sys_file` VALUES (31, 8, '模板.doc', 'doc', 9216, 'files/machengzhishiku/huiyijilu/bumenhuiyi/模板.doc', 0, '0', '0', 'XZL', '2025-07-03 16:07:58', '', NULL, 103);
INSERT INTO `sys_file` VALUES (32, 19, '模板.doc', 'doc', 9216, 'files/machengzhishiku/caiwuguanli/caiwu/模板.doc', 1, '0', '0', 'XZL', '2025-08-12 17:32:59', '', NULL, 103);
INSERT INTO `sys_file` VALUES (33, 19, '麻城市局需求.doc', 'doc', 794169, 'files/machengzhishiku/caiwuguanli/caiwu/麻城市局需求.doc', 1, '0', '0', 'XZL', '2025-08-12 17:33:31', '', NULL, 103);
INSERT INTO `sys_file` VALUES (34, 22, '麻城市局需求.doc', 'doc', 794169, 'files/machengzhishiku/lingdaoxinxi/bumenlingdao/xinxi/麻城市局需求.doc', 2, '1', '0', 'XZL', '2025-08-13 10:08:09', 'XZL', '2025-08-13 10:12:41', 103);

-- ----------------------------
-- Table structure for sys_file_folder
-- ----------------------------
DROP TABLE IF EXISTS `sys_file_folder`;
CREATE TABLE `sys_file_folder`  (
  `folder_id` bigint NOT NULL AUTO_INCREMENT COMMENT '文件夹ID',
  `parent_id` bigint NULL DEFAULT 0 COMMENT '父文件夹ID（0表示顶级）',
  `ancestors` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '祖级列表（格式：,1,5,15,）',
  `folder_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
  `level` tinyint NULL DEFAULT 1 COMMENT '层级（1麻城知识库 2二级 3三级 4四级）',
  `order_num` int NULL DEFAULT 0 COMMENT '显示顺序',
  `full_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '完整路径（如/麻城知识库/部门文档/财务部/预算）',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT '状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT '删除标志（0存在 2删除）',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `dept_id` bigint NOT NULL,
  PRIMARY KEY (`folder_id`) USING BTREE,
  INDEX `idx_ancestors`(`ancestors`(20) ASC) USING BTREE,
  INDEX `idx_parent_id`(`parent_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件文件夹表（麻城知识库四级结构）' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_file_folder
-- ----------------------------
INSERT INTO `sys_file_folder` VALUES (1, 0, '', '麻城知识库', 1, 1, 'files/machengzhishiku', '0', '0', 'XZL', NULL, '', NULL, 103);
INSERT INTO `sys_file_folder` VALUES (2, 1, ',1', '会议记录', 2, 2, 'files/machengzhishiku/会议记录', '0', '0', 'XZL', '2025-07-02 12:01:13', '', NULL, 201);
INSERT INTO `sys_file_folder` VALUES (3, 1, ',1', '领导信息', 2, 2, 'files/machengzhishiku/领导会议', '0', '0', 'XZL', '2025-07-02 14:43:42', 'XZL', '2025-07-02 15:09:10', 200);
INSERT INTO `sys_file_folder` VALUES (4, 1, ',1', '综合档案', 2, 2, 'files/machengzhishiku/综合档案', '0', '0', 'XZL', '2025-07-02 14:43:58', '', NULL, 202);
INSERT INTO `sys_file_folder` VALUES (5, 1, ',1', '政策汇总', 2, 2, 'files/machengzhishiku/政策汇总', '0', '0', 'XZL', '2025-07-02 14:44:14', '', NULL, 204);
INSERT INTO `sys_file_folder` VALUES (6, 1, ',1', '安全守则', 2, 2, 'files/machengzhishiku/安全手册', '0', '0', 'XZL', '2025-07-02 14:44:27', 'XZL', '2025-07-04 09:10:57', 205);
INSERT INTO `sys_file_folder` VALUES (7, 1, ',1', '财务管理', 2, 2, 'files/machengzhishiku/财务管理', '0', '0', 'XZL', '2025-07-02 14:44:39', '', NULL, 206);
INSERT INTO `sys_file_folder` VALUES (8, 2, ',1,2', '部门会议', 3, 3, 'files/machengzhishiku/会议记录/部门会议', '0', '0', 'XZL', '2025-07-02 15:08:31', '小李', '2025-07-04 09:12:05', 201);
INSERT INTO `sys_file_folder` VALUES (9, 8, ',1,2,8', '小组会议', 4, 4, 'files/machengzhishiku/会议记录/部门会议/小组会议', '0', '0', 'XZL', '2025-07-02 15:08:41', '', NULL, 201);
INSERT INTO `sys_file_folder` VALUES (10, 3, ',1,3', '部门领导', 3, 3, 'files/machengzhishiku/领导会议/部门领导', '0', '0', 'XZL', '2025-07-02 15:09:20', '', NULL, 200);
INSERT INTO `sys_file_folder` VALUES (11, 4, ',1,4', '工作档案', 3, 3, 'files/machengzhishiku/综合档案/工作档案', '0', '0', 'XZL', '2025-07-02 15:10:12', '', NULL, 202);
INSERT INTO `sys_file_folder` VALUES (12, 11, ',1,4,11', '小组档案', 4, 4, 'files/machengzhishiku/综合档案/工作档案/小组档案', '0', '0', 'XZL', '2025-07-02 15:10:34', '', NULL, 202);
INSERT INTO `sys_file_folder` VALUES (13, 4, ',1,4', '活动档案', 3, 3, 'files/machengzhishiku/综合档案/活动档案', '0', '0', 'XZL', '2025-07-02 15:10:44', '', NULL, 202);
INSERT INTO `sys_file_folder` VALUES (14, 13, ',1,4,13', '周年庆', 4, 4, 'files/machengzhishiku/综合档案/活动档案/周年庆', '0', '0', 'XZL', '2025-07-02 15:10:57', '', NULL, 202);
INSERT INTO `sys_file_folder` VALUES (15, 5, ',1,5', '省政策', 3, 3, 'files/machengzhishiku/政策汇总/省政策', '0', '0', 'XZL', '2025-07-02 15:11:10', '', NULL, 204);
INSERT INTO `sys_file_folder` VALUES (16, 15, ',1,5,15', '区政策', 4, 4, 'files/machengzhishiku/政策汇总/省政策/区政策', '0', '0', 'XZL', '2025-07-02 15:11:19', '', NULL, 204);
INSERT INTO `sys_file_folder` VALUES (17, 15, ',1,5,15', '乡镇政策', 4, 4, 'files/machengzhishiku/政策汇总/省政策/乡镇政策', '0', '0', 'XZL', '2025-07-02 15:11:36', '', NULL, 204);
INSERT INTO `sys_file_folder` VALUES (18, 8, ',1,2,8', '项目会议', 4, 4, 'files/machengzhishiku/会议记录/部门会议/直属领导会议', '0', '0', '小李', '2025-07-04 09:24:55', 'XZL', '2025-07-04 09:25:56', 201);
INSERT INTO `sys_file_folder` VALUES (19, 7, ',1,7', '财务', 3, 3, 'files/machengzhishiku/财务管理/财务', '0', '0', 'XZL', '2025-08-12 17:32:37', '', NULL, 206);
INSERT INTO `sys_file_folder` VALUES (20, 19, ',1,7,19', '111', 4, 4, 'files/machengzhishiku/财务管理/财务/111', '0', '0', 'XZL', '2025-08-12 17:32:46', '', NULL, 206);
INSERT INTO `sys_file_folder` VALUES (21, 6, ',1,6', '安全', 3, 3, 'files/machengzhishiku/安全手册/安全', '0', '0', 'XZL', '2025-08-13 09:09:22', '', NULL, 205);
INSERT INTO `sys_file_folder` VALUES (22, 10, ',1,3,10', '信息', 4, 4, 'files/machengzhishiku/领导会议/部门领导/信息', '0', '0', 'XZL', '2025-08-13 10:06:25', '', NULL, 200);

SET FOREIGN_KEY_CHECKS = 1;
