合并模型类
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
from util.database import Base
|
from util.database import Base
|
||||||
from .class_model import Class
|
from .all_model import Class
|
||||||
from .code_value_model import CodeValue
|
from .code_value_model import CodeValue
|
||||||
from .company_model import Company
|
from .company_model import Company
|
||||||
from .course_model import Course
|
from .course_model import Course
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
@@ -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="逻辑删除字段")
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
from sqlalchemy import create_engine
|
from sqlalchemy import create_engine
|
||||||
from sqlalchemy.orm import declarative_base,sessionmaker
|
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)
|
engine = create_engine(db_url,pool_size=50)
|
||||||
Base = declarative_base()
|
Base = declarative_base()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user