Commit 86b3998e authored by lcn's avatar lcn

bug修复

parent 5c1c0772
......@@ -15,9 +15,10 @@ async def get_kwh_p_dao(terms, start_time, end_time,
"""
sql = f"""
select p,kwh,DATE_FORMAT(create_time,"{time_fmt}") as cal_time
select avg(p) p,sum(kwh) kwh, DATE_FORMAT(create_time,"{time_fmt}")
as cal_time
from {table_name} where cid in %s and create_time >= %s
and create_time <= %s
and create_time <= %s group by cal_time
"""
async with MysqlUtil() as conn:
result = await conn.fetchall(sql, args=(terms, start_time, end_time))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment