



-- MATCH (sales:/aia/sales)-[:sales_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno in ('G09***889A','G09***029A')),  
-- (insuregrp:/aia/insuregrp)-[:insuregrp_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno in ('G09***889A','G09***029A'))
-- RETURN sales.id, grpcont.id, insuregrp.id
-- /**
-- output()
-- match( "grpcont.id", "aia_GrpCont:G09***029A", "sales.id", "aia_Sales:7a45b05b-ec5a-11f0-93a3-b88687bddf52")
-- **/
-- ;
-- MATCH (sales:/aia/sales)-[:sales_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno in ('G09***889A','G09***029A')),  
-- (insuregrp:/aia/insuregrp)-[:insuregrp_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno in ('G09***889A','G09***029A'))
-- -[:grpcont_risk*1..1]->(risk:/aia/risk WHERE id='aia_Risk:308C1') 
-- RETURN sales.id, grpcont.id, insuregrp.id, risk.id
-- /**
-- output()
-- match( "grpcont.id", "aia_GrpCont:G09***029A", "sales.id", "aia_Sales:7a45b05b-ec5a-11f0-93a3-b88687bddf52")
-- **/
-- ;




-- MATCH 
-- (sales:/aia/sales)
-- -[:sales_grpcont*1..1]->
-- (grpcont:/aia/grpcont WHERE grpcontno = 'G09***029A'), 
-- (sales:/aia/sales)
-- -[:sales_agent*1..1]->
-- (agent:/aia/agent)
-- /**
-- output()
-- **/
-- ;

-- MATCH
-- (insuregrp:/aia/insuregrp)
-- -[:insuregrp_grpcont*1..1]->
-- (grpcont:/aia/grpcont WHERE grpcontno = 'G09***029A')
-- -[:grpcont_risk*1..1]->
-- (risk:/aia/risk)
-- /**
-- output()
-- **/
-- ;

-- MATCH
-- (sales:/aia/sales)
-- -[:sales_grpcont*1..1]->
-- (grpcont:/aia/grpcont WHERE grpcontno = 'G09***029A'), 
-- (sales:/aia/sales)
-- -[:sales_agent*1..1]->
-- (agent:/aia/agent),
-- (insuregrp:/aia/insuregrp)
-- -[:insuregrp_grpcont*1..1]->
-- (grpcont:/aia/grpcont WHERE grpcontno = 'G09***029A')
-- -[:grpcont_risk*1..1]->
-- (risk:/aia/risk)
-- /**
-- output()
-- **/
-- ;

MATCH 
(sales)
-[:sales_grpcont*1..1]->
(grpcont:aia_GrpCont), 
(sales:"aia_Sales:7a4451b1-ec5a-11f0-b8f2-b88687bddf52")
-[:sales_agent*1..1]->
(agent:/aia/agent), 
(insuregrp:/aia/insuregrp)
-[:insuregrp_grpcont*1..1]->
(grpcont:/aia/grpcont WHERE comshortname like '%上海%' AND contstate in ('满期终止', '保单退保', '保单中止', '犹豫期退保') AND valdate >= '2020-01-01 00:00:00' AND valdate <= '2025-02-28 23:59:59')
-[:grpcont_risk*1..1]->
(risk:/aia/risk) 
RETURN agent.agentname AS "agentname", grpcont.grpname AS "grpname", grpcont.grpcontno AS "grpcontno", risk.riskname AS "riskname" WITH TIMEOUT = 6m
/**
output()
**/
;


MATCH 
(sales:/aia/sales)
-[:sales_grpcont*1..1]->
(grpcont:aia_GrpCont WHERE comshortname like '%上海%' AND contstate in ('满期终止', '保单退保', '保单中止', '犹豫期退保') AND valdate >= '2020-01-01 00:00:00' AND valdate <= '2025-02-28 23:59:59'), 
(sales)
-[:sales_agent*1..1]->
(agent:/aia/agent), 
(insuregrp:/aia/insuregrp)
-[:insuregrp_grpcont*1..1]->
(grpcont:/aia/grpcont)
-[:grpcont_risk*1..1]->
(risk:/aia/risk) 
RETURN agent.agentname AS "agentname", grpcont.grpname AS "grpname", grpcont.grpcontno AS "grpcontno", risk.riskname AS "riskname" WITH TIMEOUT = 6m
/**
output()
**/
;

-- MATCH 
-- (sales:/aia/sales)-[:sales_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno = 'G09***029A'), 
-- (sales:/aia/sales)-[:sales_agent*1..1]->(agent:/aia/agent)
-- RETURN agent.agentname AS "agentname", grpcont.grpname AS "grpname", grpcont.grpcontno AS "grpcontno" WITH TIMEOUT = 6m

-- ;




MATCH (sales:/aia/sales)-[:sales_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno in ('G09***889A','G09***029A')),  
(insuregrp:/aia/insuregrp)-[:insuregrp_grpcont*1..1]->(grpcont:/aia/grpcont WHERE grpcontno in ('G09***889A','G09***029A'))
-[:grpcont_risk*1..1]->(risk:/aia/risk WHERE id='aia_Risk:308C1') 
RETURN sales.id, grpcont.id, insuregrp.id, risk.id
WITH timeout=60m
/**
output()
**/;
