-- ---------------------------- -- 创建归档表 archives_record -- ---------------------------- DROP TABLE IF EXISTS `archives_record`; CREATE TABLE `archives_record` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `company_id` bigint(20) NULL DEFAULT NULL COMMENT '业务实体id', `company` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '业务实体', `frequency` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '归档频次', `file_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '档案类型', `year` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会计年份', `period` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会计月份', `vou_num` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '起止凭证号', `case_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '全宗号', `catalog_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目录号', `files_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '案卷号', `site` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '档案位置', `flow_id` bigint(20) NULL DEFAULT NULL COMMENT '关联号', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期', `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', `status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态', `note` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '归档详情', `file_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '归档状态', `borrow_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅状态', `identify_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '鉴定状态', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `record_time` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '归档时间', `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '所属部门id', `dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门', `tenant_id` bigint(20) NOT NULL COMMENT '租户编号,一个集团/总公司对应一个租户', `attr1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留字段1', `attr2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留字段2', `attr3` int(11) NULL DEFAULT NULL COMMENT '预留字段3', `attr4` int(11) NULL DEFAULT NULL COMMENT '预留字段4', `deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除', `creator` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', `updater` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id', `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '制单人', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '归档表' ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1; -- ---------------------------- -- 创建归档编码表 archives_code_rule -- ---------------------------- DROP TABLE IF EXISTS `archives_code_rule`; CREATE TABLE `archives_code_rule` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', `case_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '全宗号', `catalog_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目录号', `files_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '案卷号', `tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id', `deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `creator` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者', `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', `updater` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '档案编码规则' ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;