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