Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neo4jRelation
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qiuchaofei
neo4jRelation
Commits
55ace5c2
Commit
55ace5c2
authored
May 19, 2022
by
qiuchaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.分页查找孤立点数量
parent
1af295e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
DataRelationAnalyController.java
...adataRelation/controller/DataRelationAnalyController.java
+11
-0
DataRelationAnalyServiceImpl.java
...taRelation/service/impl/DataRelationAnalyServiceImpl.java
+24
-0
No files found.
src/main/java/com/keymobile/metadata/metadataRelation/controller/DataRelationAnalyController.java
View file @
55ace5c2
...
...
@@ -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
)
{
...
...
src/main/java/com/keymobile/metadata/metadataRelation/service/impl/DataRelationAnalyServiceImpl.java
View file @
55ace5c2
...
...
@@ -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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment