fix: 清零处理时的逻辑bug

This commit is contained in:
caoqianming 2024-05-09 11:37:24 +08:00
parent d01f12aa3f
commit 186c7ebf7c
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ def cal_mpointstat_hour(mpointId: str, year: int, month: int, day: int, hour: in
val = last_val - first_val
else:
# 这里判断有可能清零了
max_val = mrs.aggregate(max=Max(f'val_{val_type}'))["max"]
max_val = max(mrs.aggregate(max=Max(f'val_{val_type}'))["max"], first_val)
val = max_val - first_val + last_val
elif mpoint.type == Mpoint.MT_COMPUTE and mpoint.formula:
formula = mpoint.formula