Forráskód Böngészése

标准术语维护

zhaops 4 éve
szülő
commit
b5d94a8620

+ 22 - 0
src/main/java/com/diagbot/entity/node/EntityBaseInfo.java

@@ -0,0 +1,22 @@
+package com.diagbot.entity.node;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.data.neo4j.annotation.QueryResult;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/12/15 9:51
+ */
+@Getter
+@Setter
+@QueryResult
+public class EntityBaseInfo {
+    private Long id;
+    private String name;
+    private String pycode;
+    private Integer status;
+    private Integer is_kl;
+    private String labelType;
+}

+ 0 - 1
src/main/java/com/diagbot/entity/node/EntityInfo.java

@@ -2,7 +2,6 @@ package com.diagbot.entity.node;
 
 import lombok.Getter;
 import lombok.Setter;
-import org.neo4j.ogm.annotation.NodeEntity;
 import org.springframework.data.neo4j.annotation.QueryResult;
 
 /**

+ 3 - 2
src/main/java/com/diagbot/repository/EntityInfoRepository.java

@@ -1,5 +1,6 @@
 package com.diagbot.repository;
 
+import com.diagbot.entity.node.EntityBaseInfo;
 import com.diagbot.entity.node.EntityInfo;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
@@ -14,7 +15,7 @@ import java.util.List;
  * @Author:zhaops
  * @time: 2020/12/14 13:26
  */
-public interface EntityInfoRepository extends Neo4jRepository<EntityInfo,Long> {
+public interface EntityInfoRepository extends Neo4jRepository<EntityBaseInfo,Long> {
     @Query(value = "with {labels} as nlabels\n" +
             "match(n)\n" +
             "where any(label in labels(n) where label in nlabels)\n" +
@@ -33,7 +34,7 @@ public interface EntityInfoRepository extends Neo4jRepository<EntityInfo,Long> {
             "n.静态知识标识 = {is_kl} " +
             "else 1 = 1 " +
             "end ) \n" +
-            "return id(n) as id,n.name,n.拼音编码  as pycode,labels(n)[0] as labelType,n.状态 as status,n.静态知识标识 as is_kl\n" +
+            "return id(n) as id,n.name as name,n.拼音编码  as pycode,labels(n)[0] as labelType,n.状态 as status,n.静态知识标识 as is_kl\n" +
             "order by n.状态 desc, id(n) desc",
             countQuery = "with {labels} as nlabels\n" +
                     "match(n)\n" +

+ 2 - 2
src/main/java/com/diagbot/web/EntityInfoController.java

@@ -27,7 +27,7 @@ public class EntityInfoController {
     @Autowired
     EntityInfoFacade entityInfoFacade;
 
-    @ApiOperation(value = "分页查询",
+    @ApiOperation(value = "分页查询[zhaops]",
             notes = "number:页码<br>" +
                     "size:每页条目数<br>" +
                     "name:术语名称(模糊匹配)<br>" +
@@ -40,7 +40,7 @@ public class EntityInfoController {
         return RespDTO.onSuc(data);
     }
 
-    @ApiOperation(value = "唯一键校验",
+    @ApiOperation(value = "唯一键校验[zhaops]",
             notes = "name:术语名称(模糊匹配)<br>" +
                     "labelType:术语类型-知识图谱标签类型(String)<br>")
     @PostMapping("/isExist")