修改路口列表sql
Signed-off-by: yinzijian <yinzijian@haomozhixing.onaliyun.com>
This commit is contained in:
parent
432418465d
commit
d9c9d0e6ad
|
|
@ -30,8 +30,8 @@ class TmnetDbHelper(TableDbHelperBase):
|
||||||
where
|
where
|
||||||
cm.nodeid = %s and cm.xl_crossid in %s
|
cm.nodeid = %s and cm.xl_crossid in %s
|
||||||
group by cm.xl_crossid'''
|
group by cm.xl_crossid'''
|
||||||
print(cursor.mogrify(sql,(citycode,cross_list)))
|
print(cursor.mogrify(sql, (citycode, cross_list)))
|
||||||
cursor.execute(sql,(citycode,cross_list))
|
cursor.execute(sql, (citycode, cross_list))
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
self.close(conn, cursor)
|
self.close(conn, cursor)
|
||||||
return result, None
|
return result, None
|
||||||
|
|
@ -112,7 +112,8 @@ class TmnetDbHelper(TableDbHelperBase):
|
||||||
"""
|
"""
|
||||||
values = [
|
values = [
|
||||||
(
|
(
|
||||||
d['start_hm'], d['end_hm'], d['crossid'], d['phase_type'], d['phase_detail'], d['cont_times'], d['final_state'],
|
d['start_hm'], d['end_hm'], d['crossid'], d['phase_type'], d['phase_detail'], d['cont_times'],
|
||||||
|
d['final_state'],
|
||||||
d['level_color'], d['first_date'], d['change_red_daynums']
|
d['level_color'], d['first_date'], d['change_red_daynums']
|
||||||
) for d in insert_list
|
) for d in insert_list
|
||||||
]
|
]
|
||||||
|
|
@ -181,37 +182,28 @@ class TmnetDbHelper(TableDbHelperBase):
|
||||||
""" % (nodeid, area_id, crossid, nodeid, area_id, crossid)
|
""" % (nodeid, area_id, crossid, nodeid, area_id, crossid)
|
||||||
return self.do_select(sql)
|
return self.do_select(sql)
|
||||||
|
|
||||||
def query_cross_list_road(self, nodeid:str, area_id:str):
|
def query_cross_list_road(self, nodeid: str, area_id: str):
|
||||||
conn, cursor = self.connect()
|
conn, cursor = self.connect()
|
||||||
try:
|
try:
|
||||||
sql = """select if(clui.name is not null, clui.name, c.name) as name,
|
sql = """select if(clui.name is not null, clui.name, c2.name) as name,
|
||||||
c.crossid,
|
c.crossid,
|
||||||
if(clui.location is not null, clui.location, c.location) as location,
|
if(clui.location is not null, clui.location, c.location) as location,
|
||||||
c.nodeid,
|
c.nodeid,
|
||||||
c.area_id,
|
c.area_id,
|
||||||
t2.to_crossid,
|
r.roadid,
|
||||||
t2.name road_name,
|
|
||||||
t2.src_direct
|
|
||||||
from `cross` as c
|
|
||||||
left join `cross_ledger_update_info` as clui on clui.crossid = c.crossid and clui.nodeid = c.nodeid and clui.area_id = c.area_id
|
|
||||||
left join (
|
|
||||||
select r.roadid,
|
|
||||||
if(rlui.from_crossid is not null, rlui.from_crossid, r.from_crossid) as from_crossid,
|
if(rlui.from_crossid is not null, rlui.from_crossid, r.from_crossid) as from_crossid,
|
||||||
if(rlui.to_crossid is not null, rlui.to_crossid, r.to_crossid) as to_crossid,
|
if(rlui.to_crossid is not null, rlui.to_crossid, r.to_crossid) as to_crossid,
|
||||||
if(rlui.name is not null, rlui.name, r.name) as name,
|
if(rlui.name is not null, rlui.name, r.name) as road_name,
|
||||||
if(rlui.src_direct is not null, rlui.src_direct, r.src_direct) as src_direct
|
if(rlui.src_direct is not null, rlui.src_direct, r.src_direct) as src_direct
|
||||||
from road as r
|
from `bound_crosses` as c
|
||||||
left join road_ledger_update_info as rlui on rlui.nodeid = r.nodeid and rlui.recordstate = r.recordstate and rlui.to_crossid = r.to_crossid and (rlui.is_sup_road is null or rlui.is_sup_road <> 1)
|
join `cross` c2 on c2.crossid = c.crossid and c2.nodeid = %s and c2.area_id = %s
|
||||||
where r.nodeid = %s
|
left join `cross_ledger_update_info` as clui on clui.crossid = c.crossid and clui.nodeid = %s and clui.area_id = %s
|
||||||
and r.recordstate = 0
|
left join `road` as r on r.nodeid = %s and r.to_crossid = c.crossid and r.recordstate = 0 and (r.is_sup_road is null or r.is_sup_road <> 1)
|
||||||
and (r.is_sup_road is null or r.is_sup_road <> 1)
|
left join `road_ledger_update_info` as rlui on rlui.nodeid = %s and rlui.recordstate = r.recordstate and rlui.to_crossid = r.to_crossid and (rlui.is_sup_road is null or rlui.is_sup_road <> 1)
|
||||||
) as t2 on t2.to_crossid = c.crossid
|
|
||||||
where c.nodeid = %s
|
where c.nodeid = %s
|
||||||
and c.area_id = %s
|
and c.area_id = %s"""
|
||||||
and c.at_edge = 0
|
print(cursor.mogrify(sql, (nodeid, area_id, nodeid, area_id, nodeid, nodeid, int(nodeid), int(area_id))))
|
||||||
and c.isdeleted = 0"""
|
cursor.execute(sql, (nodeid, area_id, nodeid, area_id, nodeid, nodeid, int(nodeid), int(area_id)))
|
||||||
print(cursor.mogrify(sql, (nodeid, nodeid, area_id)))
|
|
||||||
cursor.execute(sql, (nodeid, nodeid, area_id))
|
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
self.close(conn, cursor)
|
self.close(conn, cursor)
|
||||||
return result, None
|
return result, None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue