scan_central_db.sql 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  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. `creator_id` bigint DEFAULT NULL,
  268. `updater_id` bigint DEFAULT NULL,
  269. `create_time` bigint DEFAULT NULL,
  270. `update_time` bigint DEFAULT NULL,
  271. PRIMARY KEY (`batch_id`, `student_id`, `paper_number`),
  272. UNIQUE KEY `paper_id` (`paper_id`)
  273. ) ENGINE = InnoDB
  274. DEFAULT CHARSET = utf8mb4;
  275. CREATE TABLE IF NOT EXISTS `sc_paper`
  276. (
  277. `id` bigint NOT NULL AUTO_INCREMENT,
  278. `exam_id` bigint NOT NULL,
  279. `card_number` int NOT NULL,
  280. `number` int NOT NULL,
  281. `page_count` int NOT NULL,
  282. `mismatch` bit(1) NOT NULL,
  283. `assigned` bit(1) NOT NULL,
  284. `assigned_suspect` bit(1) NOT NULL,
  285. `question_filled` bit(1) NOT NULL,
  286. `subjective_filled` bit(1) NOT NULL,
  287. `omr_exam_number` varchar(255) NOT NULL,
  288. `creator_id` bigint DEFAULT NULL,
  289. `updater_id` bigint DEFAULT NULL,
  290. `create_time` bigint DEFAULT NULL,
  291. `update_time` bigint DEFAULT NULL,
  292. PRIMARY KEY (`id`),
  293. KEY `mismatch` (`exam_id`, `mismatch`)
  294. ) ENGINE = InnoDB
  295. DEFAULT CHARSET = utf8mb4;
  296. CREATE TABLE IF NOT EXISTS `sc_paper_page`
  297. (
  298. `paper_id` bigint NOT NULL,
  299. `page_index` int NOT NULL,
  300. `absent` text DEFAULT NULL,
  301. `breach` text DEFAULT NULL,
  302. `paper_type` text DEFAULT NULL,
  303. `question` text DEFAULT NULL,
  304. `selective` text DEFAULT NULL,
  305. `sheet_path` varchar(255) NOT NULL,
  306. `slice_path` text DEFAULT NULL,
  307. `recog_data` longtext DEFAULT NULL,
  308. `creator_id` bigint DEFAULT NULL,
  309. `updater_id` bigint DEFAULT NULL,
  310. `create_time` bigint DEFAULT NULL,
  311. `update_time` bigint DEFAULT NULL,
  312. PRIMARY KEY (`paper_id`, `page_index`)
  313. ) ENGINE = InnoDB
  314. DEFAULT CHARSET = utf8mb4;
  315. CREATE TABLE IF NOT EXISTS `sc_paper_structure`
  316. (
  317. `id` bigint NOT NULL AUTO_INCREMENT,
  318. `exam_id` bigint NOT NULL,
  319. `card_number` int NOT NULL,
  320. `paper_number` int NOT NULL,
  321. `page_index` int NOT NULL,
  322. `field` varchar(16) NOT NULL,
  323. `question_number` int NOT NULL,
  324. `single` bit(1) NOT NULL,
  325. `creator_id` bigint DEFAULT NULL,
  326. `updater_id` bigint DEFAULT NULL,
  327. `create_time` bigint DEFAULT NULL,
  328. `update_time` bigint DEFAULT NULL,
  329. PRIMARY KEY (`id`),
  330. UNIQUE KEY `IDX_PAPER_STRUCTURE_001` (`exam_id`, `card_number`, `paper_number`, `page_index`, `field`,
  331. `question_number`)
  332. ) ENGINE = InnoDB
  333. DEFAULT CHARSET = utf8mb4;
  334. CREATE TABLE IF NOT EXISTS `sc_question`
  335. (
  336. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  337. `exam_id` int(11) NOT NULL COMMENT '考试ID',
  338. `subject_code` varchar(32) NOT NULL COMMENT '科目代码',
  339. `paper_type` varchar(8) NOT NULL COMMENT '试卷类型',
  340. `objective` tinyint(1) NOT NULL COMMENT '是否客观题',
  341. `main_number` int(11) NOT NULL COMMENT '大题号',
  342. `sub_number` varchar(32) NOT NULL COMMENT '小题号',
  343. `main_title` varchar(128) NOT NULL COMMENT '大题名称',
  344. `total_score` double DEFAULT NULL COMMENT '满分',
  345. `creator_id` bigint DEFAULT NULL,
  346. `updater_id` bigint DEFAULT NULL,
  347. `create_time` bigint DEFAULT NULL,
  348. `update_time` bigint DEFAULT NULL,
  349. PRIMARY KEY (`id`),
  350. UNIQUE KEY `index1` (`exam_id`, `subject_code`, `objective`, `paper_type`, `main_number`, `sub_number`)
  351. ) ENGINE = InnoDB
  352. DEFAULT CHARSET = utf8mb4 COMMENT ='小题信息表';
  353. CREATE TABLE IF NOT EXISTS `sc_omr_group`
  354. (
  355. `id` bigint NOT NULL AUTO_INCREMENT,
  356. `exam_id` bigint NOT NULL,
  357. `fixed` bit(1) NOT NULL,
  358. `stage` varchar(16) NOT NULL,
  359. `conditions` text NOT NULL,
  360. `total_count` int NOT NULL,
  361. `creator_id` bigint DEFAULT NULL,
  362. `updater_id` bigint DEFAULT NULL,
  363. `create_time` bigint DEFAULT NULL,
  364. `update_time` bigint DEFAULT NULL,
  365. PRIMARY KEY (`id`),
  366. KEY `exam_fixed` (`exam_id`, `fixed`)
  367. ) ENGINE = InnoDB
  368. DEFAULT CHARSET = utf8mb4;
  369. CREATE TABLE IF NOT EXISTS `sc_refix_batch`
  370. (
  371. `id` bigint NOT NULL AUTO_INCREMENT,
  372. `exam_id` bigint NOT NULL,
  373. `card_number` int NOT NULL,
  374. `conditions` text NOT NULL,
  375. `update_slice` bit(1) NOT NULL,
  376. `total_count` int NOT NULL,
  377. `sucess_count` int NOT NULL,
  378. `finished` bit(1) NOT NULL,
  379. `creator_id` bigint DEFAULT NULL,
  380. `updater_id` bigint DEFAULT NULL,
  381. `create_time` bigint DEFAULT NULL,
  382. `update_time` bigint DEFAULT NULL,
  383. PRIMARY KEY (`id`)
  384. ) ENGINE = InnoDB
  385. DEFAULT CHARSET = utf8mb4;
  386. CREATE TABLE IF NOT EXISTS `sc_student_paper`
  387. (
  388. `student_id` bigint NOT NULL,
  389. `paper_number` int NOT NULL,
  390. `paper_id` bigint NOT NULL,
  391. `create_time` bigint DEFAULT NULL,
  392. `update_time` bigint DEFAULT NULL,
  393. PRIMARY KEY (`student_id`, `paper_number`),
  394. UNIQUE KEY `paper_id` (`paper_id`)
  395. ) ENGINE = InnoDB
  396. DEFAULT CHARSET = utf8mb4;
  397. CREATE TABLE IF NOT EXISTS `sc_subject`
  398. (
  399. `exam_id` bigint NOT NULL,
  400. `code` varchar(64) NOT NULL,
  401. `name` varchar(64) NOT NULL,
  402. `paper_type_barcode_content` text DEFAULT NULL,
  403. `creator_id` bigint DEFAULT NULL,
  404. `updater_id` bigint DEFAULT NULL,
  405. `create_time` bigint DEFAULT NULL,
  406. `update_time` bigint DEFAULT NULL,
  407. PRIMARY KEY (`exam_id`, `code`)
  408. ) ENGINE = InnoDB
  409. DEFAULT CHARSET = utf8mb4;
  410. CREATE TABLE IF NOT EXISTS `sc_file_property`
  411. (
  412. `path` varchar(255) NOT NULL,
  413. `md5` varchar(32) NOT NULL,
  414. `exam_id` bigint NOT NULL,
  415. `file_size` bigint NOT NULL,
  416. `create_time` bigint DEFAULT NULL,
  417. `update_time` bigint DEFAULT NULL,
  418. PRIMARY KEY (`path`)
  419. ) ENGINE = InnoDB
  420. DEFAULT CHARSET = utf8mb4;
  421. CREATE TABLE IF NOT EXISTS `sc_user`
  422. (
  423. `id` int(11) NOT NULL AUTO_INCREMENT,
  424. `login_name` varchar(64) NOT NULL,
  425. `name` varchar(64) NOT NULL,
  426. `password` varchar(64) NOT NULL,
  427. `role` varchar(16) NOT NULL,
  428. `enable` tinyint(1) 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;
  510. CREATE TABLE IF NOT EXISTS `sc_device`
  511. (
  512. `id` int(11) NOT NULL AUTO_INCREMENT,
  513. `device` varchar(64) NOT NULL,
  514. `device_name` varchar(64) NOT NULL,
  515. `creator_id` bigint DEFAULT NULL,
  516. `updater_id` bigint DEFAULT NULL,
  517. `create_time` bigint DEFAULT NULL,
  518. `update_time` bigint DEFAULT NULL,
  519. PRIMARY KEY (`id`),
  520. UNIQUE KEY `login_name` (`login_name`)
  521. ) ENGINE = InnoDB
  522. DEFAULT CHARSET = utf8mb4;