diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..6231b4e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,14 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# 已忽略包含查询文件的默认文件夹 +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml + + +*.iml +*.xml \ No newline at end of file diff --git a/students/model/students_model.py b/students/model/students_model.py index 90275a6..aeb79cd 100644 --- a/students/model/students_model.py +++ b/students/model/students_model.py @@ -4,34 +4,79 @@ import datetime from students.databases import * from datetime import datetime from sqlalchemy.dialects.mysql import DATETIME +from sqlalchemy import Enum class Students(Base): __tablename__ = 'students' - sid = Column(Integer + id = Column(Integer , primary_key=True , autoincrement=True - , comment='学生编号,自增主键' + , comment='学生ID,自增主键' + ) + num = Column(Integer + , nullable=False + , unique=True + , comment='学生编号' ) - student_name = Column(String(20) , comment='学生姓名' , nullable=False ) + name = Column(String(20) + , comment='学生姓名' + , nullable=False ) - student_phone = Column(String(11) , comment='学生手机号' , nullable=False , unique=True ) + age = Column(Integer + , comment='年龄' + , nullable=False) - class_name = Column(String(20) , comment='学生班级' , nullable=False ) + sex = Column(Enum('男','女') + , comment='性别' + , nullable=False) - job_open_time = Column(DATETIME , comment='就业开放时间') + home_Place = Column(String(50) + , comment='籍贯') - offer_issue_time = Column(DATETIME , comment='offer下发时间') + college = Column(String(50) + , comment='毕业院校') - company_name = Column(String(100) , comment='就业公司名称') + specialty = Column(String(50) + , comment='专业') - salary = Column(Integer , comment='就业薪资') + enrollment_time = Column(DATETIME + , comment='入学时间') - create_date = Column(DATETIME(fsp=3) , default=datetime.now , comment='创建时间' ) + graduate_time = Column(DATETIME + , comment='毕业时间') - update_date = Column(DATETIME(fsp=3) , default=datetime.now , comment='更新时间' ) + education = Column(String(50) + , comment='学历') - is_deleted = Column(INTEGER , default=False , comment='是否删除:0-正常,1-已删除' ) + # 外键字段 + class_id = Column(Integer + , comment='学生班级' + , nullable=False ) - deleted_date = Column(DATETIME(fsp=3) , default=None , comment='删除时间' ) + adnisor_id = Column(Integer + , comment='顾问ID') + + # 额外字段 + phone = Column(String(11) + , comment='学生手机号' + , nullable=False + , unique=True ) + + # 通用字段 + create_date = Column(DATETIME(fsp=6) + , default=datetime.now + , comment='创建时间' ) + + update_date = Column(DATETIME(fsp=6) + , default=datetime.now + , comment='更新时间' ) + + is_deleted = Column(INTEGER + , default=False + , comment='是否删除:0-正常,1-已删除' ) + + deleted_date = Column(DATETIME(fsp=6) + , default=None + , comment='删除时间' )