第一版
optional match(alarmCase:AlarmCase{orgId:50})
optional match(n:资金分析{orgId:50})
with apoc.coll.union(collect(id(alarmCase)),collect(id(n))) as ids
match(n) where id(n) in ids
and (n.caseName =~ '.*张三被诈骗.*' or n.caseID =~ '.*张三被诈骗.*')
return {id: id(n), caseID: n.caseID, caseName: n.caseName} as res skip 0 limit 5
第二版好点,感觉性能都不太行
optional match(alarmCase:AlarmCase{orgId:50})
optional match(n:资金分析{orgId:50})
with apoc.coll.union(collect(apoc.map.setLists({},['id','caseID','caseName','dataFrom'],[id(alarmCase),alarmCase.caseID,alarmCase.caseName,'E8-接警止付'])),
collect(apoc.map.setLists({},['id','caseID','caseName','dataFrom'],[id(n),n.caseID,n.caseName,'E8-追金分析']))) as results
unwind results as n with n where ( n.caseName =~ '.*张三被诈骗.*' or n.caseID =~ '.*张三被诈骗.*' )
return n as res skip 0 limit 5