Commit a43a1bf1 authored by lcn's avatar lcn

bug修复

parent 88908d81
......@@ -56,7 +56,7 @@ async def alarm_setting_pds(pid, locations):
threshold = res.get("threshold", "")
duration = res.get("duration", "")
enable = res.get("enable", "")
event_type = res.get("type", "")
event_type = res.get("etype", "")
p_dic = {
"id": id_,
"type": name,
......
......@@ -32,25 +32,21 @@ async def equipment_operations_service(userid, prod_id, cid, sid, pid,
if sid and not pid:
sql = f"SELECT c.product,c.cid,c.shortname,p.pid,p.name,m.sid,p.mtid" \
f" FROM `monitor` m LEFT JOIN company c on m.cid=c.cid " \
f"left join point p on p.mtid=m.mtid where sid='{sid}' " \
f"left join point p on p.mtid=m.mtid where demolished = 0 and " \
f"sid='{sid}' " \
f"limit {current_page}, {page_size}"
t_sql = f"SELECT count(c.cid) total FROM `monitor` m " \
f"LEFT JOIN company c " \
f"on m.cid=c.cid left join point p on p.mtid=m.mtid " \
f"where sid='{sid}'"
f"where demolished = 0 and sid='{sid}'"
else:
li = []
conn_sql = "where demolished = 0 "
if prod_id:
li.append(f"c.product={prod_id}")
conn_sql += f" and c.product={prod_id}"
if cid:
li.append(f"c.cid={cid}")
conn_sql += f" and c.cid={cid}"
if pid:
li.append(f"p.pid={pid}")
conn_sql = "where "
if li:
conn_sql += " and ".join(li)
else:
conn_sql = ""
conn_sql += f" and p.pid={pid}"
sql = f"SELECT c.product,c.cid,c.shortname,p.pid,p.name,m.sid,p.mtid" \
f" FROM `monitor` m LEFT JOIN company c on m.cid=c.cid " \
f"left join point p on p.mtid=m.mtid {conn_sql} " \
......
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