scan_central_db.sql 21 KB

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