Browse Source

处理多个关系查询,未明确楼层等情况

lvxianyun 3 năm trước cách đây
mục cha
commit
fb8528c1e2

+ 5 - 1
src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java

@@ -188,7 +188,11 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
             ObjectNode relationFrom = objectMapper.createObjectNode();
             relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
             relationFrom.put("relCode", RelCodeEnum.Eq2Bd.name());
-            relationFrom.set("objTo",criteria.get("buildingId"));
+            if(!criteria.get("buildingId").toString().contains("$null")) {
+                relationFrom.set("objTo", criteria.get("buildingId"));
+            }else{
+                relationFrom.put("$bindFlag", false);
+            }
             criteria.set("relationFrom",relationFrom);
             criteria.remove("buildingId");
         }

+ 5 - 1
src/main/java/com/persagy/proxy/object/service/impl/AdmShaftServiceImpl.java

@@ -68,7 +68,11 @@ public class AdmShaftServiceImpl extends AbstractAdmBaseServiceImpl<AdmShaft> im
             ObjectNode relationTo = objectMapper.createObjectNode();
             relationTo.put("graphCode", GraphCodeEnum.ArchSubset.name());
             relationTo.put("relCode", RelCodeEnum.Bd2Sh.name());
-            relationTo.set("objFrom",criteria.get("buildingId"));
+            if(!criteria.get("buildingId").toString().contains("$null")) {
+                relationTo.set("objFrom",criteria.get("buildingId"));
+            }else{
+                relationTo.put("$bindFlag", false);
+            }
             criteria.set("relationTo",relationTo);
             criteria.remove("buildingId");
         }

+ 5 - 1
src/main/java/com/persagy/proxy/object/service/impl/AdmSpaceServiceImpl.java

@@ -400,7 +400,11 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             ObjectNode relationTo = objectMapper.createObjectNode();
             relationTo.put("graphCode", GraphCodeEnum.ArchSubset.name());
             relationTo.put("relCode", RelCodeEnum.Bd2Sp.name());
-            relationTo.set("objFrom",criteria.get("buildingId"));
+            if(!criteria.get("buildingId").toString().contains("$null")) {
+                relationTo.set("objFrom",criteria.get("buildingId"));
+            }else{
+                relationTo.put("$bindFlag", false);
+            }
             criteria.set("relationTo",relationTo);
             criteria.remove("buildingId");
         }

+ 5 - 1
src/main/java/com/persagy/proxy/object/service/impl/AdmSystemServiceImpl.java

@@ -131,7 +131,11 @@ public class AdmSystemServiceImpl extends AbstractAdmBaseServiceImpl<AdmSystem>
             ObjectNode relationFrom = objectMapper.createObjectNode();
             relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
             relationFrom.put("relCode", RelCodeEnum.Sy2Bd.name());
-            relationFrom.set("objTo",criteria.get("buildingId"));
+            if(!criteria.get("buildingId").toString().contains("$null")) {
+                relationFrom.set("objTo", criteria.get("buildingId"));
+            }else{
+                relationFrom.put("$bindFlag", false);
+            }
             criteria.set("relationFrom",relationFrom);
             criteria.remove("buildingId");
         }