-- 2024-07-25
CREATE TABLE `basic_file_type`  (
    `id` bigint(0) NOT NULL,
    `school_id` bigint(0) NOT NULL COMMENT '学校ID',
    `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件类型名称',
    `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类别：系统，自定义',
    `create_id` bigint(0) NULL DEFAULT NULL COMMENT '创建人',
    `create_time` bigint(0) NULL DEFAULT NULL COMMENT '创建时间',
    `update_id` bigint(0) NULL DEFAULT NULL COMMENT '更新人',
    `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `UNIQUE_SCHOOL_ID_NAME`(`school_id`, `name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件类型' ROW_FORMAT = Dynamic;

ALTER TABLE `exam_student`
    ADD COLUMN file_path varchar(255) NULL COMMENT '生成pdf的文件路径' AFTER `update_time`;


-- 2024-07-29
ALTER TABLE `paper_library_other`
    ADD COLUMN `file_type_id` bigint NULL COMMENT '文件类型ID' AFTER `update_time`;

INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (560, '文件类型管理', 'FileTypeManage', 'MENU', 8, 6, NULL, NULL, 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (561, '新建', 'Add', 'BUTTON', 560, 1, 'AUTH', '565', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (562, '删除', 'Delete', 'LINK', 560, 1, 'AUTH', '566', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (563, '列表', 'List', 'LIST', 560, 1, 'AUTH', '564', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (564, '查询', '/api/admin/basic/filetype/page', 'URL', 560, 1, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (565, '新增', '/api/admin/basic/filetype/save', 'URL', 560, 2, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (566, '删除', '/api/admin/basic/filetype/delete', 'URL', 560, 3, 'AUTH', NULL, 1, 1, 1);

INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (570, '扫描统计管理', 'ScanStatManage', 'MENU', 8, 7, NULL, NULL, 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (571, '列表', 'List', 'LIST', 570, 1, 'AUTH', '573', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (572, '导出', 'Add', 'BUTTON', 570, 1, 'AUTH', '574', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (573, '查询', '/api/admin/basic/scan/stat/page', 'URL', 570, 1, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (574, '导出', '/api/admin/basic/scan/stat/export', 'URL', 570, 2, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (575, '查询条件', 'Condition', 'CONDITION', 570, 2, 'AUTH', '573', '1', '0', '1');
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (576, '查询', 'Select', 'BUTTON', 570, 3, 'AUTH', '573', '1', '0', '1');


-- 2024-07-30
ALTER TABLE `paper_library`
    ADD COLUMN `batch_no` varchar(20) NULL COMMENT '批次号' AFTER `recognize_result`;

INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (280, '图片管理', 'PictureManage', 'MENU', 18, 1, NULL, NULL, 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (281, '查询条件', 'Condition', 'CONDITION', 280, 1, 'AUTH', '286', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (282, '列表', 'List', 'LIST', 280, 2, 'AUTH', '286', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (283, '查询', 'Select', 'BUTTON', 280, 3, 'AUTH', '286', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (284, '下载图片', 'DownloadPicture', 'BUTTON', 280, 4, 'AUTH', '287', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (285, '查看详情', 'PictureDetail', 'LINK', 280, 5, 'AUTH', '288,289', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (286, '查询接口', '/api/admin/paper/picture/page', 'URL', 280, 1, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (287, '下载图片', '/api/admin/paper/picture/download', 'URL', 280, 1, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (288, '查看图片', '/api/admin/paper/picture/list_student_picture', 'URL', 280, 1, 'AUTH', NULL, 1, 1, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (289, '保存图片', '/api/admin/paper/picture/save', 'URL', 280, 1, 'AUTH', NULL, 1, 1, 1);


-- pdf图片生成
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (279, 'pdf生成', 'Pdf', 'BUTTON', 260, 6, 'AUTH', '290', 1, 0, 1);
INSERT INTO `sys_privilege`(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (290, 'pdf图片生成接口', '/api/admin/paper/document/pdf/generate', 'URL', 260, 11, 'AUTH', NULL, 1, 1, 1);
