定时任务优化
This commit is contained in:
@@ -15,6 +15,12 @@ class CheckpointService(BaseService[Checkpoint]):
|
||||
checkpoints = self.get_by_field(db, "point_id", point_id)
|
||||
return checkpoints[0] if checkpoints else None
|
||||
|
||||
def get_by_point_ids_batch(self, db: Session, point_ids: List[str]) -> List[Checkpoint]:
|
||||
"""批量根据观测点ID列表获取观测点数据(使用IN查询优化性能)"""
|
||||
if not point_ids:
|
||||
return []
|
||||
return db.query(Checkpoint).filter(Checkpoint.point_id.in_(point_ids)).all()
|
||||
|
||||
def search_checkpoints(self, db: Session,
|
||||
aname: Optional[str] = None,
|
||||
section_id: Optional[str] = None,
|
||||
|
||||
Reference in New Issue
Block a user