1.新增通过断面id获取所有 的 测点数据

This commit is contained in:
whm
2025-11-01 14:27:51 +08:00
parent 51068dc4e1
commit e4df0cba43
3 changed files with 31 additions and 5 deletions

View File

@@ -8,9 +8,7 @@ class CheckpointService(BaseService[Checkpoint]):
def __init__(self):
super().__init__(Checkpoint)
def get_by_section_id(self, db: Session, section_id: str) -> List[Checkpoint]:
"""根据断面ID获取观测点"""
return self.get_by_field(db, "section_id", section_id)
def get_by_point_id(self, db: Session, point_id: str) -> Optional[Checkpoint]:
"""根据观测点ID获取观测点"""
@@ -121,4 +119,8 @@ class CheckpointService(BaseService[Checkpoint]):
}
def get_by_nyid(self, db: Session, nyid: str) -> List[Checkpoint]:
"""根据NYID获取所有相关的测点信息"""
return self.get_by_field(db, "NYID", nyid)
return self.get_by_field(db, "NYID", nyid)
# 通过section_id获取所有观测点数据
def get_by_section_id(self, db: Session, section_id: str) -> List[Checkpoint]:
"""根据section_id获取所有相关的测点信息"""
return self.get_by_field(db, "section_id", section_id)