scan_central_db.sql 20 KB

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