scan_central_db.sql 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. CREATE TABLE IF NOT EXISTS `sc_student`
  2. (
  3. `id` bigint NOT NULL AUTO_INCREMENT,
  4. `exam_id` bigint NOT NULL,
  5. `exam_number` varchar(64) NOT NULL,
  6. `student_code` varchar(64) NOT NULL,
  7. `name` varchar(64) NOT NULL,
  8. `subject_code` varchar(64) NOT NULL,
  9. `package_code` varchar(64) DEFAULT NULL,
  10. `exam_site` varchar(64) DEFAULT NULL,
  11. `exam_site_name` varchar(64) DEFAULT NULL,
  12. `exam_room` varchar(64) DEFAULT NULL,
  13. `seat_number` varchar(16) DEFAULT NULL,
  14. `campus_name` varchar(64) DEFAULT NULL,
  15. `campus_code` varchar(64) DEFAULT NULL,
  16. `status` varchar(16) NOT NULL,
  17. `omr_absent` bit(1) NOT NULL,
  18. `question_filled` bit(1) NOT NULL,
  19. `subjective_filled` bit(1) NOT NULL,
  20. `assigned` bit(1) NOT NULL,
  21. `absent_suspect` bit(1) NOT NULL,
  22. `incomplete` bit(1) NOT NULL,
  23. `card_number` int DEFAULT NULL,
  24. `device` varchar(32) DEFAULT NULL,
  25. `paper_type` varchar(16) NOT NULL,
  26. `exam_status` varchar(32) DEFAULT NULL,
  27. `breach_code` varchar(32) DEFAULT NULL,
  28. `file_upload_status` varchar(16) DEFAULT NULL,
  29. `data_upload_status` varchar(16) DEFAULT NULL,
  30. `check_mark` bit(1) NOT NULL,
  31. `assigned_check_count` int DEFAULT NULL,
  32. `assigned_suspect` bit(1) NOT NULL,
  33. `creator_id` bigint DEFAULT NULL,
  34. `updater_id` bigint DEFAULT NULL,
  35. `create_time` bigint DEFAULT NULL,
  36. `update_time` bigint DEFAULT NULL,
  37. PRIMARY KEY (`id`),
  38. UNIQUE KEY `exam_number` (`exam_id`, `exam_number`),
  39. UNIQUE KEY `exam_student_subject` (`exam_id`, `student_code`, `subject_code`),
  40. KEY `exam_assigned` (`exam_id`, `assigned`, `assigned_check_count`)
  41. ) ENGINE = InnoDB
  42. DEFAULT CHARSET = utf8mb4;
  43. -- ----------------------------
  44. -- Table structure for sc_answer_card
  45. -- ----------------------------
  46. CREATE TABLE IF NOT EXISTS `sc_answer_card`
  47. (
  48. `exam_id` bigint NOT NULL,
  49. `number` int NOT NULL,
  50. `code` varchar(128) DEFAULT NULL,
  51. `paper_count` int NOT NULL,
  52. `path` varchar(255) NOT NULL,
  53. `md5` varchar(32) NOT NULL,
  54. `source` varchar(16) NOT NULL,
  55. `need_adapte` bit(1) NOT NULL,
  56. `single_page` bit(1) NOT NULL,
  57. `slice_config` text NOT NULL,
  58. `dpi` int DEFAULT NULL,
  59. `slice_name` text DEFAULT NULL,
  60. `parameter` text DEFAULT NULL,
  61. `remark` varchar(255) DEFAULT NULL,
  62. `creator_id` bigint DEFAULT NULL,
  63. `updater_id` bigint DEFAULT NULL,
  64. `create_time` bigint DEFAULT NULL,
  65. `update_time` bigint DEFAULT NULL,
  66. PRIMARY KEY (`exam_id`, `number`)
  67. ) ENGINE = InnoDB
  68. DEFAULT CHARSET = utf8mb4;
  69. -- ----------------------------
  70. -- Table structure for sc_exam
  71. -- ----------------------------
  72. CREATE TABLE IF NOT EXISTS `sc_exam`
  73. (
  74. `id` bigint NOT NULL AUTO_INCREMENT,
  75. `school_id` bigint NOT NULL,
  76. `school_name` varchar(64) NOT NULL,
  77. `name` varchar(128) NOT NULL,
  78. `enable` bit(1) NOT NULL,
  79. `mode` varchar(16) NOT NULL,
  80. `scan_by_package` bit(1) NOT NULL,
  81. `allow_unexist_paper` bit(1) NOT NULL,
  82. `answer_front_card_type` int NOT NULL,
  83. `enable_single_page_answer` bit(1) NOT NULL,
  84. `enable_upload` bit(1) NOT NULL,
  85. `enable_sync_verify` bit(1) NOT NULL,
  86. `exam_number_fill_count` int DEFAULT NULL,
  87. `paper_type_barcode_content` text DEFAULT NULL,
  88. `absent_barcode_content` varchar(16) DEFAULT NULL,
  89. `image_transfer_mode` varchar(32) DEFAULT NULL,
  90. `image_check_ratio` double DEFAULT NULL,
  91. `data_sync_time` bigint DEFAULT NULL,
  92. `card_sync_time` bigint DEFAULT NULL,
  93. `creator_id` bigint DEFAULT NULL,
  94. `updater_id` bigint DEFAULT NULL,
  95. `create_time` bigint DEFAULT NULL,
  96. `update_time` bigint DEFAULT NULL,
  97. PRIMARY KEY (`id`),
  98. INDEX `school_enable` (`enable`, `school_id`)
  99. ) ENGINE = InnoDB
  100. DEFAULT CHARSET = utf8mb4;
  101. -- ----------------------------
  102. -- Table structure for sc_exam_summary
  103. -- ----------------------------
  104. CREATE TABLE IF NOT EXISTS `sc_exam_summary`
  105. (
  106. `id` bigint NOT NULL,
  107. `student_count` int(11) NOT NULL,
  108. `subject_count` int(11) NOT NULL,
  109. `batch_count` int(11) NOT NULL,
  110. `answer_scanned_count` int(11) NOT NULL,
  111. `answer_unexist_count` int(11) NOT NULL,
  112. `answer_manual_absent_count` int(11) NOT NULL,
  113. `answer_omr_absent_count` int(11) NOT NULL,
  114. `answer_absent_suspect_count` int(11) NOT NULL,
  115. `answer_incomplete_count` int(11) NOT NULL,
  116. `answer_assigned_count` int(11) NOT NULL,
  117. `answer_mismatch_count` int(11) NOT NULL,
  118. `answer_batch_count` int(11) NOT NULL,
  119. `package_total_count` int(11) NOT NULL,
  120. `package_scanned_count` int(11) NOT NULL,
  121. `student_answer_count` int(11) NOT NULL,
  122. `upload_progress` double NOT NULL,
  123. PRIMARY KEY (`id`)
  124. ) ENGINE = InnoDB
  125. DEFAULT CHARSET = utf8mb4;
  126. -- ----------------------------
  127. -- Table structure for sc_omr_task
  128. -- ----------------------------
  129. CREATE TABLE IF NOT EXISTS `sc_omr_task`
  130. (
  131. `id` bigint NOT NULL AUTO_INCREMENT,
  132. `exam_id` bigint NOT NULL,
  133. `group_id` bigint NOT NULL,
  134. `student_id` bigint NOT NULL,
  135. `paper_number` int NOT NULL,
  136. `paper_id` int NOT NULL,
  137. `card_number` int NOT NULL,
  138. `status` varchar(16) NOT NULL,
  139. `device` varchar(64) DEFAULT NULL,
  140. `pages` text NOT NULL,
  141. `creator_id` bigint DEFAULT NULL,
  142. `updater_id` bigint DEFAULT NULL,
  143. `create_time` bigint DEFAULT NULL,
  144. `update_time` bigint DEFAULT NULL,
  145. PRIMARY KEY (`id`),
  146. UNIQUE KEY `group_paper` (`group_id`, `paper_id`),
  147. KEY `exam_status` (`exam_id`, `status`, `student_id`),
  148. KEY `group_student` (`group_id`, `student_id`)
  149. ) ENGINE = InnoDB
  150. DEFAULT CHARSET = utf8mb4;
  151. -- ----------------------------
  152. -- Table structure for sc_package_card
  153. -- ----------------------------
  154. CREATE TABLE IF NOT EXISTS `sc_package_card`
  155. (
  156. `id` bigint NOT NULL AUTO_INCREMENT,
  157. `exam_id` bigint NOT NULL,
  158. `path` varchar(255) NOT NULL,
  159. `md5` varchar(32) NOT NULL,
  160. `source` varchar(16) NOT NULL,
  161. `creator_id` bigint DEFAULT NULL,
  162. `updater_id` bigint DEFAULT NULL,
  163. `create_time` bigint DEFAULT NULL,
  164. `update_time` bigint DEFAULT NULL,
  165. PRIMARY KEY (`id`),
  166. KEY `exam` (`exam_id`)
  167. ) ENGINE = InnoDB
  168. DEFAULT CHARSET = utf8mb4;
  169. -- ----------------------------
  170. -- Table structure for sc_package_task
  171. -- ----------------------------
  172. CREATE TABLE IF NOT EXISTS `sc_package_task`
  173. (
  174. `id` bigint NOT NULL AUTO_INCREMENT,
  175. `exam_id` bigint NOT NULL,
  176. `package_code` varchar(64) NOT NULL,
  177. `status` varchar(16) NOT NULL,
  178. `device` varchar(64) NOT NULL,
  179. `creator_id` bigint DEFAULT NULL,
  180. `updater_id` bigint DEFAULT NULL,
  181. `create_time` bigint DEFAULT NULL,
  182. `update_time` bigint DEFAULT NULL,
  183. PRIMARY KEY (`id`),
  184. KEY `exam_package` (`exam_id`, `package_code`)
  185. ) ENGINE = InnoDB
  186. DEFAULT CHARSET = utf8mb4;
  187. -- ----------------------------
  188. -- Table structure for sc_scanner
  189. -- ----------------------------
  190. CREATE TABLE IF NOT EXISTS `sc_scanner`
  191. (
  192. `device` varchar(64) NOT NULL,
  193. `last_login_time` bigint NOT NULL,
  194. `create_time` bigint DEFAULT NULL,
  195. `update_time` bigint DEFAULT NULL,
  196. PRIMARY KEY (`device`)
  197. ) ENGINE = InnoDB
  198. DEFAULT CHARSET = utf8mb4;
  199. -- ----------------------------
  200. -- Table structure for ss_system_config
  201. -- ----------------------------
  202. CREATE TABLE IF NOT EXISTS `sc_system_config`
  203. (
  204. `id` bigint NOT NULL AUTO_INCREMENT,
  205. `mode` varchar(16) NOT NULL,
  206. `scanner_enable_login` bit(1) NOT NULL,
  207. `scanner_password` varchar(16) NOT NULL,
  208. `client_version` varchar(16) DEFAULT NULL,
  209. `client_uri` varchar(255) DEFAULT NULL,
  210. `client_md5` varchar(32) DEFAULT NULL,
  211. `client_update_time` bigint DEFAULT NULL,
  212. PRIMARY KEY (`id`)
  213. ) ENGINE = InnoDB
  214. DEFAULT CHARSET = utf8mb4;
  215. CREATE TABLE IF NOT EXISTS `sc_package_result`
  216. (
  217. `exam_id` bigint NOT NULL,
  218. `package_code` varchar(64) NOT NULL,
  219. `device` varchar(64) NOT NULL,
  220. `path` text NOT NULL,
  221. `assigned` bit(1) NOT NULL,
  222. `creator_id` bigint DEFAULT NULL,
  223. `updater_id` bigint DEFAULT NULL,
  224. `create_time` bigint DEFAULT NULL,
  225. `update_time` bigint DEFAULT NULL,
  226. `upload_time` bigint DEFAULT NULL,
  227. PRIMARY KEY (`exam_id`, `package_code`)
  228. ) ENGINE = InnoDB
  229. DEFAULT CHARSET = utf8mb4;
  230. CREATE TABLE IF NOT EXISTS `sc_scanner_card`
  231. (
  232. `exam_id` bigint NOT NULL,
  233. `device` varchar(64) NOT NULL,
  234. `card_number` int NOT NULL,
  235. `creator_id` bigint DEFAULT NULL,
  236. `updater_id` bigint DEFAULT NULL,
  237. `create_time` bigint DEFAULT NULL,
  238. `update_time` bigint DEFAULT NULL,
  239. PRIMARY KEY (`exam_id`, `device`)
  240. ) ENGINE = InnoDB
  241. DEFAULT CHARSET = utf8mb4;
  242. CREATE TABLE IF NOT EXISTS `sc_batch`
  243. (
  244. `id` bigint NOT NULL AUTO_INCREMENT,
  245. `exam_id` bigint NOT NULL,
  246. `device` varchar(64) NOT NULL,
  247. `package_code` varchar(64) DEFAULT NULL,
  248. `subject_code` varchar(64) DEFAULT NULL,
  249. `scan_count` int NOT NULL,
  250. `assigned_count` int NOT NULL,
  251. `status` varchar(16) NOT NULL,
  252. `verify_status` varchar(16) DEFAULT NULL,
  253. `check_status` varchar(16) DEFAULT NULL,
  254. `check_image_user_id` bigint DEFAULT NULL,
  255. `check_image_time` bigint DEFAULT NULL,
  256. `creator_id` bigint DEFAULT NULL,
  257. `updater_id` bigint DEFAULT NULL,
  258. `create_time` bigint DEFAULT NULL,
  259. `update_time` bigint DEFAULT NULL,
  260. PRIMARY KEY (`id`),
  261. KEY `exam_verify_status` (`exam_id`, `verify_status`)
  262. ) ENGINE = InnoDB
  263. DEFAULT CHARSET = utf8mb4;
  264. CREATE TABLE IF NOT EXISTS `sc_batch_paper`
  265. (
  266. `batch_id` bigint(20) NOT NULL,
  267. `student_id` bigint(20) NOT NULL,
  268. `paper_number` int(11) NOT NULL,
  269. `paper_id` bigint(20) NOT NULL,
  270. `card_number` int(11) NOT NULL,
  271. `assigned` bit(1) NOT NULL,
  272. `need_check` bit(1) NOT NULL,
  273. PRIMARY KEY (`batch_id`, `student_id`, `paper_number`),
  274. UNIQUE KEY `paper_id` (`paper_id`)
  275. ) ENGINE = InnoDB
  276. DEFAULT CHARSET = utf8mb4;
  277. CREATE TABLE IF NOT EXISTS `sc_paper`
  278. (
  279. `id` bigint NOT NULL AUTO_INCREMENT,
  280. `exam_id` bigint NOT NULL,
  281. `card_number` int NOT NULL,
  282. `number` int NOT NULL,
  283. `page_count` int NOT NULL,
  284. `mismatch` bit(1) NOT NULL,
  285. `assigned` bit(1) NOT NULL,
  286. `assigned_suspect` bit(1) NOT NULL,
  287. `question_filled` bit(1) NOT NULL,
  288. `subjective_filled` bit(1) NOT NULL,
  289. `omr_exam_number` varchar(255) NOT NULL,
  290. `creator_id` bigint DEFAULT NULL,
  291. `updater_id` bigint DEFAULT NULL,
  292. `create_time` bigint DEFAULT NULL,
  293. `update_time` bigint DEFAULT NULL,
  294. PRIMARY KEY (`id`),
  295. KEY `mismatch` (`exam_id`, `mismatch`)
  296. ) ENGINE = InnoDB
  297. DEFAULT CHARSET = utf8mb4;
  298. CREATE TABLE IF NOT EXISTS `sc_paper_page`
  299. (
  300. `paper_id` bigint NOT NULL,
  301. `page_index` int NOT NULL,
  302. `absent` text DEFAULT NULL,
  303. `breach` text DEFAULT NULL,
  304. `paper_type` text DEFAULT NULL,
  305. `question` text DEFAULT NULL,
  306. `selective` text DEFAULT NULL,
  307. `sheet_path` varchar(255) NOT NULL,
  308. `slice_path` text DEFAULT NULL,
  309. `recog_data` longtext DEFAULT NULL,
  310. `creator_id` bigint DEFAULT NULL,
  311. `updater_id` bigint DEFAULT NULL,
  312. `create_time` bigint DEFAULT NULL,
  313. `update_time` bigint DEFAULT NULL,
  314. PRIMARY KEY (`paper_id`, `page_index`)
  315. ) ENGINE = InnoDB
  316. DEFAULT CHARSET = utf8mb4;
  317. CREATE TABLE IF NOT EXISTS `sc_paper_structure`
  318. (
  319. `id` bigint NOT NULL AUTO_INCREMENT,
  320. `exam_id` bigint NOT NULL,
  321. `card_number` int NOT NULL,
  322. `paper_number` int NOT NULL,
  323. `page_index` int NOT NULL,
  324. `field` varchar(16) NOT NULL,
  325. `question_number` int NOT NULL,
  326. `single` bit(1) NOT NULL,
  327. `creator_id` bigint DEFAULT NULL,
  328. `updater_id` bigint DEFAULT NULL,
  329. `create_time` bigint DEFAULT NULL,
  330. `update_time` bigint DEFAULT NULL,
  331. PRIMARY KEY (`id`),
  332. UNIQUE KEY `IDX_PAPER_STRUCTURE_001` (`exam_id`, `card_number`, `paper_number`, `page_index`, `field`,
  333. `question_number`)
  334. ) ENGINE = InnoDB
  335. DEFAULT CHARSET = utf8mb4;
  336. CREATE TABLE IF NOT EXISTS `sc_question`
  337. (
  338. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  339. `exam_id` int(11) NOT NULL COMMENT '考试ID',
  340. `subject_code` varchar(32) NOT NULL COMMENT '科目代码',
  341. `paper_type` varchar(8) NOT NULL COMMENT '试卷类型',
  342. `objective` tinyint(1) NOT NULL COMMENT '是否客观题',
  343. `main_number` int(11) NOT NULL COMMENT '大题号',
  344. `sub_number` varchar(32) NOT NULL COMMENT '小题号',
  345. `main_title` varchar(128) NOT NULL COMMENT '大题名称',
  346. `total_score` double DEFAULT NULL COMMENT '满分',
  347. `creator_id` bigint DEFAULT NULL,
  348. `updater_id` bigint DEFAULT NULL,
  349. `create_time` bigint DEFAULT NULL,
  350. `update_time` bigint DEFAULT NULL,
  351. PRIMARY KEY (`id`),
  352. UNIQUE KEY `index1` (`exam_id`, `subject_code`, `objective`, `paper_type`, `main_number`, `sub_number`)
  353. ) ENGINE = InnoDB
  354. DEFAULT CHARSET = utf8mb4 COMMENT ='小题信息表';
  355. CREATE TABLE IF NOT EXISTS `sc_omr_group`
  356. (
  357. `id` bigint NOT NULL AUTO_INCREMENT,
  358. `exam_id` bigint NOT NULL,
  359. `fixed` bit(1) NOT NULL,
  360. `stage` varchar(16) NOT NULL,
  361. `conditions` text NOT NULL,
  362. `total_count` int NOT NULL,
  363. `creator_id` bigint DEFAULT NULL,
  364. `updater_id` bigint DEFAULT NULL,
  365. `create_time` bigint DEFAULT NULL,
  366. `update_time` bigint DEFAULT NULL,
  367. PRIMARY KEY (`id`),
  368. KEY `exam_fixed` (`exam_id`, `fixed`)
  369. ) ENGINE = InnoDB
  370. DEFAULT CHARSET = utf8mb4;
  371. CREATE TABLE IF NOT EXISTS `sc_refix_batch`
  372. (
  373. `id` bigint NOT NULL AUTO_INCREMENT,
  374. `exam_id` bigint NOT NULL,
  375. `card_number` int NOT NULL,
  376. `conditions` text NOT NULL,
  377. `update_slice` bit(1) NOT NULL,
  378. `total_count` int NOT NULL,
  379. `sucess_count` int NOT NULL,
  380. `finished` bit(1) NOT NULL,
  381. `creator_id` bigint DEFAULT NULL,
  382. `updater_id` bigint DEFAULT NULL,
  383. `create_time` bigint DEFAULT NULL,
  384. `update_time` bigint DEFAULT NULL,
  385. PRIMARY KEY (`id`)
  386. ) ENGINE = InnoDB
  387. DEFAULT CHARSET = utf8mb4;
  388. CREATE TABLE IF NOT EXISTS `sc_student_paper`
  389. (
  390. `student_id` bigint NOT NULL,
  391. `paper_number` int NOT NULL,
  392. `paper_id` bigint NOT NULL,
  393. `create_time` bigint DEFAULT NULL,
  394. `update_time` bigint DEFAULT NULL,
  395. PRIMARY KEY (`student_id`, `paper_number`),
  396. UNIQUE KEY `paper_id` (`paper_id`)
  397. ) ENGINE = InnoDB
  398. DEFAULT CHARSET = utf8mb4;
  399. CREATE TABLE IF NOT EXISTS `sc_subject`
  400. (
  401. `exam_id` bigint NOT NULL,
  402. `code` varchar(64) NOT NULL,
  403. `name` varchar(64) NOT NULL,
  404. `paper_type_barcode_content` text DEFAULT NULL,
  405. `creator_id` bigint DEFAULT NULL,
  406. `updater_id` bigint DEFAULT NULL,
  407. `create_time` bigint DEFAULT NULL,
  408. `update_time` bigint DEFAULT NULL,
  409. PRIMARY KEY (`exam_id`, `code`)
  410. ) ENGINE = InnoDB
  411. DEFAULT CHARSET = utf8mb4;
  412. CREATE TABLE IF NOT EXISTS `sc_file_property`
  413. (
  414. `path` varchar(255) NOT NULL,
  415. `md5` varchar(32) NOT NULL,
  416. `exam_id` bigint NOT NULL,
  417. `file_size` bigint NOT NULL,
  418. `create_time` bigint DEFAULT NULL,
  419. `update_time` bigint DEFAULT NULL,
  420. PRIMARY KEY (`path`)
  421. ) ENGINE = InnoDB
  422. DEFAULT CHARSET = utf8mb4;
  423. CREATE TABLE IF NOT EXISTS `sc_user`
  424. (
  425. `id` int(11) NOT NULL AUTO_INCREMENT,
  426. `login_name` varchar(64) NOT NULL,
  427. `name` varchar(64) NOT NULL,
  428. `password` varchar(64) NOT NULL,
  429. `role` varchar(16) NOT NULL,
  430. `enable` tinyint(1) NOT NULL,
  431. `school_id` bigint NOT NULL,
  432. `device` varchar(64) DEFAULT NULL,
  433. `creator_id` bigint DEFAULT NULL,
  434. `updater_id` bigint DEFAULT NULL,
  435. `create_time` bigint DEFAULT NULL,
  436. `update_time` bigint DEFAULT NULL,
  437. PRIMARY KEY (`id`),
  438. UNIQUE KEY `login_name` (`login_name`)
  439. ) ENGINE = InnoDB
  440. DEFAULT CHARSET = utf8mb4;
  441. CREATE TABLE IF NOT EXISTS `sc_adapte_file`
  442. (
  443. `exam_id` bigint NOT NULL,
  444. `card_number` int NOT NULL,
  445. `role` varchar(16) NOT NULL,
  446. `device` varchar(64) NOT NULL,
  447. `uri` varchar(255) NOT NULL,
  448. `md5` varchar(32) NOT NULL,
  449. `dpi` int DEFAULT NULL,
  450. `create_time` bigint DEFAULT NULL,
  451. `update_time` bigint DEFAULT NULL,
  452. PRIMARY KEY (`exam_id`, `card_number`, `role`, `device`)
  453. ) ENGINE = InnoDB
  454. DEFAULT CHARSET = utf8mb4;
  455. CREATE TABLE IF NOT EXISTS `sc_student_answer_task`
  456. (
  457. `id` bigint NOT NULL AUTO_INCREMENT,
  458. `exam_id` bigint NOT NULL,
  459. `group_id` bigint NOT NULL,
  460. `student_id` bigint NOT NULL,
  461. `status` varchar(16) NOT NULL,
  462. `device` varchar(64) DEFAULT NULL,
  463. `creator_id` bigint DEFAULT NULL,
  464. `updater_id` bigint DEFAULT NULL,
  465. `create_time` bigint DEFAULT NULL,
  466. `update_time` bigint DEFAULT NULL,
  467. PRIMARY KEY (`id`),
  468. UNIQUE KEY `group_student` (`group_id`, `student_id`),
  469. KEY `exam_status` (`exam_id`,`student_id`,`status`)
  470. ) ENGINE = InnoDB
  471. DEFAULT CHARSET = utf8mb4;
  472. CREATE TABLE IF NOT EXISTS `sc_student_answer_group`
  473. (
  474. `id` bigint NOT NULL AUTO_INCREMENT,
  475. `exam_id` bigint NOT NULL,
  476. `conditions` text NOT NULL,
  477. `total_count` int NOT NULL,
  478. `creator_id` bigint DEFAULT NULL,
  479. `updater_id` bigint DEFAULT NULL,
  480. `create_time` bigint DEFAULT NULL,
  481. `update_time` bigint DEFAULT NULL,
  482. PRIMARY KEY (`id`)
  483. ) ENGINE = InnoDB
  484. DEFAULT CHARSET = utf8mb4;
  485. CREATE TABLE IF NOT EXISTS `sc_answer_card_subject`
  486. (
  487. `exam_id` bigint NOT NULL,
  488. `card_number` int NOT NULL,
  489. `subject_code` varchar(64) NOT NULL,
  490. `create_time` bigint DEFAULT NULL,
  491. `update_time` bigint DEFAULT NULL,
  492. PRIMARY KEY (`exam_id`, `card_number`, `subject_code`)
  493. ) ENGINE = InnoDB
  494. DEFAULT CHARSET = utf8mb4;
  495. -- ----------------------------
  496. -- Table structure for sc_assigned_check_history
  497. -- ----------------------------
  498. CREATE TABLE IF NOT EXISTS `sc_assigned_check_history`
  499. (
  500. `id` bigint NOT NULL AUTO_INCREMENT,
  501. `exam_id` bigint NOT NULL,
  502. `student_id` bigint NOT NULL,
  503. `user_id` bigint NOT NULL,
  504. `creator_id` bigint DEFAULT NULL,
  505. `updater_id` bigint DEFAULT NULL,
  506. `create_time` bigint DEFAULT NULL,
  507. `update_time` bigint DEFAULT NULL,
  508. PRIMARY KEY (`id`),
  509. UNIQUE KEY `student_user` (`student_id`,`user_id`),
  510. KEY `student` (`student_id`)
  511. ) ENGINE = InnoDB
  512. DEFAULT CHARSET = utf8mb4;