Commit 55ace5c2 by qiuchaofei

1.分页查找孤立点数量

parent 1af295e7
......@@ -78,6 +78,17 @@ public class DataRelationAnalyController {
return dataRelationAnalyService.findTableWithoutRelations(parentId,0,200000);
}
//分页
@ApiOperation(tags = "", value = "分页查找孤立点的总数")
@RequestMapping(path = "/getIsolatedTableTotal", method = RequestMethod.GET)
public Integer getIsolatedTableTotal(String parentId) {
logger.info("分页查找孤立点的总数:"+parentId);
if(parentId == null ){
return 0;
}
return dataRelationAnalyService.findTableWithoutRelationsTotal(parentId);
}
@ApiOperation(tags = "", value = "分页查找指定节点的孤立点。parentId参数可以为schemaId,sysemId,evnId")
@RequestMapping(path = "/getIsolatedTableByPage", method = RequestMethod.GET)
public Map<String, ReturnNode> getIsolatedTableByPage(String parentId,int start,int size) {
......
......@@ -70,4 +70,28 @@ public class DataRelationAnalyServiceImpl implements DataRelationAnalyService {
}
return returnNodeMap;
}
@Override
public Integer findTableWithoutRelationsTotal(String parentId) {
String cypher = "";
String condition = "";
if(parentId !=null && parentId .startsWith("System=")){
condition= "<-[r1:Composition]-(:Neo4jSchema)<-[r2:Composition]-(m:Neo4jSystem{metadataId:\""+parentId+"\"})";
cypher = "match (n:Neo4jTable) " + condition + "where not ((n)-[:`流向`]-()) return count(n) as count ";
}else if(parentId !=null && parentId .startsWith("Schema=")){
condition= "<-[r1:Composition]-(m:Neo4jSchema{metadataId:\""+parentId+"\"})";
cypher = "match (n:Neo4jTable) " + condition + "where not ((n)-[:`流向`]-()) return count(n) as count ";
}else if(parentId !=null){
cypher = "match (n:Neo4jTable{isEnvironment:\""+parentId+"\"}) where not ((n)-[:`流向`]-()) return count(n) as count ";
}
logger .info("查找孤立表总数的语句:"+cypher);
StatementResult result = session.run(cypher);
int jdcount= 0 ;
while(result.hasNext()){
Record record = result.next();
jdcount= record.get( "count").asInt();
}
return jdcount;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment