MATCH (intopice:intopiece) WHERE intopice.loan_business_id = "A1150420200420018765"
CALL apoc.path.subgraphNodes(intopice, {maxLevel:1,uniqueness:"NODE_GLOBAL"})
YIELD node where node.commit_time<intopice.commit_time with collect(node.loan_business_id) as list
MATCH (intopice:intopiece) WHERE intopice.loan_business_id = "A1150420200420018765"
CALL apoc.path.subgraphNodes(intopice, {maxLevel:2,uniqueness:"NODE_GLOBAL"})
YIELD node where node.commit_time<intopice.commit_time with node as result
where NOT(result.loan_business_id in list)
and result.loan_business_id <> "A1150420200420018765"
and result.commit_time<intopice.commit_time
return count(result.loan_business_id) as TOTAL ,
sum(toInt(result.loan_value)+1)/2 as LOAN,
sum(toInt(result.overdue_value)+1)/2 as B_OVERDUE ,
sum(toInt(result.evasion_debts)+1)/2 as B_EVASION ,
sum(toInt(result.out_of_contact)+1)/2 as B_LOST ,
sum(toInt(result.other_blacklist)+1)/2 as B_OTHER ,
sum(toInt(result.online_mob1_m1)+1)/2 as OVERDUE_ONLINE_FLAG1,
sum(toInt(result.online_mob2_m1)+1)/2 as OVERDUE_ONLINE_FLAG2,
sum(toInt(result.online_mob6_m1)+1)/2 as OVERDUE_ONLINE_FLAG3,
sum(toInt(result.offline_m1)+1)/2 as OVERDUE_OFFLINE_FLAG1,
sum(toInt(result.offline_mob3m1)+1)/2 as OVERDUE_OFFLINE_FLAG2,
sum(toInt(result.offline_mob6m2)+1)/2 as OVERDUE_OFFLINE_FLAG3,
sum(toInt(result.edu_overdue30)+1)/2 as OVERDUE_EDU_FLAG1,
sum(toInt(result.edu_mob3m2)+1)/2 as OVERDUE_EDU_FLAG2,
sum(toInt(result.edu_mob6m2)+1)/2 as OVERDUE_EDU_FLAG3,
sum(case when result.overdue_value=1 OR result.evasion_debts=1 OR result.out_of_contact=1 OR result.other_blacklist=1 then 1 else 0 end ) as TOUCH;
GET SUBGRAPH 2 STEPS FROM "player101" IN follow YIELD VERTICES AS nodes | \
YIELD collect($-.nodes) AS nodes | \
UNWIND $-.nodes[1] AS n_2step | \
YIELD id($-.n_2step) AS n | \
FETCH PROP ON player $-.n YIELD vertex AS v | \
YIELD $-.v.name AS name WHERE $-.v.age < 36
(root@nebula) [basketballplayer]> GET SUBGRAPH 2 STEPS FROM "player101" IN follow YIELD VERTICES AS nodes | YIELD collect($-.nodes) AS nodes | UNWIND $-.nodes[1] AS n_2step | YIELD id($-.n_2step) AS n | FETCH PROP ON player $-.n YIELD vertex AS v | YIELD $-.v.name AS name WHERE $-.v.age < 36
+---------------------+
| name |
+---------------------+
| "Dejounte Murray" |
| "Marco Belinelli" |
| "LaMarcus Aldridge" |
+---------------------+