scan_central_db.sql 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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. `scanner_enable_login` bit(1) NOT NULL,
  206. `scanner_password` varchar(16) NOT NULL,
  207. `client_version` varchar(16) DEFAULT NULL,
  208. `client_uri` varchar(255) DEFAULT NULL,
  209. `client_md5` varchar(32) DEFAULT NULL,
  210. `client_update_time` bigint DEFAULT NULL,
  211. PRIMARY KEY (`id`)
  212. ) ENGINE = InnoDB
  213. DEFAULT CHARSET = utf8mb4;
  214. CREATE TABLE IF NOT EXISTS `sc_package_result`
  215. (
  216. `exam_id` bigint NOT NULL,
  217. `package_code` varchar(64) NOT NULL,
  218. `device` varchar(64) NOT NULL,
  219. `path` text NOT NULL,
  220. `assigned` bit(1) NOT NULL,
  221. `creator_id` bigint DEFAULT NULL,
  222. `updater_id` bigint DEFAULT NULL,
  223. `create_time` bigint DEFAULT NULL,
  224. `update_time` bigint DEFAULT NULL,
  225. `upload_time` bigint DEFAULT NULL,
  226. PRIMARY KEY (`exam_id`, `package_code`)
  227. ) ENGINE = InnoDB
  228. DEFAULT CHARSET = utf8mb4;
  229. CREATE TABLE IF NOT EXISTS `sc_scanner_card`
  230. (
  231. `exam_id` bigint NOT NULL,
  232. `device` varchar(64) NOT NULL,
  233. `card_number` int NOT NULL,
  234. `creator_id` bigint DEFAULT NULL,
  235. `updater_id` bigint DEFAULT NULL,
  236. `create_time` bigint DEFAULT NULL,
  237. `update_time` bigint DEFAULT NULL,
  238. PRIMARY KEY (`exam_id`, `device`)
  239. ) ENGINE = InnoDB
  240. DEFAULT CHARSET = utf8mb4;
  241. CREATE TABLE IF NOT EXISTS `sc_batch`
  242. (
  243. `id` bigint NOT NULL AUTO_INCREMENT,
  244. `exam_id` bigint NOT NULL,
  245. `device` varchar(64) NOT NULL,
  246. `package_code` varchar(64) DEFAULT NULL,
  247. `subject_code` varchar(64) DEFAULT NULL,
  248. `scan_count` int NOT NULL,
  249. `assigned_count` int NOT NULL,
  250. `status` varchar(16) NOT NULL,
  251. `verify_status` varchar(16) DEFAULT NULL,
  252. `check_status` varchar(16) DEFAULT NULL,
  253. `check_image_user_id` bigint DEFAULT NULL,
  254. `check_image_time` bigint DEFAULT NULL,
  255. `creator_id` bigint DEFAULT NULL,
  256. `updater_id` bigint DEFAULT NULL,
  257. `create_time` bigint DEFAULT NULL,
  258. `update_time` bigint DEFAULT NULL,
  259. PRIMARY KEY (`id`),
  260. KEY `exam_verify_status` (`exam_id`, `verify_status`)
  261. ) ENGINE = InnoDB
  262. DEFAULT CHARSET = utf8mb4;
  263. CREATE TABLE IF NOT EXISTS `sc_batch_paper`
  264. (
  265. `batch_id` bigint(20) NOT NULL,
  266. `student_id` bigint(20) NOT NULL,
  267. `paper_number` int(11) NOT NULL,
  268. `paper_id` bigint(20) NOT NULL,
  269. `card_number` int(11) NOT NULL,
  270. `assigned` bit(1) NOT NULL,
  271. `need_check` bit(1) NOT NULL,
  272. PRIMARY KEY (`batch_id`, `student_id`, `paper_number`),
  273. UNIQUE KEY `paper_id` (`paper_id`)
  274. ) ENGINE = InnoDB
  275. DEFAULT CHARSET = utf8mb4;
  276. CREATE TABLE IF NOT EXISTS `sc_paper`
  277. (
  278. `id` bigint NOT NULL AUTO_INCREMENT,
  279. `exam_id` bigint NOT NULL,
  280. `card_number` int NOT NULL,
  281. `number` int NOT NULL,
  282. `page_count` int NOT NULL,
  283. `mismatch` bit(1) NOT NULL,
  284. `assigned` bit(1) NOT NULL,
  285. `assigned_suspect` bit(1) NOT NULL,
  286. `question_filled` bit(1) NOT NULL,
  287. `subjective_filled` bit(1) NOT NULL,
  288. `omr_exam_number` varchar(255) NOT NULL,
  289. `creator_id` bigint DEFAULT NULL,
  290. `updater_id` bigint DEFAULT NULL,
  291. `create_time` bigint DEFAULT NULL,
  292. `update_time` bigint DEFAULT NULL,
  293. PRIMARY KEY (`id`),
  294. KEY `mismatch` (`exam_id`, `mismatch`)
  295. ) ENGINE = InnoDB
  296. DEFAULT CHARSET = utf8mb4;
  297. CREATE TABLE IF NOT EXISTS `sc_paper_page`
  298. (
  299. `paper_id` bigint NOT NULL,
  300. `page_index` int NOT NULL,
  301. `absent` text DEFAULT NULL,
  302. `breach` text DEFAULT NULL,
  303. `paper_type` text DEFAULT NULL,
  304. `question` text DEFAULT NULL,
  305. `selective` text DEFAULT NULL,
  306. `sheet_path` varchar(255) NOT NULL,
  307. `slice_path` text DEFAULT NULL,
  308. `recog_data` longtext DEFAULT NULL,
  309. `creator_id` bigint DEFAULT NULL,
  310. `updater_id` bigint DEFAULT NULL,
  311. `create_time` bigint DEFAULT NULL,
  312. `update_time` bigint DEFAULT NULL,
  313. PRIMARY KEY (`paper_id`, `page_index`)
  314. ) ENGINE = InnoDB
  315. DEFAULT CHARSET = utf8mb4;
  316. CREATE TABLE IF NOT EXISTS `sc_paper_structure`
  317. (
  318. `id` bigint NOT NULL AUTO_INCREMENT,
  319. `exam_id` bigint NOT NULL,
  320. `card_number` int NOT NULL,
  321. `paper_number` int NOT NULL,
  322. `page_index` int NOT NULL,
  323. `field` varchar(16) NOT NULL,
  324. `question_number` int NOT NULL,
  325. `single` bit(1) NOT NULL,
  326. `creator_id` bigint DEFAULT NULL,
  327. `updater_id` bigint DEFAULT NULL,
  328. `create_time` bigint DEFAULT NULL,
  329. `update_time` bigint DEFAULT NULL,
  330. PRIMARY KEY (`id`),
  331. UNIQUE KEY `IDX_PAPER_STRUCTURE_001` (`exam_id`, `card_number`, `paper_number`, `page_index`, `field`,
  332. `question_number`)
  333. ) ENGINE = InnoDB
  334. DEFAULT CHARSET = utf8mb4;
  335. CREATE TABLE IF NOT EXISTS `sc_question`
  336. (
  337. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  338. `exam_id` int(11) NOT NULL COMMENT '考试ID',
  339. `subject_code` varchar(32) NOT NULL COMMENT '科目代码',
  340. `paper_type` varchar(8) NOT NULL COMMENT '试卷类型',
  341. `objective` tinyint(1) NOT NULL COMMENT '是否客观题',
  342. `main_number` int(11) NOT NULL COMMENT '大题号',
  343. `sub_number` varchar(32) NOT NULL COMMENT '小题号',
  344. `main_title` varchar(128) NOT NULL COMMENT '大题名称',
  345. `total_score` double DEFAULT NULL COMMENT '满分',
  346. `creator_id` bigint DEFAULT NULL,
  347. `updater_id` bigint DEFAULT NULL,
  348. `create_time` bigint DEFAULT NULL,
  349. `update_time` bigint DEFAULT NULL,
  350. PRIMARY KEY (`id`),
  351. UNIQUE KEY `index1` (`exam_id`, `subject_code`, `objective`, `paper_type`, `main_number`, `sub_number`)
  352. ) ENGINE = InnoDB
  353. DEFAULT CHARSET = utf8mb4 COMMENT ='小题信息表';
  354. CREATE TABLE IF NOT EXISTS `sc_omr_group`
  355. (
  356. `id` bigint NOT NULL AUTO_INCREMENT,
  357. `exam_id` bigint NOT NULL,
  358. `fixed` bit(1) NOT NULL,
  359. `stage` varchar(16) NOT NULL,
  360. `conditions` text NOT NULL,
  361. `total_count` int NOT NULL,
  362. `creator_id` bigint DEFAULT NULL,
  363. `updater_id` bigint DEFAULT NULL,
  364. `create_time` bigint DEFAULT NULL,
  365. `update_time` bigint DEFAULT NULL,
  366. PRIMARY KEY (`id`),
  367. KEY `exam_fixed` (`exam_id`, `fixed`)
  368. ) ENGINE = InnoDB
  369. DEFAULT CHARSET = utf8mb4;
  370. CREATE TABLE IF NOT EXISTS `sc_refix_batch`
  371. (
  372. `id` bigint NOT NULL AUTO_INCREMENT,
  373. `exam_id` bigint NOT NULL,
  374. `card_number` int NOT NULL,
  375. `conditions` text NOT NULL,
  376. `update_slice` bit(1) NOT NULL,
  377. `total_count` int NOT NULL,
  378. `sucess_count` int NOT NULL,
  379. `finished` bit(1) NOT NULL,
  380. `creator_id` bigint DEFAULT NULL,
  381. `updater_id` bigint DEFAULT NULL,
  382. `create_time` bigint DEFAULT NULL,
  383. `update_time` bigint DEFAULT NULL,
  384. PRIMARY KEY (`id`)
  385. ) ENGINE = InnoDB
  386. DEFAULT CHARSET = utf8mb4;
  387. CREATE TABLE IF NOT EXISTS `sc_student_paper`
  388. (
  389. `student_id` bigint NOT NULL,
  390. `paper_number` int NOT NULL,
  391. `paper_id` bigint NOT NULL,
  392. `create_time` bigint DEFAULT NULL,
  393. `update_time` bigint DEFAULT NULL,
  394. PRIMARY KEY (`student_id`, `paper_number`),
  395. UNIQUE KEY `paper_id` (`paper_id`)
  396. ) ENGINE = InnoDB
  397. DEFAULT CHARSET = utf8mb4;
  398. CREATE TABLE IF NOT EXISTS `sc_subject`
  399. (
  400. `exam_id` bigint NOT NULL,
  401. `code` varchar(64) NOT NULL,
  402. `name` varchar(64) NOT NULL,
  403. `paper_type_barcode_content` text DEFAULT NULL,
  404. `creator_id` bigint DEFAULT NULL,
  405. `updater_id` bigint DEFAULT NULL,
  406. `create_time` bigint DEFAULT NULL,
  407. `update_time` bigint DEFAULT NULL,
  408. PRIMARY KEY (`exam_id`, `code`)
  409. ) ENGINE = InnoDB
  410. DEFAULT CHARSET = utf8mb4;
  411. CREATE TABLE IF NOT EXISTS `sc_file_property`
  412. (
  413. `path` varchar(255) NOT NULL,
  414. `md5` varchar(32) NOT NULL,
  415. `exam_id` bigint NOT NULL,
  416. `file_size` bigint NOT NULL,
  417. `create_time` bigint DEFAULT NULL,
  418. `update_time` bigint DEFAULT NULL,
  419. PRIMARY KEY (`path`)
  420. ) ENGINE = InnoDB
  421. DEFAULT CHARSET = utf8mb4;
  422. CREATE TABLE IF NOT EXISTS `sc_user`
  423. (
  424. `id` int(11) NOT NULL AUTO_INCREMENT,
  425. `login_name` varchar(64) NOT NULL,
  426. `name` varchar(64) NOT NULL,
  427. `password` varchar(64) NOT NULL,
  428. `role` varchar(16) NOT NULL,
  429. `enable` tinyint(1) NOT NULL,
  430. `school_id` bigint NOT NULL,
  431. `device` varchar(64) DEFAULT NULL,
  432. `creator_id` bigint DEFAULT NULL,
  433. `updater_id` bigint DEFAULT NULL,
  434. `create_time` bigint DEFAULT NULL,
  435. `update_time` bigint DEFAULT NULL,
  436. PRIMARY KEY (`id`),
  437. UNIQUE KEY `login_name` (`login_name`)
  438. ) ENGINE = InnoDB
  439. DEFAULT CHARSET = utf8mb4;
  440. CREATE TABLE IF NOT EXISTS `sc_adapte_file`
  441. (
  442. `exam_id` bigint NOT NULL,
  443. `card_number` int NOT NULL,
  444. `role` varchar(16) NOT NULL,
  445. `device` varchar(64) NOT NULL,
  446. `uri` varchar(255) NOT NULL,
  447. `md5` varchar(32) NOT NULL,
  448. `dpi` int DEFAULT NULL,
  449. `create_time` bigint DEFAULT NULL,
  450. `update_time` bigint DEFAULT NULL,
  451. PRIMARY KEY (`exam_id`, `card_number`, `role`, `device`)
  452. ) ENGINE = InnoDB
  453. DEFAULT CHARSET = utf8mb4;
  454. CREATE TABLE IF NOT EXISTS `sc_student_answer_task`
  455. (
  456. `id` bigint NOT NULL AUTO_INCREMENT,
  457. `exam_id` bigint NOT NULL,
  458. `group_id` bigint NOT NULL,
  459. `student_id` bigint NOT NULL,
  460. `status` varchar(16) NOT NULL,
  461. `device` varchar(64) DEFAULT NULL,
  462. `creator_id` bigint DEFAULT NULL,
  463. `updater_id` bigint DEFAULT NULL,
  464. `create_time` bigint DEFAULT NULL,
  465. `update_time` bigint DEFAULT NULL,
  466. PRIMARY KEY (`id`),
  467. UNIQUE KEY `group_student` (`group_id`, `student_id`),
  468. KEY `exam_status` (`exam_id`,`student_id`,`status`)
  469. ) ENGINE = InnoDB
  470. DEFAULT CHARSET = utf8mb4;
  471. CREATE TABLE IF NOT EXISTS `sc_student_answer_group`
  472. (
  473. `id` bigint NOT NULL AUTO_INCREMENT,
  474. `exam_id` bigint NOT NULL,
  475. `conditions` text NOT NULL,
  476. `total_count` int NOT NULL,
  477. `creator_id` bigint DEFAULT NULL,
  478. `updater_id` bigint DEFAULT NULL,
  479. `create_time` bigint DEFAULT NULL,
  480. `update_time` bigint DEFAULT NULL,
  481. PRIMARY KEY (`id`)
  482. ) ENGINE = InnoDB
  483. DEFAULT CHARSET = utf8mb4;
  484. CREATE TABLE IF NOT EXISTS `sc_answer_card_subject`
  485. (
  486. `exam_id` bigint NOT NULL,
  487. `card_number` int NOT NULL,
  488. `subject_code` varchar(64) NOT NULL,
  489. `create_time` bigint DEFAULT NULL,
  490. `update_time` bigint DEFAULT NULL,
  491. PRIMARY KEY (`exam_id`, `card_number`, `subject_code`)
  492. ) ENGINE = InnoDB
  493. DEFAULT CHARSET = utf8mb4;
  494. -- ----------------------------
  495. -- Table structure for sc_assigned_check_history
  496. -- ----------------------------
  497. CREATE TABLE IF NOT EXISTS `sc_assigned_check_history`
  498. (
  499. `id` bigint NOT NULL AUTO_INCREMENT,
  500. `exam_id` bigint NOT NULL,
  501. `student_id` bigint NOT NULL,
  502. `user_id` bigint NOT NULL,
  503. `creator_id` bigint DEFAULT NULL,
  504. `updater_id` bigint DEFAULT NULL,
  505. `create_time` bigint DEFAULT NULL,
  506. `update_time` bigint DEFAULT NULL,
  507. PRIMARY KEY (`id`),
  508. UNIQUE KEY `student_user` (`student_id`,`user_id`),
  509. KEY `student` (`student_id`)
  510. ) ENGINE = InnoDB
  511. DEFAULT CHARSET = utf8mb4;