From 60424f7ef7e9a968c8d2470151ccd1cf9ddf28f0 Mon Sep 17 00:00:00 2001 From: maruizhi <3088243241@qq.com> Date: Thu, 24 Sep 2026 14:32:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=A8=A1=E5=9E=8B=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/__init__.py | 2 +- model/all_model.py | 167 +++++++++++++++++++++++++++++++++ model/class_model.py | 19 ---- model/code_value_model.py | 18 ---- model/company_model.py | 20 ---- model/course_model.py | 17 ---- model/employee_model.py | 23 ----- model/employment_info_model.py | 19 ---- model/grade_model.py | 18 ---- model/interview_model.py | 20 ---- model/relation_model.py | 19 ---- model/student_model.py | 31 ------ util/database.py | 2 +- 13 files changed, 169 insertions(+), 206 deletions(-) create mode 100644 model/all_model.py delete mode 100644 model/class_model.py delete mode 100644 model/code_value_model.py delete mode 100644 model/company_model.py delete mode 100644 model/course_model.py delete mode 100644 model/employee_model.py delete mode 100644 model/employment_info_model.py delete mode 100644 model/grade_model.py delete mode 100644 model/interview_model.py delete mode 100644 model/relation_model.py delete mode 100644 model/student_model.py diff --git a/model/__init__.py b/model/__init__.py index be6520c..ab105e4 100644 --- a/model/__init__.py +++ b/model/__init__.py @@ -1,5 +1,5 @@ from util.database import Base -from .class_model import Class +from .all_model import Class from .code_value_model import CodeValue from .company_model import Company from .course_model import Course diff --git a/model/all_model.py b/model/all_model.py new file mode 100644 index 0000000..0fadcaf --- /dev/null +++ b/model/all_model.py @@ -0,0 +1,167 @@ +from sqlalchemy import Integer, Column, DateTime, String, Boolean, Numeric, Date +from util.database import Base,engine + + +class Class(Base): + """对应 Excel Sheet:班级表。""" + + __tablename__ = "wl_class" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + class_number = Column(String(50), comment="班级编号") + name = Column(String(100), comment="班级名字") + start_date = Column(DateTime, comment="开班时间") + planned_end_date = Column(DateTime, comment="计划结课时间") + actual_end_date = Column(DateTime, comment="实际结课时间") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class CodeValue(Base): + """对应 Excel Sheet:码值表。""" + + __tablename__ = "wl_code_value" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + code = Column(String(50), comment="编码") + meaning = Column(String(200), comment="意义") + type = Column(String(100), comment="类型") + is_enabled = Column(Boolean, comment="状态(是否可用)") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Company(Base): + """对应 Excel Sheet:企业信息表。""" + + __tablename__ = "wl_company" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + company_number = Column(String(50), comment="企业编号") + name = Column(String(200), comment="企业名称") + industry = Column(String(100), comment="所属行业") + employee_scale = Column(String(50), comment="人员规模") + main_business = Column(String(1000), comment="主营业务") + registered_capital = Column(Numeric(16, 2), comment="注册资金") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Course(Base): + """对应 Excel Sheet:课程表。""" + + __tablename__ = "wl_course" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + course_number = Column(String(50), comment="课程编号") + name = Column(String(100), comment="课程名字") + planned_training_hours = Column(Numeric(8, 2), comment="计划培训课时") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Employee(Base): + """对应 Excel Sheet:员工表。""" + + __tablename__ = "wl_employee" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + employee_number = Column(String(50), comment="工号") + name = Column(String(100), comment="姓名") + gender = Column(String(20), comment="性别") + birth_date = Column(Date, comment="生日") + id_card_number = Column(String(18), comment="身份证号") + hometown = Column(String(100), comment="籍贯") + salary = Column(Numeric(12, 2), comment="薪资") + position_type = Column(String(50), comment="岗位类型") + position_level = Column(String(50), comment="岗位级别") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class EmploymentInfo(Base): + """对应 Excel Sheet:就业信息表。""" + + __tablename__ = "wl_employment_info" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + student_id = Column(Integer, comment="学生id") + employment_salary = Column(Numeric(12, 2), comment="就业薪资") + company_number = Column(String(50), comment="就业的企业编号") + resume_opened_at = Column(DateTime, comment="简历开放时间") + offer_received_at = Column(DateTime, comment="拿到offer时间") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Grade(Base): + """对应 Excel Sheet:成绩表。""" + + __tablename__ = "wl_grade" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + student_number = Column(String(50), comment="学生编号") + course_number = Column(String(50), comment="课程编号") + exam_sequence = Column(Integer, comment="考试序次") + score = Column(Numeric(5, 2), comment="分数") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Interview(Base): + """对应 Excel Sheet:面试信息表。""" + + __tablename__ = "wl_interview" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="面试id") + interview_at = Column(DateTime, comment="面试时间") + student_id = Column(Integer, comment="学生id") + room = Column(String(100), comment="面试间") + sequence = Column(Integer, comment="面试序次") + company_id = Column(Integer, comment="面试的企业id") + result = Column(Boolean, comment="面试结果") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Relation(Base): + """对应 Excel Sheet:关联关系表。""" + + __tablename__ = "wl_relation" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id") + source_id = Column(String(50), comment="关系来源标识") + destination_id = Column(Integer, comment="关系目标标识") + relation_type = Column(String(50), comment="关系类型") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +class Student(Base): + """对应 Excel Sheet:学生表。""" + + __tablename__ = "wl_student" + + id = Column(Integer, primary_key=True, autoincrement=True, comment="id(逻辑主键)") + student_number = Column(String(50), nullable=False, comment="学号(业务主键)") + name = Column(String(100), comment="姓名") + gender = Column(String(20), comment="性别") + birth_date = Column(Date, comment="出生年月") + id_card_number = Column(String(18), comment="身份证号") + phone_number = Column(String(30), comment="电话号码") + hometown = Column(String(100), comment="籍贯") + graduate_school = Column(String(200), comment="毕业学校") + education = Column(String(50), comment="学历") + hobbies = Column(String(500), comment="兴趣爱好") + trial_date = Column(Date, comment="试听日期") + expected_salary = Column(Numeric(12, 2), comment="就业期望薪资") + consultant_id = Column(Integer, comment="顾问id") + class_id = Column(Integer, comment="班级id") + payment_method = Column(String(20), comment="支付方式") + emergency_contact = Column(String(100), comment="紧急联系人") + remark = Column(String(1000), comment="备注") + created_at = Column(DateTime, comment="数据创建时间") + updated_at = Column(DateTime, comment="数据更新时间") + is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") + +Base.metadate.create_all(engine) \ No newline at end of file diff --git a/model/class_model.py b/model/class_model.py deleted file mode 100644 index 07039a6..0000000 --- a/model/class_model.py +++ /dev/null @@ -1,19 +0,0 @@ -from sqlalchemy import Integer, Column, DateTime, String - -from util.database import Base - - -class Class(Base): - """对应 Excel Sheet:班级表。""" - - __tablename__ = "wl_class" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - class_number = Column(String(50), comment="班级编号") - name = Column(String(100), comment="班级名字") - start_date = Column(DateTime, comment="开班时间") - planned_end_date = Column(DateTime, comment="计划结课时间") - actual_end_date = Column(DateTime, comment="实际结课时间") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/code_value_model.py b/model/code_value_model.py deleted file mode 100644 index 8e67aa5..0000000 --- a/model/code_value_model.py +++ /dev/null @@ -1,18 +0,0 @@ -from sqlalchemy import Integer, Boolean, Column, DateTime, String - -from util.database import Base - - -class CodeValue(Base): - """对应 Excel Sheet:码值表。""" - - __tablename__ = "wl_code_value" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - code = Column(String(50), comment="编码") - meaning = Column(String(200), comment="意义") - type = Column(String(100), comment="类型") - is_enabled = Column(Boolean, comment="状态(是否可用)") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/company_model.py b/model/company_model.py deleted file mode 100644 index 35fb880..0000000 --- a/model/company_model.py +++ /dev/null @@ -1,20 +0,0 @@ -from sqlalchemy import Integer, Column, DateTime, Numeric, String - -from util.database import Base - - -class Company(Base): - """对应 Excel Sheet:企业信息表。""" - - __tablename__ = "wl_company" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - company_number = Column(String(50), comment="企业编号") - name = Column(String(200), comment="企业名称") - industry = Column(String(100), comment="所属行业") - employee_scale = Column(String(50), comment="人员规模") - main_business = Column(String(1000), comment="主营业务") - registered_capital = Column(Numeric(16, 2), comment="注册资金") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/course_model.py b/model/course_model.py deleted file mode 100644 index a1fc42a..0000000 --- a/model/course_model.py +++ /dev/null @@ -1,17 +0,0 @@ -from sqlalchemy import Integer, Column, DateTime, Numeric, String - -from util.database import Base - - -class Course(Base): - """对应 Excel Sheet:课程表。""" - - __tablename__ = "wl_course" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - course_number = Column(String(50), comment="课程编号") - name = Column(String(100), comment="课程名字") - planned_training_hours = Column(Numeric(8, 2), comment="计划培训课时") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/employee_model.py b/model/employee_model.py deleted file mode 100644 index 327448b..0000000 --- a/model/employee_model.py +++ /dev/null @@ -1,23 +0,0 @@ -from sqlalchemy import Integer, Column, Date, DateTime, Numeric, String - -from util.database import Base - - -class Employee(Base): - """对应 Excel Sheet:员工表。""" - - __tablename__ = "wl_employee" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - employee_number = Column(String(50), comment="工号") - name = Column(String(100), comment="姓名") - gender = Column(String(20), comment="性别") - birth_date = Column(Date, comment="生日") - id_card_number = Column(String(18), comment="身份证号") - hometown = Column(String(100), comment="籍贯") - salary = Column(Numeric(12, 2), comment="薪资") - position_type = Column(String(50), comment="岗位类型") - position_level = Column(String(50), comment="岗位级别") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/employment_info_model.py b/model/employment_info_model.py deleted file mode 100644 index 562d491..0000000 --- a/model/employment_info_model.py +++ /dev/null @@ -1,19 +0,0 @@ -from sqlalchemy import Integer, Column, DateTime, Numeric, String - -from util.database import Base - - -class EmploymentInfo(Base): - """对应 Excel Sheet:就业信息表。""" - - __tablename__ = "wl_employment_info" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - student_id = Column(Integer, comment="学生id") - employment_salary = Column(Numeric(12, 2), comment="就业薪资") - company_number = Column(String(50), comment="就业的企业编号") - resume_opened_at = Column(DateTime, comment="简历开放时间") - offer_received_at = Column(DateTime, comment="拿到offer时间") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/grade_model.py b/model/grade_model.py deleted file mode 100644 index 709b28d..0000000 --- a/model/grade_model.py +++ /dev/null @@ -1,18 +0,0 @@ -from sqlalchemy import Integer, Column, DateTime, Integer, Numeric, String - -from util.database import Base - - -class Grade(Base): - """对应 Excel Sheet:成绩表。""" - - __tablename__ = "wl_grade" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - student_number = Column(String(50), comment="学生编号") - course_number = Column(String(50), comment="课程编号") - exam_sequence = Column(Integer, comment="考试序次") - score = Column(Numeric(5, 2), comment="分数") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/interview_model.py b/model/interview_model.py deleted file mode 100644 index 5a210d9..0000000 --- a/model/interview_model.py +++ /dev/null @@ -1,20 +0,0 @@ -from sqlalchemy import Integer, Boolean, Column, DateTime, Integer, String - -from util.database import Base - - -class Interview(Base): - """对应 Excel Sheet:面试信息表。""" - - __tablename__ = "wl_interview" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="面试id") - interview_at = Column(DateTime, comment="面试时间") - student_id = Column(Integer, comment="学生id") - room = Column(String(100), comment="面试间") - sequence = Column(Integer, comment="面试序次") - company_id = Column(Integer, comment="面试的企业id") - result = Column(Boolean, comment="面试结果") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/relation_model.py b/model/relation_model.py deleted file mode 100644 index 51e214d..0000000 --- a/model/relation_model.py +++ /dev/null @@ -1,19 +0,0 @@ -from datetime import datetime - -from sqlalchemy import Integer, Column, DateTime, String - -from util.database import Base - - -class Relation(Base): - """对应 Excel Sheet:关联关系表。""" - - __tablename__ = "wl_relation" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id") - source_id = Column(String(50), comment="关系来源标识") - destination_id = Column(Integer, comment="关系目标标识") - relation_type = Column(String(50), comment="关系类型") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/model/student_model.py b/model/student_model.py deleted file mode 100644 index afc2c82..0000000 --- a/model/student_model.py +++ /dev/null @@ -1,31 +0,0 @@ -from sqlalchemy import Integer, Column, Date, DateTime, Numeric, String - -from util.database import Base - - -class Student(Base): - """对应 Excel Sheet:学生表。""" - - __tablename__ = "wl_student" - - id = Column(Integer, primary_key=True, autoincrement=True, comment="id(逻辑主键)") - student_number = Column(String(50), nullable=False, comment="学号(业务主键)") - name = Column(String(100), comment="姓名") - gender = Column(String(20), comment="性别") - birth_date = Column(Date, comment="出生年月") - id_card_number = Column(String(18), comment="身份证号") - phone_number = Column(String(30), comment="电话号码") - hometown = Column(String(100), comment="籍贯") - graduate_school = Column(String(200), comment="毕业学校") - education = Column(String(50), comment="学历") - hobbies = Column(String(500), comment="兴趣爱好") - trial_date = Column(Date, comment="试听日期") - expected_salary = Column(Numeric(12, 2), comment="就业期望薪资") - consultant_id = Column(Integer, comment="顾问id") - class_id = Column(Integer, comment="班级id") - payment_method = Column(String(20), comment="支付方式") - emergency_contact = Column(String(100), comment="紧急联系人") - remark = Column(String(1000), comment="备注") - created_at = Column(DateTime, comment="数据创建时间") - updated_at = Column(DateTime, comment="数据更新时间") - is_deleted = Column(default=False, nullable=False, comment="逻辑删除字段") diff --git a/util/database.py b/util/database.py index cb96327..f4831ec 100644 --- a/util/database.py +++ b/util/database.py @@ -1,7 +1,7 @@ from sqlalchemy import create_engine from sqlalchemy.orm import declarative_base,sessionmaker -db_url = 'mysql+pymysql://root:123456@192.168.5.12:3306/ai0824?charset=utf8mb4' +db_url = 'mysql+pymysql://root:123456@192.168.5.12:3306/team?charset=utf8mb4' engine = create_engine(db_url,pool_size=50) Base = declarative_base()