textbook_sql.sql 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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 date 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. -- ----------------------------
  175. -- 2024-12-13 14:36
  176. -- 教材申领
  177. -- ----------------------------
  178. drop table if exists wf_textbook_claim;
  179. create table `wf_textbook_claim`
  180. (
  181. id bigint not null comment '主键编号'
  182. primary key,
  183. create_user_id bigint null comment '创建人',
  184. create_date datetime null comment '创建时间',
  185. modify_user_id bigint null comment '修改人',
  186. modify_date datetime null comment '修改时间',
  187. delete_mark int not null comment '删除标记',
  188. enabled_mark int not null comment '有效标志',
  189. sort_code int null comment '序号',
  190. applicant_user_id bigint null comment '申请人',
  191. base_semester_id bigint null comment '学期id(base_semester)',
  192. claim_type varchar(20) null comment '申领类型(xjr_dictionary_item[claim_type])',
  193. -- 班主任帮学生申请领取或者学生自己申请领取
  194. class_id bigint null comment '班级编号',
  195. student_user_id bigint null comment '负责领取学生编号',
  196. claim_address varchar(1000) null comment '领取地点',
  197. receive_user_id varchar(1000) null comment '代领取人',
  198. claim_user_id bigint null comment '实际领取用户编号(申请人帮领取人申请去领取)',
  199. status int default 0 not null comment '状态(1:结束 0:未结束)'
  200. )engine = innodb
  201. default charset = utf8mb4
  202. collate = utf8mb4_0900_ai_ci comment ='教材申领';
  203. -- ----------------------------
  204. -- 2024-12-13 14:36
  205. -- 教材申领项
  206. -- ----------------------------
  207. drop table if exists wf_textbook_claim_item;
  208. create table `wf_textbook_claim_item`
  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. wf_textbook_claim_id bigint null comment '教材申领编号',
  220. textbook_id bigint null comment '教材管理编号',
  221. applicant_number int default 0 null comment '申请数量',
  222. issue_number int default 0 null comment '已发放数量'
  223. )engine = innodb
  224. default charset = utf8mb4
  225. collate = utf8mb4_0900_ai_ci comment ='教材申领项';
  226. -- ----------------------------
  227. -- 2024-12-13 14:36
  228. -- 教材申领项与教材征订项关联表
  229. -- ----------------------------
  230. drop table if exists claim_item_subscription_item;
  231. create table `claim_item_subscription_item`
  232. (
  233. id bigint not null comment '主键编号'
  234. primary key,
  235. create_user_id bigint null comment '创建人',
  236. create_date datetime null comment '创建时间',
  237. modify_user_id bigint null comment '修改人',
  238. modify_date datetime null comment '修改时间',
  239. delete_mark int not null comment '删除标记',
  240. enabled_mark int not null comment '有效标志',
  241. sort_code int null comment '序号',
  242. wf_textbook_claim_item_id bigint null comment '教材申领编号',
  243. textbook_subscription_item_id bigint null comment '教材征订编号',
  244. issue_number int default 0 null comment '已发放数量'
  245. )engine = innodb
  246. default charset = utf8mb4
  247. collate = utf8mb4_0900_ai_ci comment ='教材申领项与教材征订项关联表';
  248. -- ----------------------------
  249. -- 2024-12-13 14:36
  250. -- 教材领取人员
  251. -- ----------------------------
  252. drop table if exists textbook_claim_user;
  253. create table `textbook_claim_user`
  254. (
  255. id bigint not null comment '主键编号'
  256. primary key,
  257. create_user_id bigint null comment '创建人',
  258. create_date datetime null comment '创建时间',
  259. modify_user_id bigint null comment '修改人',
  260. modify_date datetime null comment '修改时间',
  261. delete_mark int not null comment '删除标记',
  262. enabled_mark int not null comment '有效标志',
  263. sort_code int null comment '序号',
  264. wf_textbook_claim_id bigint null comment '教材申领编号',
  265. user_id bigint null comment '用户编号',
  266. user_type int default 2 null comment '用户类型(1:学生 2=教师)'
  267. )engine = innodb
  268. default charset = utf8mb4
  269. collate = utf8mb4_0900_ai_ci comment ='教材领取人员';
  270. -- ----------------------------
  271. -- 2024-12-13 14:36
  272. -- 教材出库记录
  273. -- ----------------------------
  274. drop table if exists textbook_issue_record;
  275. create table `textbook_issue_record`
  276. (
  277. id bigint not null comment '主键编号'
  278. primary key,
  279. create_user_id bigint null comment '创建人',
  280. create_date datetime null comment '创建时间',
  281. modify_user_id bigint null comment '修改人',
  282. modify_date datetime null comment '修改时间',
  283. delete_mark int not null comment '删除标记',
  284. enabled_mark int not null comment '有效标志',
  285. sort_code int null comment '序号',
  286. issue_mode varchar(20) null comment '出库方式(xjr_dictionary_item[issue_mode])',
  287. data_id bigint null comment '数据编号(根据出库方式,编号来自不同数据表)',
  288. data_item_id bigint null comment '数据项项编号(根据出库方式,编号来自不同数据表)',
  289. textbook_id bigint null comment '教材管理编号',
  290. issue_number int null comment '出库数量',
  291. remaining_number int null comment '剩余未出库数量',
  292. receive_user_id bigint null comment '领取用户编号',
  293. issue_user_id bigint null comment '出库用户编号',
  294. remark varchar(1000) null comment '备注'
  295. )engine = innodb
  296. default charset = utf8mb4
  297. collate = utf8mb4_0900_ai_ci comment ='教材出库记录';
  298. -- ----------------------------
  299. -- 2024-12-13 14:36
  300. -- 学生教材认领记录
  301. -- ----------------------------
  302. drop table if exists textbook_student_claim;
  303. create table `textbook_student_claim`
  304. (
  305. id bigint not null comment '主键编号'
  306. primary key,
  307. create_user_id bigint null comment '创建人',
  308. create_date datetime null comment '创建时间',
  309. modify_user_id bigint null comment '修改人',
  310. modify_date datetime null comment '修改时间',
  311. delete_mark int not null comment '删除标记',
  312. enabled_mark int not null comment '有效标志',
  313. sort_code int null comment '序号',
  314. base_semester_id bigint null comment '学期id(base_semester)',
  315. class_id bigint null comment '班级编号',
  316. student_user_id bigint null comment '学生用户编号',
  317. textbook_id bigint null comment '教材管理编号',
  318. is_claim int default 0 not null comment '是否领取(1:已领取 0:未领取)',
  319. remark varchar(1000) null comment '备注'
  320. )engine = innodb
  321. default charset = utf8mb4
  322. collate = utf8mb4_0900_ai_ci comment ='学生教材认领记录';
  323. -- ----------------------------
  324. -- 2024-12-13 14:36
  325. -- 退书申请
  326. -- ----------------------------
  327. drop table if exists wf_textbook_recede;
  328. create table `wf_textbook_recede`
  329. (
  330. id bigint not null comment '主键编号'
  331. primary key,
  332. create_user_id bigint null comment '创建人',
  333. create_date datetime null comment '创建时间',
  334. modify_user_id bigint null comment '修改人',
  335. modify_date datetime null comment '修改时间',
  336. delete_mark int not null comment '删除标记',
  337. enabled_mark int not null comment '有效标志',
  338. sort_code int null comment '序号',
  339. applicant_user_id bigint null comment '申请人',
  340. recede_type varchar(20) null comment '退书类型(xjr_dictionary_item[recede_type])',
  341. base_semester_id bigint null comment '学期id(base_semester)',
  342. class_id bigint null comment '班级编号',
  343. recede_address varchar(1000) null comment '退还地点',
  344. status int default 0 not null comment '状态(1:结束 0:未结束)'
  345. )engine = innodb
  346. default charset = utf8mb4
  347. collate = utf8mb4_0900_ai_ci comment ='退书申请';
  348. -- ----------------------------
  349. -- 2024-12-13 14:36
  350. -- 退书申请项
  351. -- ----------------------------
  352. drop table if exists wf_textbook_recede_item;
  353. create table `wf_textbook_recede_item`
  354. (
  355. id bigint not null comment '主键编号'
  356. primary key,
  357. create_user_id bigint null comment '创建人',
  358. create_date datetime null comment '创建时间',
  359. modify_user_id bigint null comment '修改人',
  360. modify_date datetime null comment '修改时间',
  361. delete_mark int not null comment '删除标记',
  362. enabled_mark int not null comment '有效标志',
  363. sort_code int null comment '序号',
  364. wf_textbook_recede_id bigint null comment '退书申请编号',
  365. textbook_id bigint null comment '教材管理编号',
  366. number int null comment '数量'
  367. )engine = innodb
  368. default charset = utf8mb4
  369. collate = utf8mb4_0900_ai_ci comment ='退书申请项';