|
@@ -0,0 +1,33 @@
|
|
|
+package com.onemap.apply.mapper.dimentity;
|
|
|
+
|
|
|
+import com.onemap.apply.domain.dimentity.DimEntityDto;
|
|
|
+import com.onemap.apply.domain.dimentity.DimEntityVo;
|
|
|
+import org.springframework.data.neo4j.repository.Neo4jRepository;
|
|
|
+import org.springframework.data.neo4j.repository.ReactiveNeo4jRepository;
|
|
|
+import org.springframework.data.neo4j.repository.query.Query;
|
|
|
+import org.springframework.data.repository.query.Param;
|
|
|
+import org.springframework.stereotype.Repository;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Repository
|
|
|
+public interface DimEntityReponsitory extends Neo4jRepository<DimEntityDto, String> {
|
|
|
+ @Query("match(n:Entity{ entityid:'MA1001NE103K1034230XXXXXXXXXXXXX2501010009'}) -[r]->(b) return n,r,b")
|
|
|
+ List<Object> findEntityRelationships(@Param("entityid") String entityid);
|
|
|
+
|
|
|
+ @Query("match (n:Entity{ entityid:'MA1001NE103K1034230XXXXXXXXXXXXX2501010009'}) -[r]->(b) return r")
|
|
|
+ List<Object> findEntityRelationships2();
|
|
|
+
|
|
|
+ @Query("match (n:Entity{ entityid:'MA1001NE103K1034230XXXXXXXXXXXXX2501010009'}) -[r]->(b:Entity) return b.entityid as a , type(r) as b ")
|
|
|
+ List<DimEntityVo> findEntityRelationships3();
|
|
|
+
|
|
|
+ @Query("match(n:Entity{ entityid:$entityid }) return n")
|
|
|
+ DimEntityDto findEntityRelationships4(@Param("entityid") String entityid);
|
|
|
+
|
|
|
+
|
|
|
+ @Query("match (a:Entity {entityid:$aentityid }), " +
|
|
|
+ "(b:Entity {entityid:$bentityid }) MERGE (a)-[r]->(b) SET r.type = $centityid ")
|
|
|
+ void findEntityRelationships5(@Param("aentityid") String aentityid, @Param("bentityid") String baentityid, @Param("centityid") String centityid);
|
|
|
+
|
|
|
+
|
|
|
+}
|