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
ca287b6c
Commit
ca287b6c
authored
Jun 17, 2022
by
qiuchaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查询表时加标签
parent
ef09ea5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
Neo4jTableRepository.java
...taRelation/respository/metadata/Neo4jTableRepository.java
+6
-6
TableServiceImpl.java
...adata/metadataRelation/service/impl/TableServiceImpl.java
+22
-4
No files found.
src/main/java/com/keymobile/metadata/metadataRelation/respository/metadata/Neo4jTableRepository.java
View file @
ca287b6c
...
...
@@ -28,21 +28,21 @@ public interface Neo4jTableRepository extends Neo4jRepository<Neo4jTable,Long> {
@Query
(
"match (n{metadataId:{startTable}} )<-[r1:流向]-(m1)<-[r:流向]-(m{metadataId:{entTable}}) return m1 "
)
List
<
BaseNode
>
getSourceEtlScriptBetween2Table
(
@Param
(
"startTable"
)
String
startTable
,
@Param
(
"entTable"
)
String
entTable
);
@Query
(
"match (n{metadataId:{startTable}} )-[r1:流向]->(m1)-[r:流向]->(m{metadataId:{entTable}}) return m1 "
)
@Query
(
"match (n
:Neo4jTable
{metadataId:{startTable}} )-[r1:流向]->(m1)-[r:流向]->(m{metadataId:{entTable}}) return m1 "
)
List
<
BaseNode
>
getTargetEtlScriptBetween2Table
(
@Param
(
"startTable"
)
String
startTable
,
@Param
(
"entTable"
)
String
entTable
);
@Query
(
"match (n{metadataId:{tableId}} )<-[r1:流向]-(m1) <-[r:Composition]-(m) return m "
)
@Query
(
"match (n
:Neo4jTable
{metadataId:{tableId}} )<-[r1:流向]-(m1) <-[r:Composition]-(m) return m "
)
List
<
BaseNode
>
getSourceEtlJob
(
@Param
(
"tableId"
)
String
tableId
);
@Query
(
"match (n{metadataId:{tableId}} )-[r1:流向]->(m1) <-[r:Composition]-(m) return m "
)
@Query
(
"match (n
:Neo4jTable
{metadataId:{tableId}} )-[r1:流向]->(m1) <-[r:Composition]-(m) return m "
)
List
<
BaseNode
>
getTargetEtlJob
(
@Param
(
"tableId"
)
String
tableId
);
@Query
(
"match (n{metadataId:{tableId}} ) <-[r:Composition]-(m) return m "
)
@Query
(
"match (n
:Neo4jTable
{metadataId:{tableId}} ) <-[r:Composition]-(m) return m "
)
List
<
BaseNode
>
getSchema
(
@Param
(
"tableId"
)
String
tableId
);
@Query
(
"match (n{metadataId:{tableId}} ) -[r:Composition]->(m:Neo4jColumn) return m "
)
@Query
(
"match (n
:Neo4jTable
{metadataId:{tableId}} ) -[r:Composition]->(m:Neo4jColumn) return m "
)
List
<
Neo4jColumn
>
getColumnByTableId
(
@Param
(
"tableId"
)
String
tableId
);
...
...
@@ -54,7 +54,7 @@ public interface Neo4jTableRepository extends Neo4jRepository<Neo4jTable,Long> {
List
<
BaseNode
>
getTargets
(
@Param
(
"tableId"
)
String
tableId
);
@Query
(
"match (n{metadataId:{tableId}})<-[r1:Composition]-(m1) return m1 "
)
@Query
(
"match (n
:Neo4jTable
{metadataId:{tableId}})<-[r1:Composition]-(m1) return m1 "
)
List
<
BaseNode
>
getParent
(
@Param
(
"tableId"
)
String
tableId
);
...
...
src/main/java/com/keymobile/metadata/metadataRelation/service/impl/TableServiceImpl.java
View file @
ca287b6c
...
...
@@ -74,9 +74,16 @@ public class TableServiceImpl implements ITableService {
List
<
ReturnNode
>
etlJobs
=
new
ArrayList
<>();
//获取关联作业,
List
<
BaseNode
>
sourceBaseNodes
=
neo4jTableRepository
.
getSourceEtlJob
(
tableId
);
getEtjJobFromSource
(
etlJobs
,
sourceBaseNodes
);
List
<
BaseNode
>
targetBaseNodes
=
neo4jTableRepository
.
getTargetEtlJob
(
tableId
);
getEtlJobFromTarget
(
etlJobs
,
targetBaseNodes
);
long
time5
=
System
.
currentTimeMillis
();
relationObjects
.
put
(
"作业"
,
etlJobs
);
//质量报告
...
...
@@ -107,9 +114,13 @@ public class TableServiceImpl implements ITableService {
qualityList
.
add
(
returnNode
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
" 获取质量错误: "
+
e
.
getMessage
());
// e.printStackTrace();
}
long
time6
=
System
.
currentTimeMillis
();
logger
.
info
(
" 获取质量报告用时: "
+(
time6
-
time5
));
relationObjects
.
put
(
"质量"
,
qualityList
);
//模型
List
<
ReturnNode
>
modelList
=
new
ArrayList
<>();
...
...
@@ -130,6 +141,9 @@ public class TableServiceImpl implements ITableService {
e
.
printStackTrace
();
}
long
time7
=
System
.
currentTimeMillis
();
logger
.
info
(
" 获取资产用时: "
+(
time7
-
time6
));
relationObjects
.
put
(
"资产"
,
assetList
);
//标准
List
<
ReturnNode
>
standardList
=
new
ArrayList
<>();
...
...
@@ -155,6 +169,8 @@ public class TableServiceImpl implements ITableService {
e
.
printStackTrace
();
}
long
time8
=
System
.
currentTimeMillis
();
logger
.
info
(
" 获取标准用时: "
+(
time8
-
time7
));
relationObjects
.
put
(
"标准"
,
standardList
);
long
start
=
System
.
currentTimeMillis
();
...
...
@@ -195,6 +211,7 @@ public class TableServiceImpl implements ITableService {
if
(
tableId
.
startsWith
(
TableEqual
)){
Neo4jTable
neo4jTable
=
neo4jTableRepository
.
findNeo4jTableByMetadataId
(
tableId
);
ReturnNode
returnNode
=
new
ReturnNode
();
if
(
neo4jTable
!=
null
){
returnNode
.
setId
(
neo4jTable
.
getMetadataId
());
...
...
@@ -203,9 +220,9 @@ public class TableServiceImpl implements ITableService {
returnNode
.
setType
(
TableModelName
);
// 获取属性
Map
<
String
,
String
>
attributeMap
=
getAttributeMap
(
tableId
);
returnNode
.
setAttributeMaps
(
attributeMap
);
//
//
获取属性
//
Map<String,String> attributeMap = getAttributeMap(tableId);
//
returnNode.setAttributeMaps(attributeMap);
returnTableList
.
add
(
returnNode
);
}
else
if
(
tableId
.
startsWith
(
EtlJobEqual
)){
Neo4jETLJob
neo4jETLJob
=
neo4jETLJobRepository
.
findNeo4jETLJobByMetadataId
(
tableId
);
...
...
@@ -913,6 +930,7 @@ public class TableServiceImpl implements ITableService {
List
<
ReturnNode
>
sourceTables
=
new
ArrayList
<>();
List
<
ReturnNode
>
neo4jTableList
=
getCurrentTableInfo
(
tableId
);
sourceAndTargetTable
.
put
(
"当前表"
,
neo4jTableList
);
getSourceTable
(
tableId
,
sourceTables
);
...
...
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