From 1f8761600416094d4082035e33cdfd2457930183 Mon Sep 17 00:00:00 2001 From: Orangeeee Date: Mon, 21 Sep 2026 21:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=9B=B4=E6=96=B0=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=20=E6=89=80=E6=9C=89=E5=BA=93=E5=90=8D=E3=80=81?= =?UTF-8?q?=E8=A1=A8=E5=90=8D=E3=80=81model=E5=AD=97=E6=AE=B5=E5=90=8D=20?= =?UTF-8?q?=E7=AD=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 14 +++++++ students/model/students_model.py | 71 ++++++++++++++++++++++++++------ 2 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 .idea/.gitignore 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='删除时间' )