|
@@ -73,4 +73,82 @@ INSERT INTO `eb_answer_card_subject` (
|
|
FROM
|
|
FROM
|
|
eb_answer_card b
|
|
eb_answer_card b
|
|
WHERE
|
|
WHERE
|
|
- b.subject_code is not NULL;
|
|
|
|
|
|
+ b.subject_code is not NULL;
|
|
|
|
+
|
|
|
|
+CREATE TABLE `b_privilege`
|
|
|
|
+(
|
|
|
|
+ `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
+ `code` varchar(50) NOT NULL,
|
|
|
|
+ `name` varchar(50) NOT NULL,
|
|
|
|
+ `parent_code` varchar(50) NOT NULL,
|
|
|
|
+ `privilege_type` varchar(50) NOT NULL,
|
|
|
|
+ `privilege_uri` varchar(50) DEFAULT NULL,
|
|
|
|
+ `seq` int(11) NOT NULL,
|
|
|
|
+ `level` int(11) NOT NULL,
|
|
|
|
+ `icon` varchar(50) DEFAULT NULL,
|
|
|
|
+ `i18n` varchar(50) DEFAULT NULL,
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
+ UNIQUE KEY `IDX_PRIVILEGE_01` (`code`),
|
|
|
|
+ KEY `IDX_PRIVILEGE_02` (`parent_code`)
|
|
|
|
+) ENGINE = InnoDB
|
|
|
|
+ DEFAULT CHARSET = utf8mb4
|
|
|
|
+ COLLATE = utf8mb4_bin;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+CREATE TABLE `b_role_privilege`
|
|
|
|
+(
|
|
|
|
+ `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
+ `school_id` int(11) NOT NULL,
|
|
|
|
+ `role_code` varchar(50) NOT NULL,
|
|
|
|
+ `privilege_code` varchar(50) NOT NULL,
|
|
|
|
+ `enable` tinyint(1) NOT NULL,
|
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
|
+ UNIQUE KEY `IDX_ROLE_PRIVILEGE_01`(`school_id`,`role_code`, `privilege_code`)
|
|
|
|
+) ENGINE = InnoDB
|
|
|
|
+ DEFAULT CHARSET = utf8mb4
|
|
|
|
+ COLLATE = utf8mb4_bin;
|
|
|
|
+
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('user_list', '用户管理', 'root_code', 'MENU', '/admin/user/list', 10,1,'icon-user','index.user');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_list', '考试管理', 'root_code', 'MENU', '/admin/exam/list', 20,1,'icon-th-list','index.exam');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_student', '考生管理', 'root_code', 'MENU', '/admin/exam/student', 30,1,'icon-user','index.student');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_paper', '科目管理', 'root_code', 'MENU', '/admin/exam/paper', 40,1,'icon-book','index.paper');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_scan', '扫描进度', 'root_code', 'MENU', '/admin/exam/scan', 50,1,'icon-print','index.scan');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_mark', '评卷管理', 'root_code', 'MENU', '/admin/exam/mark', 60,1,'icon-pencil','index.mark');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_reject_list', '打回试卷', 'root_code', 'MENU', '/admin/exam/reject/list', 70,1,'icon-bookmark','index.reject');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_problem_history', '问题试卷', 'root_code', 'MENU', '/admin/exam/problem/history', 80,1,'icon-tag','index.problem');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_inspected_info', '成绩复核', 'root_code', 'MENU', '/admin/exam/inspected/info', 90,1,'icon-flag','index.inspected');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_score', '成绩查询', 'root_code', 'MENU', '/admin/exam/score', 100,1,'icon-search','index.score');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_report_subject', '总量分析', 'root_code', 'MENU', '/admin/exam/reportSubject', 110,1,'icon-signal','index.report.total');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_report_subject_range', '科目分析', 'root_code', 'MENU', '/admin/exam/reportSubjectRange', 120,1,'icon-asterisk','index.report.subject');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('exam_check_answer', '数据检查', 'root_code', 'MENU', '/admin/exam/check/answer', 130,1,'icon-check','index.check');
|
|
|
|
+INSERT INTO `b_privilege` ( `code`, `name`, `parent_code`, `privilege_type`, `privilege_uri`, `seq`,`level`,`icon`,`i18n`)
|
|
|
|
+VALUES ('operation_log', '操作日志', 'root_code', 'MENU', '/admin/operation/log', 140,1,'icon-tasks','index.log');
|
|
|
|
+
|
|
|
|
+INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
|
|
|
|
+SELECT s.id,'SCHOOL_ADMIN',p.`code`,1 from b_privilege p join b_school s;
|
|
|
|
+
|
|
|
|
+INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
|
|
|
|
+SELECT s.id,'SUBJECT_HEADER',p.`code`,1 from b_privilege p join b_school s
|
|
|
|
+where p.`code` in('exam_mark','exam_reject_list','exam_problem_history'
|
|
|
|
+,'exam_inspected_info','exam_score','exam_report_subject','exam_report_subject_range');
|
|
|
|
+
|
|
|
|
+INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
|
|
|
|
+SELECT s.id,'INSPECTOR',p.`code`,1 from b_privilege p join b_school s
|
|
|
|
+where p.`code` in('exam_inspected_info');
|
|
|
|
+
|
|
|
|
+INSERT INTO b_role_privilege (`school_id`, `role_code`, `privilege_code`,`enable`)
|
|
|
|
+SELECT s.id,'SCHOOL_VIEWER',p.`code`,1 from b_privilege p join b_school s
|
|
|
|
+where p.`code` in('exam_score','exam_report_subject','operation_log');
|