增加account_id条件获取沉降数据

This commit is contained in:
2025-11-12 21:26:11 +08:00
parent ae58d19616
commit 411072ef6b
5 changed files with 177 additions and 14 deletions

View File

@@ -124,3 +124,9 @@ class CheckpointService(BaseService[Checkpoint]):
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)
def get_by_section_ids_batch(self, db: Session, section_ids: List[str]) -> List[Checkpoint]:
"""批量根据section_id列表获取所有观测点数据使用IN查询优化性能"""
if not section_ids:
return []
return db.query(Checkpoint).filter(Checkpoint.section_id.in_(section_ids)).all()