Compare commits
2 Commits
08b556fa6e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f7b839e0a | |||
| e5de18e80f |
@@ -1,22 +1,46 @@
|
|||||||
from sqlalchemy import Column, Integer, String, DateTime
|
<<<<<<< HEAD
|
||||||
from ..core.database import Base
|
from sqlalchemy import Column, Integer, String
|
||||||
|
from ..core.database import Base
|
||||||
class LoseData(Base):
|
|
||||||
__tablename__ = "lose_data"
|
|
||||||
|
class LoseData(Base):
|
||||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
"""缺失数据记录表:记录各水准线路(期数)的原始/沉降数据缺失情况"""
|
||||||
account_id = Column(String(100), nullable=False, comment="水准线路编码", index=True)
|
__tablename__ = "lose_data"
|
||||||
NYID = Column(String(100), nullable=False, comment="期数id", index=True)
|
|
||||||
linecode = Column(String(100), nullable=False, comment="水准线路编码", index=True)
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True, comment="ID")
|
||||||
benchmarkids = Column(String(100), comment="工作基点名称序列")
|
account_id = Column(Integer, nullable=False, comment="账户id", index=True)
|
||||||
point_id = Column(String(100), nullable=False, comment="观测点id", index=True)
|
NYID = Column(String(100), nullable=False, comment="期数ID", index=True)
|
||||||
section_id = Column(String(100), nullable=False, comment="所属断面id")
|
linecode = Column(String(255), nullable=False, default="0", comment="水准线路编码", index=True)
|
||||||
lose_data = Column(String(100), comment="水准观测类型")
|
lose_data = Column(Integer, nullable=False, default=0, comment="缺失的数据,默认是0")
|
||||||
|
section_id = Column(String(255), nullable=True, comment="所属断面id")
|
||||||
# 模型转字典
|
point_id = Column(String(100), nullable=False, comment="测点ID")
|
||||||
def to_dict(self):
|
|
||||||
"""将模型实例转换为字典,支持 Pydantic 序列化"""
|
def to_dict(self):
|
||||||
return {
|
return {
|
||||||
column.name: getattr(self, column.name)
|
column.name: getattr(self, column.name)
|
||||||
for column in self.__table__.columns
|
for column in self.__table__.columns
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
from sqlalchemy import Column, Integer, String, DateTime
|
||||||
|
from ..core.database import Base
|
||||||
|
|
||||||
|
class LoseData(Base):
|
||||||
|
__tablename__ = "lose_data"
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||||
|
account_id = Column(String(100), nullable=False, comment="水准线路编码", index=True)
|
||||||
|
NYID = Column(String(100), nullable=False, comment="期数id", index=True)
|
||||||
|
linecode = Column(String(100), nullable=False, comment="水准线路编码", index=True)
|
||||||
|
benchmarkids = Column(String(100), comment="工作基点名称序列")
|
||||||
|
point_id = Column(String(100), nullable=False, comment="观测点id", index=True)
|
||||||
|
section_id = Column(String(100), nullable=False, comment="所属断面id")
|
||||||
|
lose_data = Column(String(100), comment="水准观测类型")
|
||||||
|
|
||||||
|
# 模型转字典
|
||||||
|
def to_dict(self):
|
||||||
|
"""将模型实例转换为字典,支持 Pydantic 序列化"""
|
||||||
|
return {
|
||||||
|
column.name: getattr(self, column.name)
|
||||||
|
for column in self.__table__.columns
|
||||||
|
}
|
||||||
|
>>>>>>> 08b556fa6e96c71bc757e9aa393457d0bbf0589b
|
||||||
|
|||||||
Reference in New Issue
Block a user