-- ---------------------------- -- 2024-12-13 14:36 -- 教材基础信息表 -- ---------------------------- drop table if exists textbook; create table `textbook` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', subject_group_id bigint not null comment '学科组管理编号(subject_group)', course_subject_id bigint not null comment '课程编号(base_course_subject)', use_type int null default 1 comment '使用类型(单位:学期)', issn varchar(200) not null unique comment '国际标准刊号', isbn varchar(200) null unique comment '国际标准书号', book_name varchar(200) not null comment '书名', publishing_house varchar(200) null default '/' comment '出版社', editor_in_chief varchar(200) null default '/' comment '主编', version varchar(100) null default '/' comment '版本', is_textbook_plan int null default 0 comment '是否为规划教材', textbook_type varchar(20) null comment '教材分类(xjr_dictionary_item[textbook_type])', specifications_models varchar(100) null default '/' comment '规格型号', publishing_date date null comment '出版日期', is_secd int null default 0 comment '是否校企合作开发教材', category varchar(50) null default '/' comment '分类号', plan_batch varchar(50) null default '/' comment '规划批次', work_total_count int null default 0 comment '编著作总数', textbook_category varchar(30) null default '/' comment '教材类型', price decimal(10, 2) null default 0 comment '定价(元)', discount float null default 10 comment '预估折扣', discount_price decimal(10, 2) null default 0 comment '预估折扣后价格(元)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材基础信息表'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材征订记录表 -- ---------------------------- drop table if exists textbook_subscription; create table `textbook_subscription` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', remark varchar(1000) null comment '备注', base_semester_id bigint not null comment '学期id(base_semester)', subscription_method int not null comment '征订方式(1:按班级征订 2:按教材征订)', base_class_ids varchar(1000) null comment '按班级征订征订的班级主键(base_class)', sum int null default 0 comment '征订教材总数', status int null default 0 comment '征订状态(1:结束 0:未结束)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材教辅征订记录表'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材征订记录与班级关联表 -- ---------------------------- drop table if exists textbook_subscription_class; create table `textbook_subscription_class` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', remark varchar(1000) null comment '备注', textbook_subscription_id bigint not null comment '教材征订记录表id(textbook_subscription)', base_class_id bigint not null comment '按班级征订中征订的班级主键(base_class)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材征订记录与班级关联表'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材征订记录详情表 -- ---------------------------- drop table if exists textbook_subscription_item; create table `textbook_subscription_item` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', textbook_subscription_id bigint not null comment '教材教辅增订记录表主键(textbook_subscription)', textbook_id bigint null comment '教材表主键(textbook)', student_num int null default 0 comment '学生用书征订数量', teacher_num int null default 0 comment '教师用书征订数量', discount float null default 10 comment '实际折扣', price decimal(10, 2) null default 0 comment '实际价格(元)', in_stock_num int null default 0 comment '当前征订任务征订项入库数量', out_stock_num int null default 0 comment '当前征订任务征订项出库数量', alteration_type int null default 0 comment '变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材征订记录详情表'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材征订记录详情变更记录表 -- ---------------------------- drop table if exists textbook_subscription_item_history; create table `textbook_subscription_item_history` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', textbook_subscription_id bigint not null comment '教材教辅征订编号', textbook_subscription_item_id bigint not null comment '教材教辅征订项编号', textbook_id bigint null comment '教材表主键(textbook)', student_num int null default 0 comment '学生用书征订数量', teacher_num int null default 0 comment '教师用书征订数量', discount float null default 10 comment '实际折扣', price decimal(10, 2) null default 0 comment '实际价格(元)', in_stock_num int null default 0 comment '当前征订任务征订项入库数量', out_stock_num int null default 0 comment '当前征订任务征订项出库数量', alteration_type int null default 0 comment '变更类型(0:未变更,1:学生用书征订数量,2:教师用书征订数量,3:变更课程,)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材教辅征订项变更历史'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材入库记录 -- ---------------------------- drop table if exists textbook_warehouse_record; create table `textbook_warehouse_record` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', warehouse_mode varchar(20) null comment '入库方式(xjr_dictionary_item[warehouse_mode])', data_id bigint null comment '数据编号(根据入库方式,编号来自不同数据表)', data_item_id bigint null comment '数据项项编号(根据入库方式,编号来自不同数据表)', textbook_id bigint null comment '教材管理编号', price decimal(10, 2) null comment '定价(元)', warehouse_number int null comment '入库数量', source varchar(200) null comment '来源', discount float null comment '实际折扣', subtotal decimal(10, 2) null comment '实际价格(元)', total_price decimal(10, 2) null comment '总价(元)', remark varchar(1000) null comment '备注' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材入库记录'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材申领 -- ---------------------------- drop table if exists wf_textbook_claim; create table `wf_textbook_claim` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', applicant_user_id bigint null comment '申请人', base_semester_id bigint null comment '学期id(base_semester)', claim_type varchar(20) null comment '申领类型(xjr_dictionary_item[claim_type])', -- 班主任帮学生申请领取或者学生自己申请领取 class_id bigint null comment '班级编号', student_user_id bigint null comment '负责领取学生编号', claim_address varchar(1000) null comment '领取地点', receive_user_id varchar(1000) null comment '代领取人', claim_user_id bigint null comment '实际领取用户编号(申请人帮领取人申请去领取)', status int default 0 not null comment '状态(1:结束 0:未结束)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材申领'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材申领项 -- ---------------------------- drop table if exists wf_textbook_claim_item; create table `wf_textbook_claim_item` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', wf_textbook_claim_id bigint null comment '教材申领编号', textbook_id bigint null comment '教材管理编号', applicant_number int default 0 null comment '申请数量', issue_number int default 0 null comment '已发放数量' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材申领项'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材申领项与教材征订项关联表 -- ---------------------------- drop table if exists claim_item_subscription_item; create table `claim_item_subscription_item` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', wf_textbook_claim_item_id bigint null comment '教材申领编号', textbook_subscription_item_id bigint null comment '教材征订编号', issue_number int default 0 null comment '已发放数量' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材申领项与教材征订项关联表'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材领取人员 -- ---------------------------- drop table if exists textbook_claim_user; create table `textbook_claim_user` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', wf_textbook_claim_id bigint null comment '教材申领编号', user_id bigint null comment '用户编号', user_type int default 2 null comment '用户类型(1:学生 2=教师)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材领取人员'; -- ---------------------------- -- 2024-12-13 14:36 -- 教材出库记录 -- ---------------------------- drop table if exists textbook_issue_record; create table `textbook_issue_record` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', issue_mode varchar(20) null comment '出库方式(xjr_dictionary_item[issue_mode])', data_id bigint null comment '数据编号(根据出库方式,编号来自不同数据表)', data_item_id bigint null comment '数据项项编号(根据出库方式,编号来自不同数据表)', textbook_id bigint null comment '教材管理编号', issue_number int null comment '出库数量', remaining_number int null comment '申领中剩余未出库数量', receive_user_id bigint null comment '领取用户编号', issue_user_id bigint null comment '出库用户编号', remark varchar(1000) null comment '备注' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='教材出库记录'; -- ---------------------------- -- 2024-12-13 14:36 -- 学生教材认领记录 -- ---------------------------- drop table if exists textbook_student_claim; create table `textbook_student_claim` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', base_semester_id bigint null comment '学期id(base_semester)', class_id bigint null comment '班级编号', student_user_id bigint null comment '学生用户编号', textbook_id bigint null comment '教材管理编号', is_claim int default 0 not null comment '是否领取(1:已领取 0:未领取)', remark varchar(1000) null comment '备注' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='学生教材认领记录'; -- ---------------------------- -- 2024-12-13 14:36 -- 退书申请 -- ---------------------------- drop table if exists wf_textbook_recede; create table `wf_textbook_recede` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', applicant_user_id bigint null comment '申请人', recede_type varchar(20) null comment '退书类型(xjr_dictionary_item[recede_type])', base_semester_id bigint null comment '学期id(base_semester)', class_id bigint null comment '班级编号', recede_address varchar(1000) null comment '退还地点', status int default 0 not null comment '状态(1:结束 0:未结束)' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='退书申请'; -- ---------------------------- -- 2024-12-13 14:36 -- 退书申请项 -- ---------------------------- drop table if exists wf_textbook_recede_item; create table `wf_textbook_recede_item` ( id bigint not null comment '主键编号' primary key, create_user_id bigint null comment '创建人', create_date datetime null comment '创建时间', modify_user_id bigint null comment '修改人', modify_date datetime null comment '修改时间', delete_mark int not null comment '删除标记', enabled_mark int not null comment '有效标志', sort_code int null comment '序号', wf_textbook_recede_id bigint null comment '退书申请编号', textbook_id bigint null comment '教材管理编号', number int null comment '数量' ) engine = innodb default charset = utf8mb4 collate = utf8mb4_0900_ai_ci comment ='退书申请项';