textbook_sql.sql 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. -- ----------------------------
  2. -- 2024-12-13 14:36
  3. -- 教材基础信息表
  4. -- ----------------------------
  5. drop table if exists textbook;
  6. create table `textbook`
  7. (
  8. id bigint not null comment '主键编号'
  9. primary key,
  10. create_user_id bigint null comment '创建人',
  11. create_date datetime null comment '创建时间',
  12. modify_user_id bigint null comment '修改人',
  13. modify_date datetime null comment '修改时间',
  14. delete_mark int not null comment '删除标记',
  15. enabled_mark int not null comment '有效标志',
  16. sort_code int null comment '序号',
  17. subject_group_id bigint not null comment '学科组管理编号(subject_group)',
  18. course_subject_id bigint not null comment '课程编号(base_course_subject)',
  19. use_type int null default 1 comment '使用类型(单位:学期)',
  20. issn varchar(200) not null unique comment '国际标准刊号',
  21. isbn varchar(200) not null unique comment '国际标准书号',
  22. book_name varchar(200) not null comment '书名',
  23. publishing_house varchar(200) null default '/' comment '出版社',
  24. editor_in_chief varchar(200) null default '/' comment '主编',
  25. version varchar(100) null default '/' comment '版本',
  26. is_textbook_plan int null default 0 comment '是否为规划教材',
  27. textbook_type varchar(20) null comment '教材分类(xjr_dictionary_item[textbook_type])',
  28. specifications_models varchar(100) null default '/' comment '规格型号',
  29. publishing_date datetime null comment '出版日期',
  30. is_secd int null default 0 comment '是否校企合作开发教材',
  31. category varchar(50) null default '/' comment '分类号',
  32. plan_batch varchar(50) null default '/' comment '规划批次',
  33. work_total_count int null default 0 comment '编著作总数',
  34. textbook_category varchar(30) null default '/' comment '教材类型',
  35. price decimal(10, 2) null default 0 comment '定价(元)',
  36. discount float null default 10 comment '预估折扣'
  37. ) engine = innodb
  38. default charset = utf8mb4
  39. collate = utf8mb4_0900_ai_ci comment ='教材基础信息表';
  40. -- ----------------------------
  41. -- 2024-12-13 14:36
  42. -- 教材征订记录表
  43. -- ----------------------------
  44. drop table if exists textbook_subscription;
  45. create table `textbook_subscription`
  46. (
  47. id bigint not null comment '主键编号'
  48. primary key,
  49. create_user_id bigint null comment '创建人',
  50. create_date datetime null comment '创建时间',
  51. modify_user_id bigint null comment '修改人',
  52. modify_date datetime null comment '修改时间',
  53. delete_mark int not null comment '删除标记',
  54. enabled_mark int not null comment '有效标志',
  55. sort_code int null comment '序号',
  56. remark varchar(1000) null comment '备注',
  57. base_semester_id bigint not null comment '学期id(base_semester)',
  58. subscription_method int not null comment '征订方式(1:按班级征订 2:按教材征订)',
  59. base_class_ids varchar(1000) null comment '按班级征订征订的班级主键(base_class)',
  60. sum int null default 0 comment '征订教材总数',
  61. status int null default 0 comment '征订状态(1:结束 0:未结束)'
  62. ) engine = innodb
  63. default charset = utf8mb4
  64. collate = utf8mb4_0900_ai_ci comment ='教材教辅征订记录表';
  65. -- ----------------------------
  66. -- 2024-12-13 14:36
  67. -- 教材征订记录与班级关联表
  68. -- ----------------------------
  69. drop table if exists textbook_subscription_class;
  70. create table `textbook_subscription_class`
  71. (
  72. id bigint not null comment '主键编号'
  73. primary key,
  74. create_user_id bigint null comment '创建人',
  75. create_date datetime null comment '创建时间',
  76. modify_user_id bigint null comment '修改人',
  77. modify_date datetime null comment '修改时间',
  78. delete_mark int not null comment '删除标记',
  79. enabled_mark int not null comment '有效标志',
  80. sort_code int null comment '序号',
  81. remark varchar(1000) null comment '备注',
  82. textbook_subscription_id bigint not null comment '教材征订记录表id(textbook_subscription)',
  83. base_class_id bigint not null comment '按班级征订中征订的班级主键(base_class)'
  84. ) engine = innodb
  85. default charset = utf8mb4
  86. collate = utf8mb4_0900_ai_ci comment ='教材征订记录与班级关联表';
  87. -- ----------------------------
  88. -- 2024-12-13 14:36
  89. -- 教材征订记录详情表
  90. -- ----------------------------
  91. drop table if exists textbook_subscription_item;
  92. create table `textbook_subscription_item`
  93. (
  94. id bigint not null comment '主键编号'
  95. primary key,
  96. create_user_id bigint null comment '创建人',
  97. create_date datetime null comment '创建时间',
  98. modify_user_id bigint null comment '修改人',
  99. modify_date datetime null comment '修改时间',
  100. delete_mark int not null comment '删除标记',
  101. enabled_mark int not null comment '有效标志',
  102. sort_code int null comment '序号',
  103. textbook_subscription_id bigint not null comment '教材教辅增订记录表主键(textbook_subscription)',
  104. textbook_id bigint null comment '教材表主键(textbook)',
  105. student_num int null default 0 comment '学生用书征订数量',
  106. teacher_num int null default 0 comment '教师用书征订数量',
  107. discount float null default 10 comment '实际折扣',
  108. price decimal(10, 2) null default 0 comment '实际价格(元)',
  109. in_stock_num int null default 0 comment '当前征订任务征订项入库数量',
  110. out_stock_num int null default 0 comment '当前征订任务征订项出库数量',
  111. alteration_type int null default 0 comment '变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)'
  112. ) engine = innodb
  113. default charset = utf8mb4
  114. collate = utf8mb4_0900_ai_ci comment ='教材征订记录详情表';
  115. -- ----------------------------
  116. -- 2024-12-13 14:36
  117. -- 教材征订记录详情变更记录表
  118. -- ----------------------------
  119. drop table if exists textbook_subscription_item_history;
  120. create table `textbook_subscription_item_history`
  121. (
  122. id bigint not null comment '主键编号'
  123. primary key,
  124. create_user_id bigint null comment '创建人',
  125. create_date datetime null comment '创建时间',
  126. modify_user_id bigint null comment '修改人',
  127. modify_date datetime null comment '修改时间',
  128. delete_mark int not null comment '删除标记',
  129. enabled_mark int not null comment '有效标志',
  130. sort_code int null comment '序号',
  131. textbook_subscription_id bigint not null comment '教材教辅征订编号',
  132. textbook_subscription_item_id bigint not null comment '教材教辅征订项编号',
  133. textbook_id bigint null comment '教材表主键(textbook)',
  134. student_num int null default 0 comment '学生用书征订数量',
  135. teacher_num int null default 0 comment '教师用书征订数量',
  136. discount float null default 10 comment '实际折扣',
  137. price decimal(10, 2) null default 0 comment '实际价格(元)',
  138. in_stock_num int null default 0 comment '当前征订任务征订项入库数量',
  139. out_stock_num int null default 0 comment '当前征订任务征订项出库数量',
  140. alteration_type int null default 0 comment '变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)'
  141. ) engine = innodb
  142. default charset = utf8mb4
  143. collate = utf8mb4_0900_ai_ci comment ='教材教辅征订项变更历史';
  144. -- ----------------------------
  145. -- 2024-12-13 14:36
  146. -- 教材入库记录
  147. -- ----------------------------
  148. drop table if exists textbook_warehouse_record;
  149. create table `textbook_warehouse_record`
  150. (
  151. id bigint not null comment '主键编号'
  152. primary key,
  153. create_user_id bigint null comment '创建人',
  154. create_date datetime null comment '创建时间',
  155. modify_user_id bigint null comment '修改人',
  156. modify_date datetime null comment '修改时间',
  157. delete_mark int not null comment '删除标记',
  158. enabled_mark int not null comment '有效标志',
  159. sort_code int null comment '序号',
  160. warehouse_mode varchar(20) null comment '入库方式(xjr_dictionary_item[warehouse_mode])',
  161. data_id bigint null comment '数据编号(根据入库方式,编号来自不同数据表)',
  162. data_item_id bigint null comment '数据项项编号(根据入库方式,编号来自不同数据表)',
  163. textbook_id bigint null comment '教材管理编号',
  164. price decimal(10, 2) null comment '定价(元)',
  165. warehouse_number int null comment '入库数量',
  166. source varchar(200) null comment '来源',
  167. discount float null comment '实际折扣',
  168. subtotal decimal(10, 2) null comment '实际价格(元)',
  169. total_price decimal(10, 2) null comment '总价(元)',
  170. remark varchar(1000) null comment '备注'
  171. )engine = innodb
  172. default charset = utf8mb4
  173. collate = utf8mb4_0900_ai_ci comment ='教材入库记录';
  174. # drop table if exists textbook_subscription_record;
  175. # create table `textbook_subscription_record`
  176. # (
  177. # id bigint not null comment '主键编号'
  178. # primary key,
  179. # create_user_id bigint null comment '创建人',
  180. # create_date datetime null comment '创建时间',
  181. # modify_user_id bigint null comment '修改人',
  182. # modify_date datetime null comment '修改时间',
  183. # delete_mark int not null comment '删除标记',
  184. # enabled_mark int not null comment '有效标志',
  185. # sort_code int null comment '序号',
  186. #
  187. # textbook_subscription_id bigint null comment '教材征订编号',
  188. # textbook_subscription_item_id bigint null comment '教材征订项编号'
  189. # ) engine = innodb
  190. # default charset = utf8mb4
  191. # collate = utf8mb4_0900_ai_ci comment ='教材征订记录';
  192. create table if not exists tl.textbook_claim_user
  193. (
  194. id bigint not null comment '主键编号'
  195. primary key,
  196. create_user_id bigint null comment '创建人',
  197. create_date datetime null comment '创建时间',
  198. modify_user_id bigint null comment '修改人',
  199. modify_date datetime null comment '修改时间',
  200. delete_mark int not null comment '删除标记',
  201. enabled_mark int not null comment '有效标志',
  202. sort_code int null comment '序号',
  203. wf_textbook_claim_id bigint null comment '教材申领编号',
  204. user_id bigint null comment '用户编号',
  205. user_type int default 2 null comment '用户类型(1:学生 2=教师)'
  206. )
  207. comment '教材领取人员';
  208. create table if not exists tl.textbook_class_relation
  209. (
  210. id bigint not null comment '主键编号'
  211. primary key,
  212. create_user_id bigint null comment '创建人',
  213. create_date datetime null comment '创建时间',
  214. modify_user_id bigint null comment '修改人',
  215. modify_date datetime null comment '修改时间',
  216. delete_mark int not null comment '删除标记',
  217. enabled_mark int not null comment '有效标志',
  218. sort_code int null comment '序号',
  219. textbook_id bigint null comment '教材管理编号',
  220. class_id bigint null comment '班级编号'
  221. )
  222. comment '教材班级引用';
  223. create table if not exists tl.textbook_core_attribute
  224. (
  225. id bigint not null comment '主键编号'
  226. primary key,
  227. create_user_id bigint null comment '创建人',
  228. create_date datetime null comment '创建时间',
  229. modify_user_id bigint null comment '修改人',
  230. modify_date datetime null comment '修改时间',
  231. delete_mark int not null comment '删除标记',
  232. enabled_mark int not null comment '有效标志',
  233. sort_code int null comment '序号',
  234. issn varchar(200) null comment '国际标准刊号',
  235. isbn varchar(200) null comment '国际标准书号',
  236. book_name varchar(200) null comment '书名',
  237. publishing_house varchar(200) null comment '出版社',
  238. editor_in_chief varchar(200) null comment '主编'
  239. )
  240. comment '教材核心信息管理';
  241. create table if not exists tl.textbook_issue_record
  242. (
  243. id bigint not null comment '主键编号'
  244. primary key,
  245. create_user_id bigint null comment '创建人',
  246. create_date datetime null comment '创建时间',
  247. modify_user_id bigint null comment '修改人',
  248. modify_date datetime null comment '修改时间',
  249. delete_mark int not null comment '删除标记',
  250. enabled_mark int not null comment '有效标志',
  251. sort_code int null comment '序号',
  252. textbook_id bigint null comment '教材管理编号',
  253. data_id bigint null comment '数据编号(根据出库方式,编号来自不同数据表)',
  254. data_item_id bigint null comment '数据项项编号(根据出库方式,编号来自不同数据表)',
  255. issue_number int null comment '出库数量',
  256. remaining_number int null comment '剩余数量',
  257. receive_user_id bigint null comment '领取用户编号',
  258. issue_user_id bigint null comment '出库用户编号',
  259. issue_mode varchar(20) null comment '出库方式(xjr_dictionary_item[issue_mode])',
  260. remark varchar(1000) null comment '备注'
  261. )
  262. comment '教材出库记录';
  263. create table if not exists tl.textbook_student_claim
  264. (
  265. id bigint not null comment '主键编号'
  266. primary key,
  267. create_user_id bigint null comment '创建人',
  268. create_date datetime null comment '创建时间',
  269. modify_user_id bigint null comment '修改人',
  270. modify_date datetime null comment '修改时间',
  271. delete_mark int not null comment '删除标记',
  272. enabled_mark int not null comment '有效标志',
  273. sort_code int null comment '序号',
  274. base_semester_id bigint null comment '学期id(base_semester)',
  275. class_id bigint null comment '班级编号',
  276. student_user_id bigint null comment '学生用户编号',
  277. textbook_id bigint null comment '教材管理编号',
  278. is_claim int default 0 not null comment '是否领取(1:已领取 0:未领取)',
  279. remark varchar(1000) null comment '备注'
  280. )
  281. comment '学生教材认领记录';
  282. create table if not exists tl.wf_textbook_claim
  283. (
  284. id bigint not null comment '主键编号'
  285. primary key,
  286. create_user_id bigint null comment '创建人',
  287. create_date datetime null comment '创建时间',
  288. modify_user_id bigint null comment '修改人',
  289. modify_date datetime null comment '修改时间',
  290. delete_mark int not null comment '删除标记',
  291. enabled_mark int not null comment '有效标志',
  292. sort_code int null comment '序号',
  293. applicant_user_id bigint null comment '申请人',
  294. class_id bigint null comment '班级编号',
  295. base_semester_id bigint null comment '学期id(base_semester)',
  296. student_user_id bigint null comment '学生编号',
  297. claim_address varchar(1000) null comment '领取地点',
  298. claim_type varchar(20) null comment '申领类型(xjr_dictionary_item[claim_type])',
  299. receive_user_id varchar(1000) null comment '代领取人',
  300. claim_user_id bigint null comment '领取用户编号(申请人帮领取人申请去领取)',
  301. status int default 0 not null comment '状态(1:结束 0:未结束)',
  302. textbook_type varchar(20) null comment '教材分类(xjr_dictionary_item[textbook_type])'
  303. )
  304. comment '教材申领';
  305. create table if not exists tl.wf_textbook_claim_item
  306. (
  307. id bigint not null comment '主键编号'
  308. primary key,
  309. create_user_id bigint null comment '创建人',
  310. create_date datetime null comment '创建时间',
  311. modify_user_id bigint null comment '修改人',
  312. modify_date datetime null comment '修改时间',
  313. delete_mark int not null comment '删除标记',
  314. enabled_mark int not null comment '有效标志',
  315. sort_code int null comment '序号',
  316. wf_textbook_claim_id bigint null comment '教材申领编号',
  317. textbook_id bigint null comment '教材管理编号',
  318. applicant_number int default 0 null comment '申请数量',
  319. issue_number int default 0 null comment '已发放数量'
  320. )
  321. comment '教材申领项';
  322. create table if not exists tl.wf_textbook_recede
  323. (
  324. id bigint not null comment '主键编号'
  325. primary key,
  326. create_user_id bigint null comment '创建人',
  327. create_date datetime null comment '创建时间',
  328. modify_user_id bigint null comment '修改人',
  329. modify_date datetime null comment '修改时间',
  330. delete_mark int not null comment '删除标记',
  331. enabled_mark int not null comment '有效标志',
  332. sort_code int null comment '序号',
  333. applicant_user_id bigint null comment '申请人',
  334. base_semester_id bigint null comment '学期id(base_semester)',
  335. class_id bigint null comment '班级编号',
  336. recede_type varchar(20) null comment '退书类型(xjr_dictionary_item[recede_type])',
  337. recede_address varchar(1000) null comment '退还地点',
  338. status int default 0 not null comment '状态(1:结束 0:未结束)'
  339. )
  340. comment '退书申请';
  341. create table if not exists tl.wf_textbook_recede_item
  342. (
  343. id bigint not null comment '主键编号'
  344. primary key,
  345. create_user_id bigint null comment '创建人',
  346. create_date datetime null comment '创建时间',
  347. modify_user_id bigint null comment '修改人',
  348. modify_date datetime null comment '修改时间',
  349. delete_mark int not null comment '删除标记',
  350. enabled_mark int not null comment '有效标志',
  351. sort_code int null comment '序号',
  352. wf_textbook_recede_id bigint null comment '退书申请编号',
  353. textbook_id bigint null comment '教材管理编号',
  354. number int null comment '数量'
  355. )
  356. comment '退书申请项';
  357. create table if not exists tl.wf_textbook_subscription_item
  358. (
  359. id bigint not null comment '主键编号'
  360. primary key,
  361. create_user_id bigint null comment '创建人',
  362. create_date datetime null comment '创建时间',
  363. modify_user_id bigint null comment '修改人',
  364. modify_date datetime null comment '修改时间',
  365. delete_mark int not null comment '删除标记',
  366. enabled_mark int not null comment '有效标志',
  367. sort_code int null comment '序号',
  368. wf_textbook_subscription_id bigint null comment '教材教辅征订编号',
  369. subscription_type varchar(20) null comment '征订类型(xjr_dictionary_item[subscription_type])',
  370. issn varchar(200) null comment '国际标准刊号',
  371. isbn varchar(200) null comment '国际标准书号',
  372. book_name varchar(200) null comment '书名',
  373. publishing_house varchar(200) null comment '出版社',
  374. editor_in_chief varchar(200) null comment '主编',
  375. appraisal_price decimal(10, 2) null comment '估价(元)',
  376. is_textbook_plan varchar(20) null comment '是否为规划教材(xjr_dictionary_item[judgment_method_1])',
  377. course_subject_id bigint null comment '课程编号(base_course_subject)',
  378. class_ids varchar(1000) null comment '班级编号(多个)',
  379. student_subscription_number int null comment '学生用书征订数量',
  380. teacher_subscription_number int null comment '教师教材征订数量',
  381. teacher_reference_number int null comment '教师教参用书征订数量',
  382. is_support_resources varchar(20) null comment '是否有配套教学资源(xjr_dictionary_item[judgment_method_1])',
  383. version varchar(100) null comment '版本',
  384. textbook_id bigint null comment '教材id',
  385. in_stockroom_num int default 0 null comment '当前征订任务征订项已经入库数量',
  386. alteration_type int default 0 null comment '变更类型(0:未变更,1:变更征订数量,2:变更课程)'
  387. )
  388. comment '教材教辅征订项';