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

检索小写转换大写

wangyu 6 éve
szülő
commit
1898a350e3

+ 0 - 2
aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -214,7 +214,6 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @return
      */
     public List<ConceptRetrievalDTO> retrivelConceptInfo(RetrievalVO retrievalVO){
-        retrievalVO.setInputStr(retrievalVO.getInputStr().toUpperCase());//拼音转换为大写
         if (null != retrievalVO.getType()){
             retrievalVO.setType(ParamConvertUtil.conceptConvert2Lib(retrievalVO.getType()));//标签类型
         }
@@ -237,7 +236,6 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @return
      */
     public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO){
-        getStaticKnowledgeVO.setInputStr(getStaticKnowledgeVO.getInputStr().toUpperCase());//拼音转换为大写
         List<RetrievalDTO> retrievalDTOS = new ArrayList<>();
         RetrievalVO retrievalVO = new RetrievalVO();
         RetrievalDTO retrievalDTO = new RetrievalDTO();

+ 6 - 6
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -214,7 +214,7 @@
         AND <![CDATA[ t3.min_age <= #{age} ]]>
         AND <![CDATA[ t3.max_age >= #{age} ]]>
         </if>
-        AND (t2.spell =  #{InputStr} OR t2.name =  #{InputStr})
+        AND (t2.spell =  UPPER(#{InputStr}) OR t2.name =  #{InputStr})
         <if test="inputIds != null and inputIds.size > 0">
             and t1.id not in
             <foreach item="id" collection="inputIds" open="(" separator="," close=")">
@@ -249,7 +249,7 @@
             AND <![CDATA[ t3.min_age <= #{age} ]]>
             AND <![CDATA[ t3.max_age >= #{age} ]]>
         </if>
-        AND (t2.spell LIKE CONCAT( #{InputStr},'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
+        AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
         <if test="inputIds != null and inputIds.size > 0">
             and t1.id not in
             <foreach item="id" collection="inputIds" open="(" separator="," close=")">
@@ -284,7 +284,7 @@
             AND <![CDATA[ t3.min_age <= #{age} ]]>
             AND <![CDATA[ t3.max_age >= #{age} ]]>
         </if>
-        AND (t2.spell LIKE CONCAT('%',#{InputStr},'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
+        AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
         <if test="inputIds != null and inputIds.size > 0">
             and t1.id not in
             <foreach item="id" collection="inputIds" open="(" separator="," close=")">
@@ -321,7 +321,7 @@
                 #{id}
             </foreach>
         </if>
-        AND (t2.spell =  #{InputStr} OR t2.name =  #{InputStr})
+        AND (t2.spell =  UPPER(#{InputStr}) OR t2.name =  #{InputStr})
         UNION
         SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
         LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
@@ -351,7 +351,7 @@
                 #{id}
             </foreach>
         </if>
-        AND (t2.spell LIKE CONCAT( #{InputStr},'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
+        AND (t2.spell LIKE CONCAT( UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
         UNION
         SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
         LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
@@ -381,7 +381,7 @@
                 #{id}
             </foreach>
         </if>
-        AND (t2.spell LIKE CONCAT('%',#{InputStr},'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
+        AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
         ) a1
         GROUP BY a1.selfId,a1.showType
     </select>