29 lines
1.5 KiB
Python
29 lines
1.5 KiB
Python
from sqlalchemy import Column, Integer, String
|
|
from ..core.database import Base
|
|
|
|
class SectionData(Base):
|
|
__tablename__ = "section_data"
|
|
|
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
|
mileage = Column(String(100), nullable=False, comment="断面里程")
|
|
work_site = Column(String(100), nullable=False, comment="工点")
|
|
basic_types = Column(String(100), comment="基础类型")
|
|
height = Column(String(100), comment="桥墩台高度")
|
|
status = Column(String(100), nullable=False, comment="断面状态")
|
|
number = Column(String(100), nullable=False, comment="所在桥梁墩(台)编号", index=True)
|
|
transition_paragraph = Column(String(100), comment="过渡段")
|
|
design_fill_height = Column(String(100), comment="设计填土高度")
|
|
compression_layer_thickness = Column(String(100), comment="压实层厚度")
|
|
treatment_depth = Column(String(100), comment="处理深度")
|
|
foundation_treatment_method = Column(String(100), comment="地基处理方法")
|
|
rock_mass_classification = Column(String(100), comment="围岩级别")
|
|
account_id = Column(String(100), nullable=True, comment="账号id", index=True)
|
|
section_id = Column(String(100), nullable=False, comment="断面id", index=True)
|
|
|
|
# 模型转字典
|
|
def to_dict(self):
|
|
"""将模型实例转换为字典,支持 Pydantic 序列化"""
|
|
return {
|
|
column.name: getattr(self, column.name)
|
|
for column in self.__table__.columns
|
|
} |