gaodm 5 лет назад
Родитель
Сommit
d936864a4e
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      ltkg-service/src/main/resources/mapper/KgMapper.xml

+ 2 - 1
ltkg-service/src/main/resources/mapper/KgMapper.xml

@@ -26,7 +26,8 @@
     </resultMap>
 
     <select id="getNode" parameterType='com.diagbot.vo.KgQueryVO' resultType="com.diagbot.dto.NodeDTO">
-        Match (n:${labelName}) where n.name STARTS WITH #{inputStr} with collect(n.name) as rows1
+        Match (n:${labelName}) where n.name = #{inputStr} with collect(n.name) as rows0
+        OPTIONAL Match (n:${labelName}) where n.name STARTS WITH #{inputStr} with rows0 + collect(n.name) as rows1
         OPTIONAL Match (n:${labelName}) where n.name CONTAINS #{inputStr} with rows1 + collect(n.name) as rows
         unwind rows as row
         with distinct row as x