2026-09-22 15:14:32 +08:00
|
|
|
from databases import engine_all,Base_all,Session
|
2026-09-21 22:06:10 +08:00
|
|
|
from sqlalchemy import Column, Integer, String, Date, ForeignKey
|
|
|
|
|
from sqlalchemy.dialects.mysql import DATETIME
|
|
|
|
|
from datetime import datetime
|
2026-09-22 12:23:18 +08:00
|
|
|
from class_management.database import Base
|
2026-09-21 22:06:10 +08:00
|
|
|
|
2026-09-22 15:14:32 +08:00
|
|
|
class ClassInfo(Base_all):
|
2026-09-22 12:23:18 +08:00
|
|
|
__tablename__ = 'classes'
|
2026-09-21 22:06:10 +08:00
|
|
|
|
|
|
|
|
id = Column(Integer
|
|
|
|
|
,primary_key=True
|
|
|
|
|
,autoincrement=True
|
|
|
|
|
,comment='班级id主键'
|
|
|
|
|
)
|
|
|
|
|
num = Column(String(50)
|
|
|
|
|
,nullable=False
|
2026-09-22 19:33:36 +08:00
|
|
|
,unique=True
|
2026-09-21 22:06:10 +08:00
|
|
|
,comment='班级编号'
|
|
|
|
|
)
|
|
|
|
|
name = Column(String(50)
|
|
|
|
|
,nullable=False
|
|
|
|
|
,comment='班级名称'
|
|
|
|
|
)
|
|
|
|
|
head_teacher_id = Column(Integer
|
2026-09-22 21:23:24 +08:00
|
|
|
,ForeignKey('teachers.id')
|
2026-09-21 22:06:10 +08:00
|
|
|
,comment='班主任编号'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
coach_teacher_id = Column(Integer
|
2026-09-22 21:23:24 +08:00
|
|
|
,ForeignKey('teachers.id')
|
2026-09-21 22:06:10 +08:00
|
|
|
,comment='授课老师编号'
|
|
|
|
|
)
|
|
|
|
|
tutor_teacher_id = Column(Integer
|
2026-09-22 21:23:24 +08:00
|
|
|
,ForeignKey('teachers.id')
|
2026-09-21 22:06:10 +08:00
|
|
|
,comment='助教老师编号'
|
|
|
|
|
)
|
|
|
|
|
class_start_time = Column(Date
|
|
|
|
|
,comment='开班日期'
|
|
|
|
|
)
|
|
|
|
|
class_end_time = Column(Date
|
|
|
|
|
,comment='结课日期'
|
|
|
|
|
)
|
|
|
|
|
is_delete = Column(Integer
|
|
|
|
|
,default=0
|
|
|
|
|
,comment='逻辑删除 0未删除 1已删除'
|
|
|
|
|
)
|
|
|
|
|
create_time = Column(DATETIME
|
|
|
|
|
,default=datetime.now
|
|
|
|
|
,comment='记录创建时间'
|
|
|
|
|
)
|
|
|
|
|
update_time = Column(DATETIME
|
|
|
|
|
,default=datetime.now
|
|
|
|
|
,onupdate=datetime.now
|
|
|
|
|
,comment='记录更新时间'
|
|
|
|
|
)
|