26 lines
699 B
Python
26 lines
699 B
Python
from .database import *
|
|
from .s0_base import *
|
|
|
|
def get_pipe_risk_probability_now(name: str, pipe_id: str) -> dict[str, Any]:
|
|
t = try_read(name, f"select * from pipe_risk_probability where pipeid = '{pipe_id}'")
|
|
if t == None:
|
|
return {}
|
|
|
|
d = {}
|
|
d['pipeid'] = str(t['pipeid'])
|
|
d['pipeage'] = t['pipeage']
|
|
d['risk_probability_now'] = t['risk_probability_now']
|
|
|
|
return d
|
|
|
|
def get_pipe_risk_probability(name: str, pipe_id: str) -> dict[str, Any]:
|
|
t = try_read(name, f"select * from pipe_risk_probability where pipeid = '{pipe_id}'")
|
|
if t == None:
|
|
return {}
|
|
|
|
d = {}
|
|
d['pipeid'] = t['pipeid']
|
|
d['x'] = t['x']
|
|
d['y'] = t['y']
|
|
|
|
return d |