1.通过accountid获取所有断面数据

This commit is contained in:
whm
2025-11-01 13:32:56 +08:00
parent 2b0b5122ab
commit 48afb0a25e
3 changed files with 31 additions and 2 deletions

View File

@@ -20,7 +20,10 @@ class SectionDataService(BaseService[SectionData]):
"""根据断面ID获取断面数据"""
sections = self.get_by_field(db, "section_id", section_id)
return sections[0] if sections else None
def get_by_account_id(self, db: Session, account_id: str) -> Optional[SectionData]:
"""根据账号ID获取断面数据"""
accounts = self.get_by_field(db, "account_id", account_id)
return accounts[0] if accounts else None
def get_by_number(self, db: Session, number: str) -> List[SectionData]:
"""根据桥梁墩(台)编号获取断面数据"""
return self.get_by_field(db, "number", number)