jxing 5 年之前
父节点
当前提交
f35a15a4da
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      datacenter/docs/relation_calc/Pe2Bd.md
  2. 1 1
      datacenter/docs/relation_calc/Pe2Fl.md

+ 1 - 1
datacenter/docs/relation_calc/Pe2Bd.md

@@ -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)

+ 1 - 1
datacenter/docs/relation_calc/Pe2Fl.md

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