textbook_sql.sql 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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. issn varchar(200) null comment '国际标准刊号',
  18. isbn varchar(200) null comment '国际标准书号',
  19. book_name varchar(200) null comment '书名',
  20. publishing_house varchar(200) null comment '出版社',
  21. editor_in_chief varchar(200) null comment '主编',
  22. subject_group_id bigint null comment '学科组管理编号(subject_group)',
  23. base_semester_id bigint null comment '学期ID(base_semester)',
  24. course_subject_id bigint null comment '课程编号(base_course_subject)',
  25. grade_id bigint null comment '入学年级(base_grade)',
  26. version varchar(100) null comment '版本',
  27. is_textbook_plan varchar(20) null comment '是否为规划教材(xjr_dictionary_item[judgment_method_1])',
  28. textbook_type varchar(20) null comment '教材分类(xjr_dictionary_item[textbook_type])',
  29. specifications_models varchar(100) null comment '规格型号',
  30. appraisal_price decimal(10, 2) null comment '估价(元)',
  31. price decimal(10, 2) null comment '定价(元)',
  32. discount float null comment '折扣',
  33. subtotal decimal(10, 2) null comment '小计(元)',
  34. stock int null comment '库存',
  35. textbook_core_attribute_id bigint not null comment '教材核心信息管理id(textbook_core_attribute)',
  36. use_type int null comment '使用类型(单位:学期)',
  37. publishing_date datetime null comment '出版日期',
  38. is_secd int null comment '是否校企合作开发教材',
  39. category varchar(50) null comment '分类号',
  40. plan_batch varchar(50) null comment '规划批次',
  41. work_total_count int null comment '编著作总数',
  42. textbook_category varchar(30) null comment '教材类型'
  43. )
  44. comment '教材管理';
  45. create table if not exists tl.textbook_claim_user
  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. wf_textbook_claim_id bigint null comment '教材申领编号',
  57. user_id bigint null comment '用户编号',
  58. user_type int default 2 null comment '用户类型(1:学生 2=教师)'
  59. )
  60. comment '教材领取人员';
  61. create table if not exists tl.textbook_class_relation
  62. (
  63. id bigint not null comment '主键编号'
  64. primary key,
  65. create_user_id bigint null comment '创建人',
  66. create_date datetime null comment '创建时间',
  67. modify_user_id bigint null comment '修改人',
  68. modify_date datetime null comment '修改时间',
  69. delete_mark int not null comment '删除标记',
  70. enabled_mark int not null comment '有效标志',
  71. sort_code int null comment '序号',
  72. textbook_id bigint null comment '教材管理编号',
  73. class_id bigint null comment '班级编号'
  74. )
  75. comment '教材班级引用';
  76. create table if not exists tl.textbook_core_attribute
  77. (
  78. id bigint not null comment '主键编号'
  79. primary key,
  80. create_user_id bigint null comment '创建人',
  81. create_date datetime null comment '创建时间',
  82. modify_user_id bigint null comment '修改人',
  83. modify_date datetime null comment '修改时间',
  84. delete_mark int not null comment '删除标记',
  85. enabled_mark int not null comment '有效标志',
  86. sort_code int null comment '序号',
  87. issn varchar(200) null comment '国际标准刊号',
  88. isbn varchar(200) null comment '国际标准书号',
  89. book_name varchar(200) null comment '书名',
  90. publishing_house varchar(200) null comment '出版社',
  91. editor_in_chief varchar(200) null comment '主编'
  92. )
  93. comment '教材核心信息管理';
  94. create table if not exists tl.textbook_issue_record
  95. (
  96. id bigint not null comment '主键编号'
  97. primary key,
  98. create_user_id bigint null comment '创建人',
  99. create_date datetime null comment '创建时间',
  100. modify_user_id bigint null comment '修改人',
  101. modify_date datetime null comment '修改时间',
  102. delete_mark int not null comment '删除标记',
  103. enabled_mark int not null comment '有效标志',
  104. sort_code int null comment '序号',
  105. textbook_id bigint null comment '教材管理编号',
  106. data_id bigint null comment '数据编号(根据出库方式,编号来自不同数据表)',
  107. data_item_id bigint null comment '数据项项编号(根据出库方式,编号来自不同数据表)',
  108. issue_number int null comment '出库数量',
  109. remaining_number int null comment '剩余数量',
  110. receive_user_id bigint null comment '领取用户编号',
  111. issue_user_id bigint null comment '出库用户编号',
  112. issue_mode varchar(20) null comment '出库方式(xjr_dictionary_item[issue_mode])',
  113. remark varchar(1000) null comment '备注'
  114. )
  115. comment '教材出库记录';
  116. create table if not exists tl.textbook_student_claim
  117. (
  118. id bigint not null comment '主键编号'
  119. primary key,
  120. create_user_id bigint null comment '创建人',
  121. create_date datetime null comment '创建时间',
  122. modify_user_id bigint null comment '修改人',
  123. modify_date datetime null comment '修改时间',
  124. delete_mark int not null comment '删除标记',
  125. enabled_mark int not null comment '有效标志',
  126. sort_code int null comment '序号',
  127. base_semester_id bigint null comment '学期ID(base_semester)',
  128. class_id bigint null comment '班级编号',
  129. student_user_id bigint null comment '学生用户编号',
  130. textbook_id bigint null comment '教材管理编号',
  131. is_claim int default 0 not null comment '是否领取(1:已领取 0:未领取)',
  132. remark varchar(1000) null comment '备注'
  133. )
  134. comment '学生教材认领记录';
  135. create table if not exists tl.textbook_subscription_record
  136. (
  137. id bigint not null comment '主键编号'
  138. primary key,
  139. create_user_id bigint null comment '创建人',
  140. create_date datetime null comment '创建时间',
  141. modify_user_id bigint null comment '修改人',
  142. modify_date datetime null comment '修改时间',
  143. delete_mark int not null comment '删除标记',
  144. enabled_mark int not null comment '有效标志',
  145. sort_code int null comment '序号',
  146. textbook_id bigint null comment '教材管理编号',
  147. wf_textbook_subscription_id bigint null comment '教材教辅征订编号',
  148. wf_textbook_subscription_item_id bigint null comment '教材教辅征订项编号'
  149. )
  150. comment '教材征订记录';
  151. create table if not exists tl.textbook_warehouse_record
  152. (
  153. id bigint not null comment '主键编号'
  154. primary key,
  155. create_user_id bigint null comment '创建人',
  156. create_date datetime null comment '创建时间',
  157. modify_user_id bigint null comment '修改人',
  158. modify_date datetime null comment '修改时间',
  159. delete_mark int not null comment '删除标记',
  160. enabled_mark int not null comment '有效标志',
  161. sort_code int null comment '序号',
  162. textbook_id bigint null comment '教材管理编号',
  163. data_id bigint null comment '数据编号(根据入库方式,编号来自不同数据表)',
  164. data_item_id bigint null comment '数据项项编号(根据入库方式,编号来自不同数据表)',
  165. warehouse_number int null comment '入库数量',
  166. source varchar(200) null comment '来源',
  167. price decimal(10, 2) null comment '定价(元)',
  168. discount float null comment '折扣',
  169. subtotal decimal(10, 2) null comment '小计(元)',
  170. total_price decimal(10, 2) null comment '总价(元)',
  171. warehouse_mode varchar(20) null comment '入库方式(xjr_dictionary_item[warehouse_mode])',
  172. remark varchar(1000) null comment '备注'
  173. )
  174. comment '教材入库记录';
  175. create table if not exists tl.wf_textbook_claim
  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. applicant_user_id bigint null comment '申请人',
  187. class_id bigint null comment '班级编号',
  188. base_semester_id bigint null comment '学期ID(base_semester)',
  189. student_user_id bigint null comment '学生编号',
  190. claim_address varchar(1000) null comment '领取地点',
  191. claim_type varchar(20) null comment '申领类型(xjr_dictionary_item[claim_type])',
  192. receive_user_id varchar(1000) null comment '代领取人',
  193. claim_user_id bigint null comment '领取用户编号(申请人帮领取人申请去领取)',
  194. status int default 0 not null comment '状态(1:结束 0:未结束)',
  195. textbook_type varchar(20) null comment '教材分类(xjr_dictionary_item[textbook_type])'
  196. )
  197. comment '教材申领';
  198. create table if not exists tl.wf_textbook_claim_item
  199. (
  200. id bigint not null comment '主键编号'
  201. primary key,
  202. create_user_id bigint null comment '创建人',
  203. create_date datetime null comment '创建时间',
  204. modify_user_id bigint null comment '修改人',
  205. modify_date datetime null comment '修改时间',
  206. delete_mark int not null comment '删除标记',
  207. enabled_mark int not null comment '有效标志',
  208. sort_code int null comment '序号',
  209. wf_textbook_claim_id bigint null comment '教材申领编号',
  210. textbook_id bigint null comment '教材管理编号',
  211. applicant_number int default 0 null comment '申请数量',
  212. issue_number int default 0 null comment '已发放数量'
  213. )
  214. comment '教材申领项';
  215. create table if not exists tl.wf_textbook_recede
  216. (
  217. id bigint not null comment '主键编号'
  218. primary key,
  219. create_user_id bigint null comment '创建人',
  220. create_date datetime null comment '创建时间',
  221. modify_user_id bigint null comment '修改人',
  222. modify_date datetime null comment '修改时间',
  223. delete_mark int not null comment '删除标记',
  224. enabled_mark int not null comment '有效标志',
  225. sort_code int null comment '序号',
  226. applicant_user_id bigint null comment '申请人',
  227. base_semester_id bigint null comment '学期ID(base_semester)',
  228. class_id bigint null comment '班级编号',
  229. recede_type varchar(20) null comment '退书类型(xjr_dictionary_item[recede_type])',
  230. recede_address varchar(1000) null comment '退还地点',
  231. status int default 0 not null comment '状态(1:结束 0:未结束)'
  232. )
  233. comment '退书申请';
  234. create table if not exists tl.wf_textbook_recede_item
  235. (
  236. id bigint not null comment '主键编号'
  237. primary key,
  238. create_user_id bigint null comment '创建人',
  239. create_date datetime null comment '创建时间',
  240. modify_user_id bigint null comment '修改人',
  241. modify_date datetime null comment '修改时间',
  242. delete_mark int not null comment '删除标记',
  243. enabled_mark int not null comment '有效标志',
  244. sort_code int null comment '序号',
  245. wf_textbook_recede_id bigint null comment '退书申请编号',
  246. textbook_id bigint null comment '教材管理编号',
  247. number int null comment '数量'
  248. )
  249. comment '退书申请项';
  250. create table if not exists tl.wf_textbook_subscription
  251. (
  252. id bigint not null comment '主键编号'
  253. primary key,
  254. create_user_id bigint null comment '创建人',
  255. create_date datetime null comment '创建时间',
  256. modify_user_id bigint null comment '修改人',
  257. modify_date datetime null comment '修改时间',
  258. delete_mark int not null comment '删除标记',
  259. enabled_mark int not null comment '有效标志',
  260. sort_code int null comment '序号',
  261. applicant_user_id bigint null comment '申请人',
  262. dept_id bigint null comment '所在部门编号',
  263. base_semester_id bigint null comment '学期ID(base_semester)',
  264. subject_group_id bigint null comment '学科组管理编号(subject_group)',
  265. remark varchar(1000) null comment '备注',
  266. status int default 0 not null comment '状态(1:结束 0:未结束)',
  267. subscription_method int null comment '征订方式(1:按班级征订 2:按教材征订)'
  268. )
  269. comment '教材教辅征订';
  270. create table if not exists tl.wf_textbook_subscription_item
  271. (
  272. id bigint not null comment '主键编号'
  273. primary key,
  274. create_user_id bigint null comment '创建人',
  275. create_date datetime null comment '创建时间',
  276. modify_user_id bigint null comment '修改人',
  277. modify_date datetime null comment '修改时间',
  278. delete_mark int not null comment '删除标记',
  279. enabled_mark int not null comment '有效标志',
  280. sort_code int null comment '序号',
  281. wf_textbook_subscription_id bigint null comment '教材教辅征订编号',
  282. subscription_type varchar(20) null comment '征订类型(xjr_dictionary_item[subscription_type])',
  283. issn varchar(200) null comment '国际标准刊号',
  284. isbn varchar(200) null comment '国际标准书号',
  285. book_name varchar(200) null comment '书名',
  286. publishing_house varchar(200) null comment '出版社',
  287. editor_in_chief varchar(200) null comment '主编',
  288. appraisal_price decimal(10, 2) null comment '估价(元)',
  289. is_textbook_plan varchar(20) null comment '是否为规划教材(xjr_dictionary_item[judgment_method_1])',
  290. course_subject_id bigint null comment '课程编号(base_course_subject)',
  291. class_ids varchar(1000) null comment '班级编号(多个)',
  292. student_subscription_number int null comment '学生用书征订数量',
  293. teacher_subscription_number int null comment '教师教材征订数量',
  294. teacher_reference_number int null comment '教师教参用书征订数量',
  295. is_support_resources varchar(20) null comment '是否有配套教学资源(xjr_dictionary_item[judgment_method_1])',
  296. version varchar(100) null comment '版本',
  297. textbook_id bigint null comment '教材id',
  298. in_stockroom_num int default 0 null comment '当前征订任务征订项已经入库数量',
  299. alteration_type int default 0 null comment '变更类型(0:未变更,1:变更征订数量,2:变更课程)'
  300. )
  301. comment '教材教辅征订项';
  302. create table if not exists tl.wf_textbook_subscription_item_history
  303. (
  304. id bigint not null comment '主键编号'
  305. primary key,
  306. create_user_id bigint null comment '创建人',
  307. create_date datetime null comment '创建时间',
  308. modify_user_id bigint null comment '修改人',
  309. modify_date datetime null comment '修改时间',
  310. delete_mark int not null comment '删除标记',
  311. enabled_mark int not null comment '有效标志',
  312. sort_code int null comment '序号',
  313. wf_textbook_subscription_item_id bigint null comment '教材教辅征订项编号',
  314. wf_textbook_subscription_id bigint null comment '教材教辅征订编号',
  315. subscription_type varchar(20) null comment '征订类型(xjr_dictionary_item[subscription_type])',
  316. issn varchar(200) null comment '国际标准刊号',
  317. isbn varchar(200) null comment '国际标准书号',
  318. book_name varchar(200) null comment '书名',
  319. publishing_house varchar(200) null comment '出版社',
  320. editor_in_chief varchar(200) null comment '主编',
  321. appraisal_price decimal(10, 2) null comment '估价(元)',
  322. is_textbook_plan varchar(20) null comment '是否为规划教材(xjr_dictionary_item[judgment_method_1])',
  323. course_subject_id bigint null comment '课程编号(base_course_subject)',
  324. class_ids varchar(1000) null comment '班级编号(多个)',
  325. student_subscription_number int null comment '学生用书征订数量',
  326. teacher_subscription_number int null comment '教师教材征订数量',
  327. teacher_reference_number int null comment '教师教参用书征订数量',
  328. is_support_resources varchar(20) null comment '是否有配套教学资源(xjr_dictionary_item[judgment_method_1])',
  329. version varchar(100) null comment '版本',
  330. textbook_id bigint null comment '教材id',
  331. in_stockroom_num int default 0 null comment '当前征订任务征订项已经入库数量',
  332. alteration_type int default 0 null comment '变更类型(0:未变更,1:变更征订数量,2:变更课程)',
  333. history_version int default 1 null comment '当前征订任务征订项已经入库数量'
  334. )
  335. comment '教材教辅征订项变更历史';