scan_db.sql 17 KB

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