Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chaonan
unify_api2
Commits
a43a1bf1
Commit
a43a1bf1
authored
Jun 29, 2023
by
lcn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
88908d81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
equipment_operations_pds.py
...i/modules/zhiwei_u/procedures/equipment_operations_pds.py
+1
-1
equipment_operations_service.py
.../modules/zhiwei_u/service/equipment_operations_service.py
+7
-11
No files found.
unify_api/modules/zhiwei_u/procedures/equipment_operations_pds.py
View file @
a43a1bf1
...
...
@@ -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
(
"
e
type"
,
""
)
p_dic
=
{
"id"
:
id_
,
"type"
:
name
,
...
...
unify_api/modules/zhiwei_u/service/equipment_operations_service.py
View file @
a43a1bf1
...
...
@@ -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} "
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment