CALL { MATCH p = (self:Company)<-[sr:Invest|Legal]-(target) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 RETURN target, p, 'C' AS nodeType, 1 AS orderWeight UNION MATCH p = (self:Company)<-[sr:FinalBenefit]-(target:Company) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 AND sr.percent >= 5 RETURN target, p, 'BE5' AS nodeType, 5 AS orderWeight UNION MATCH p = (self:Company)<-[sr:FinalBenefit]-(target:Person) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 AND sr.percent >= 5 RETURN target, p, 'BP5' AS nodeType, 5 AS orderWeight UNION MATCH p = (self:Company)<-[sr:Employ]-(target:Person) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 RETURN target, p, 'DJG' AS nodeType, 7 AS orderWeight UNION MATCH p = (self:Company)-[sr:Invest]->(target:Company) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 RETURN target, p, 'HE' AS nodeType, 4 AS orderWeight } WITH target, p, nodeType, orderWeight RETURN target AS target, collect(p) AS path, collect(nodeType) AS nodeType, min(orderWeight) AS orderWeight, CASE target.status WHEN 'Yes' THEN 0 WHEN 'No' THEN 0 WHEN '' THEN 0 WHEN 'Yes_1' THEN 1 WHEN 'xx' THEN 1 WHEN 'xxx' THEN 10 WHEN 'xxxx' THEN 10 WHEN '***' THEN 11 WHEN '*' THEN 11 ELSE 8 END AS status ORDER BY status, orderWeight SKIP 0 LIMIT 100
MATCH p = (self:Company)<-[sr:Invest|Legal]-(target) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 RETURN target, p, 'C' AS nodeType, 1 AS orderWeight UNION MATCH p = (self:Company)<-[sr:FinalBenefit]-(target:Company) WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 AND sr.percent >= 5 RETURN target, p, 'BE5' AS nodeType, 5 AS orderWeight
{MATCH p = (self:Company)<-[sr:ACTUAL|CONTROL]-(target) WHERE self.keyNo = "236e31d3b25b16740e537cb4c153211a" AND target.keyNo = "7376bda598438361382715bf561c9c2f" RETURN target, p, 'C' AS nodeType, 1 AS orderWeight UNION MATCH p = (self:Company)<-[sr:ACTUAL|CONTROL]-()<-[:EMPLOY]-(target:Person) WHERE self.keyNo = "236e31d3b25b16740e537cb4c153211a" AND target.keyNo = "7376bda598438361382715bf561c9c2f" AND sr.percent >= 5 RETURN target, p, 'BE5' AS nodeType, 5 AS orderWeight} WITH target, p, nodeType, orderWeight RETURN target AS target, collect(p) AS path, collect(nodeType) AS nodeType, min(orderWeight) AS orderWeight, CASE target.status WHEN 'Yes' THEN 0 WHEN 'No' THEN 0 WHEN '' THEN 0 WHEN 'Yes_1' THEN 1 WHEN 'xx' THEN 1 WHEN 'xxx' THEN 10 WHEN 'xxxx' THEN 10 WHEN '***' THEN 11 WHEN '*' THEN 11 ELSE 8 END AS status ORDER BY status, orderWeight SKIP 0 LIMIT 100