|
@@ -15,7 +15,7 @@ $$
|
|
|
try:
|
|
|
# 将下面对数据库的操作作为一个事务, 出异常则自动rollback
|
|
|
with plpy.subtransaction():
|
|
|
- plan = plpy.prepare("update property as pe set building_id = eq.building_id from equipment eq where eq.id = pe.equip_id and pe.building_id is null and eq.building_id is not null and eq.project_id = $1 and pe.project_id = $1", ["text"])
|
|
|
+ plan = plpy.prepare("update property as pe set building_id = eq.building_id from equipment eq where eq.id = pe.equip_id and eq.building_id is not null and eq.project_id = $1 and pe.project_id = $1", ["text"])
|
|
|
rel = plan.execute([project_id])
|
|
|
except Exception as e:
|
|
|
plpy.warning(e)
|