scan_central_db.sql 20 KB

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