Browse Source

Merge branch 'dev/staticKnowledge20210407' into dev/evaluation_20210412

gaodm 4 years ago
parent
commit
583e79ddfc

+ 28 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeIndexPageDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/7 13:29
+ */
+@Getter
+@Setter
+public class StaticKnowledgeIndexPageDTO extends StaticKnowledgeIndexDTO {
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 摘要
+     */
+    private String abstractContent;
+}

+ 58 - 0
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.KlConceptDetailDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
 import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.dto.StaticKnowledgeDetailDTO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.entity.KlConceptDetail;
 import com.diagbot.entity.KlConceptStatic;
@@ -30,6 +31,7 @@ import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.IdVO;
 import com.diagbot.vo.KlConceptStaticPageVO;
 import com.diagbot.vo.KlConceptStaticVO;
+import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import com.diagbot.vo.StaticKnowledgeVO;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -63,6 +65,10 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
     @Autowired
     @Qualifier("klConceptDetailServiceImpl")
     private KlConceptDetailService klConceptDetailService;
+    @Autowired
+    private DictionaryFacade dictionaryFacade;
+    @Autowired
+    private MedRetrievalFacade medRetrievalFacade;
 
     /**
      * 获取静态知识
@@ -241,6 +247,58 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         return page;
     }
 
+    /**
+     * 静态知识检索-分页返回
+     * @param staticKnowledgeIndexPageVO
+     * @return
+     */
+    public IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
+        staticKnowledgeIndexPageVO.setTypeIds(new ArrayList<>());
+
+        List<Integer> types = staticKnowledgeIndexPageVO.getTypes();
+
+        List<DictionaryInfoDTO> dicType = dictionaryFacade.getListByGroupType(10);
+        Map<String, String> dicTypeMap = EntityUtil.makeMapWithKeyValue(dicType, "name", "val");
+        List<DictionaryInfoDTO> dicTypeName = dictionaryFacade.getListByGroupType(13);
+
+        //检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、5-手术和操作
+        if (ListUtil.isEmpty(types)
+                || (ListUtil.isNotEmpty(types) && types.contains(0))) {
+            staticKnowledgeIndexPageVO.getTypeIds().addAll(Arrays.asList(new Integer[] { 100, 101, 106, 107, 108, 109, 110 }));
+        } else {
+            if (types.contains(1)) {
+                staticKnowledgeIndexPageVO.getTypeIds().add(100);
+            }
+            if (types.contains(2)) {
+                staticKnowledgeIndexPageVO.getTypeIds().add(101);
+            }
+            if (types.contains(3)) {
+                staticKnowledgeIndexPageVO.getTypeIds().add(107);
+                staticKnowledgeIndexPageVO.getTypeIds().add(108);
+            }
+            if (types.contains(5)) {
+                staticKnowledgeIndexPageVO.getTypeIds().add(109);
+                staticKnowledgeIndexPageVO.getTypeIds().add(110);
+            }
+            if (types.contains(6)) {
+                staticKnowledgeIndexPageVO.getTypeIds().add(106);
+            }
+        }
+        IPage<StaticKnowledgeIndexPageDTO> page = super.staticIndexPage(staticKnowledgeIndexPageVO);
+
+        List<StaticKnowledgeIndexPageDTO> records = page.getRecords();
+
+        records.forEach(i -> {
+            i.setTypeName(medRetrievalFacade.convertTypeName(i.getTypeName(), 2, dicTypeName));
+            if (dicTypeMap.containsKey(i.getTypeName())) {
+                i.setType(Integer.valueOf(dicTypeMap.get(i.getTypeName())));
+            }
+        });
+
+        page.setRecords(records);
+        return page;
+    }
+
     /**
      * 保存记录(新增or修改)
      *

+ 5 - 1
src/main/java/com/diagbot/mapper/KlConceptStaticMapper.java

@@ -3,8 +3,10 @@ package com.diagbot.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -18,4 +20,6 @@ import org.apache.ibatis.annotations.Param;
 public interface KlConceptStaticMapper extends BaseMapper<KlConceptStatic> {
 
     IPage<KlConceptStaticDTO> getPage(@Param("klConceptStaticPageVO") KlConceptStaticPageVO klConceptStaticPageVO);
-}
+
+    IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(@Param("staticKnowledgeIndexPageVO") StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO);
+}

+ 4 - 0
src/main/java/com/diagbot/service/KlConceptStaticService.java

@@ -3,8 +3,10 @@ package com.diagbot.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -18,4 +20,6 @@ import org.apache.ibatis.annotations.Param;
 public interface KlConceptStaticService extends IService<KlConceptStatic> {
 
     IPage<KlConceptStaticDTO> getPage(@Param("klConceptStaticPageVO") KlConceptStaticPageVO klConceptStaticPageVO);
+
+    IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(@Param("staticKnowledgeIndexPageVO") StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO);
 }

+ 7 - 1
src/main/java/com/diagbot/service/impl/KlConceptStaticServiceImpl.java

@@ -1,12 +1,14 @@
 package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.mapper.KlConceptStaticMapper;
 import com.diagbot.service.KlConceptStaticService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
@@ -24,4 +26,8 @@ public class KlConceptStaticServiceImpl extends ServiceImpl<KlConceptStaticMappe
     public IPage<KlConceptStaticDTO> getPage(@Param("klConceptStaticPageVO") KlConceptStaticPageVO klConceptStaticPageVO) {
         return baseMapper.getPage(klConceptStaticPageVO);
     }
+
+    public IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(@Param("staticKnowledgeIndexPageVO") StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
+        return baseMapper.staticIndexPage(staticKnowledgeIndexPageVO);
+    }
 }

+ 33 - 0
src/main/java/com/diagbot/vo/StaticKnowledgeIndexPageVO.java

@@ -0,0 +1,33 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/7 13:18
+ */
+@Getter
+@Setter
+public class StaticKnowledgeIndexPageVO extends Page {
+    /**
+     * 检索内容
+     */
+    @NotBlank(message = "请输入检索内容")
+    private String inputStr;
+    /**
+     * 检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、5-手术和操作
+     */
+    @NotNull(message = "请输入检索类型")
+    private List<Integer> types;
+
+    @ApiModelProperty(hidden = true)
+    private List<Integer> typeIds;
+}

+ 16 - 0
src/main/java/com/diagbot/web/KlConceptStaticController.java

@@ -7,6 +7,7 @@ import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.StaticKnowledgeDTO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.facade.KlConceptStaticFacade;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.ChangeStatusVO;
@@ -14,6 +15,7 @@ import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.IdVO;
 import com.diagbot.vo.KlConceptStaticPageVO;
 import com.diagbot.vo.KlConceptStaticVO;
+import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import com.diagbot.vo.StaticKnowledgeVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -66,6 +68,20 @@ public class KlConceptStaticController {
         return RespDTO.onSuc(page);
     }
 
+    @ApiOperation(value = "静态知识检索(分页返回)[zhaops]",
+            notes = "types: 类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作 <br>" +
+                    "inputStr: 检索内容<br>")
+    @PostMapping("/staticIndexPage")
+    @SysLogger("staticIndexPage")
+    @SuppressWarnings("unchecked")
+    public RespDTO<Page<StaticKnowledgeIndexPageDTO>> staticIndexPage(@Valid @RequestBody StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
+        IPage<StaticKnowledgeIndexPageDTO> data = klConceptStaticFacade.staticIndexPage(staticKnowledgeIndexPageVO);
+        Page<StaticKnowledgeIndexPageDTO> page = new Page<>();
+        BeanUtil.copyProperties(data, page);
+        return RespDTO.onSuc(page);
+    }
+
+
     @ApiOperation(value = "保存静态知识-新增或修改[zhaops]",
             notes = "id: id <br>" +
                     "name: 术语名称 <br>" +

+ 13 - 4
src/main/resources/mapper/KlConceptMapper.xml

@@ -167,7 +167,8 @@
 		SELECT
 		t.id,
 		t.NAME,
-		t.retrievalName,
+		IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
+		t.isConcept,
 		t.type,
 		t.typeName,
 		l1.icd10_code AS code
@@ -176,6 +177,7 @@
 		SELECT
 		a.NAME AS retrievalName,
 		a.spell AS spell,
+		a.is_concept AS isConcept,
 		b.id AS id,
 		b.lib_name AS NAME,
 		b.lib_type AS type,
@@ -210,7 +212,8 @@
 		SELECT
 		t.id,
 		t.NAME,
-		t.retrievalName,
+		IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
+		t.isConcept,
 		t.type,
 		t.typeName,
 		l1.icd10_code AS code
@@ -219,6 +222,7 @@
 		SELECT
 		a.NAME AS retrievalName,
 		a.spell AS spell,
+		a.is_concept AS isConcept,
 		b.id AS id,
 		b.lib_name AS NAME,
 		b.lib_type AS type,
@@ -253,7 +257,8 @@
 		SELECT
 		t.id,
 		t.NAME,
-		t.retrievalName,
+		IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
+		t.isConcept,
 		t.type,
 		t.typeName,
 		l1.icd10_code AS code
@@ -262,6 +267,7 @@
 		SELECT
 		a.NAME AS retrievalName,
 		a.spell AS spell,
+		a.is_concept AS isConcept,
 		b.id AS id,
 		b.lib_name AS NAME,
 		b.lib_type AS type,
@@ -298,6 +304,7 @@
 			e.id AS id,
 			e.lib_name AS NAME,
 			b.lib_name AS retrievalName,
+			1 AS isConcept,
 			e.lib_type AS type,
 			c.name AS typeName,
 			NULL AS code
@@ -329,6 +336,7 @@
 			e.id AS id,
 			e.lib_name AS NAME,
 			b.lib_name AS retrievalName,
+			1 AS isConcept,
 			e.lib_type AS type,
 			c.name AS typeName,
 			NULL AS code
@@ -360,6 +368,7 @@
 			e.id AS id,
 			e.lib_name AS NAME,
 			b.lib_name AS retrievalName,
+			1 AS isConcept,
 			e.lib_type AS type,
 			c.name AS typeName,
 			NULL AS code
@@ -406,7 +415,7 @@
 				</when>
 			</choose>
 		</if>
-		order  by f.type asc
+		order  by f.type asc,f.isConcept DESC
 		<if test="size!=null">
 			LIMIT #{size}
 		</if>

+ 268 - 24
src/main/resources/mapper/KlConceptStaticMapper.xml

@@ -16,30 +16,6 @@
         <result column="notice_name" property="noticeName" />
     </resultMap>
 
-    <select id="getStaticInfo" resultType="com.diagbot.entity.KlConceptStatic">
-        SELECT
-        b.*
-        FROM
-        kl_concept a,
-        kl_concept_static b,
-        kl_lexicon c
-        WHERE
-        a.is_deleted = 'N'
-        AND b.is_deleted = 'N'
-        AND c.is_deleted = 'N'
-        AND a.id = b.concept_id
-        AND a.lib_type = c.CODE
-        <if test="status!=null and status!=''">
-            AND b.`status` = #{status}
-        </if>
-        <if test="name!=null and name!=''">
-            AND a.lib_name = #{name}
-        </if>
-        <if test="typeName!=null and typeName!=''">
-            AND c.NAME = #{typeName}
-        </if>
-    </select>
-
     <!-- 分页查询 -->
     <select id="getPage" resultType="com.diagbot.dto.KlConceptStaticDTO">
         SELECT
@@ -85,4 +61,272 @@
         t1.status DESC,
         t1.gmtModified DESC
     </select>
+
+    <!-- 静态知识检索分页返回 -->
+    <select id="staticIndexPage" resultType="com.diagbot.dto.StaticKnowledgeIndexPageDTO">
+        SELECT
+        f.*
+        FROM
+        (
+        SELECT
+        distinct
+        s.*,
+        s1.concept_id AS conceptId,
+        s1.clinical_pathway_name AS clinicalPathwayName,
+        s1.notice_name AS noticeName,
+        s1.`status` AS status,
+        IF( count( s2.id )> 0, 1, 0 ) AS hasInfo ,
+        IF( sum( IF ( FIND_IN_SET( 1, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasStaticKnowledge,
+        IF( sum( IF ( FIND_IN_SET( 2, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasNotice,
+        IF( sum( IF ( FIND_IN_SET( 3, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasClinicalPathway,
+        IF( sum( IF ( FIND_IN_SET( 4, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasTreatInfo,
+        s2.content as abstractContent
+        FROM
+        (
+        SELECT
+        t.id,
+        t.NAME,
+        IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
+        t.isConcept,
+        t.type,
+        t.typeName,
+        l1.icd10_code AS code
+        FROM
+        (
+        SELECT
+        a.NAME AS retrievalName,
+        a.spell AS spell,
+        a.is_concept AS isConcept,
+        b.id AS id,
+        b.lib_name AS NAME,
+        b.lib_type AS type,
+        c.NAME AS typeName
+        FROM
+        kl_library_info a,
+        kl_concept b,
+        kl_lexicon c
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.concept_id = b.id
+        AND b.lib_type = c.code
+        AND b.`status` = 1
+        <if test="staticKnowledgeIndexPageVO.typeIds != null and staticKnowledgeIndexPageVO.typeIds.size > 0">
+            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")" >
+                a.type_id =#{typeId}
+            </foreach>
+        </if>
+        ) t
+        LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
+        AND l1.is_deleted = 'N'
+        WHERE
+        1=1
+        <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+            AND ( t.retrievalName = #{staticKnowledgeIndexPageVO.inputStr}
+            OR LOWER(t.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
+            OR LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
+        </if>
+        UNION
+        SELECT
+        t.id,
+        t.NAME,
+        IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
+        t.isConcept,
+        t.type,
+        t.typeName,
+        l1.icd10_code AS code
+        FROM
+        (
+        SELECT
+        a.NAME AS retrievalName,
+        a.spell AS spell,
+        a.is_concept AS isConcept,
+        b.id AS id,
+        b.lib_name AS NAME,
+        b.lib_type AS type,
+        c.NAME AS typeName
+        FROM
+        kl_library_info a,
+        kl_concept b,
+        kl_lexicon c
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.concept_id = b.id
+        AND b.lib_type = c.code
+        AND b.`status` = 1
+        <if test="staticKnowledgeIndexPageVO.typeIds != null and staticKnowledgeIndexPageVO.typeIds.size > 0">
+            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")" >
+                a.type_id =#{typeId}
+            </foreach>
+        </if>
+        ) t
+        LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
+        AND l1.is_deleted = 'N'
+        WHERE
+        1=1
+        <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+            AND ( t.retrievalName LIKE concat(#{staticKnowledgeIndexPageVO.inputStr},'%')
+            OR LOWER(t.spell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
+            OR LOWER(l1.icd10_code) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
+        </if>
+        UNION
+        SELECT
+        t.id,
+        t.NAME,
+        IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
+        t.isConcept,
+        t.type,
+        t.typeName,
+        l1.icd10_code AS code
+        FROM
+        (
+        SELECT
+        a.NAME AS retrievalName,
+        a.spell AS spell,
+        a.is_concept AS isConcept,
+        b.id AS id,
+        b.lib_name AS NAME,
+        b.lib_type AS type,
+        c.NAME AS typeName
+        FROM
+        kl_library_info a,
+        kl_concept b,
+        kl_lexicon c
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.concept_id = b.id
+        AND b.lib_type = c.code
+        AND b.`status` = 1
+        <if test="staticKnowledgeIndexPageVO.typeIds != null and staticKnowledgeIndexPageVO.typeIds.size > 0">
+            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")" >
+                a.type_id =#{typeId}
+            </foreach>
+        </if>
+        ) t
+        LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
+        AND l1.is_deleted = 'N'
+        WHERE
+        1=1
+        <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+            AND ( t.retrievalName LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')
+            OR LOWER(t.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
+            OR LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
+        </if>
+        <if test="(staticKnowledgeIndexPageVO.types != null and staticKnowledgeIndexPageVO.types.size > 0 and (staticKnowledgeIndexPageVO.types.contains(0) or staticKnowledgeIndexPageVO.types.contains(3))) or staticKnowledgeIndexPageVO.types==null or staticKnowledgeIndexPageVO.types.size==0">
+            UNION
+            SELECT DISTINCT
+            e.id AS id,
+            e.lib_name AS NAME,
+            b.lib_name AS retrievalName,
+            1 AS isConcept,
+            e.lib_type AS type,
+            c.name AS typeName,
+            NULL AS code
+            FROM
+            kl_library_info a,
+            kl_concept b,
+            kl_lexicon c,
+            kl_relation d,
+            kl_concept e
+            WHERE
+            a.is_deleted = 'N'
+            AND b.is_deleted = 'N'
+            AND c.is_deleted = 'N'
+            AND d.is_deleted = 'N'
+            AND e.is_deleted = 'N'
+            AND a.concept_id = b.id
+            AND b.id = d.end_id
+            AND e.id = d.start_id
+            AND e.lib_type = c.code
+            AND b.lib_type = 108
+            AND e.lib_type = 107
+            AND d.relation_id = 600
+            AND b.`status` = 1
+            <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+                AND ( a.name = #{staticKnowledgeIndexPageVO.inputStr} OR LOWER(a.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
+            </if>
+            UNION
+            SELECT DISTINCT
+            e.id AS id,
+            e.lib_name AS NAME,
+            b.lib_name AS retrievalName,
+            1 AS isConcept,
+            e.lib_type AS type,
+            c.name AS typeName,
+            NULL AS code
+            FROM
+            kl_library_info a,
+            kl_concept b,
+            kl_lexicon c,
+            kl_relation d,
+            kl_concept e
+            WHERE
+            a.is_deleted = 'N'
+            AND b.is_deleted = 'N'
+            AND c.is_deleted = 'N'
+            AND d.is_deleted = 'N'
+            AND e.is_deleted = 'N'
+            AND a.concept_id = b.id
+            AND b.id = d.end_id
+            AND e.id = d.start_id
+            AND e.lib_type = c.code
+            AND b.lib_type = 108
+            AND e.lib_type = 107
+            AND d.relation_id = 600
+            AND b.`status` = 1
+            <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+                AND ( a.name LIKE concat(#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
+            </if>
+            UNION
+            SELECT DISTINCT
+            e.id AS id,
+            e.lib_name AS NAME,
+            b.lib_name AS retrievalName,
+            1 AS isConcept,
+            e.lib_type AS type,
+            c.name AS typeName,
+            NULL AS code
+            FROM
+            kl_library_info a,
+            kl_concept b,
+            kl_lexicon c,
+            kl_relation d,
+            kl_concept e
+            WHERE
+            a.is_deleted = 'N'
+            AND b.is_deleted = 'N'
+            AND c.is_deleted = 'N'
+            AND d.is_deleted = 'N'
+            AND e.is_deleted = 'N'
+            AND a.concept_id = b.id
+            AND b.id = d.end_id
+            AND e.id = d.start_id
+            AND e.lib_type = c.code
+            AND b.lib_type = 108
+            AND e.lib_type = 107
+            AND d.relation_id = 600
+            AND b.`status` = 1
+            <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+                AND ( a.name LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
+            </if>
+        </if>
+        ) s,
+        kl_concept_static s1,
+        kl_concept_detail s2
+        WHERE s.id = s1.concept_id
+        AND s.id = s2.concept_id
+        AND s1.is_deleted = 'N'
+        AND s2.is_deleted = 'N'
+        AND (FIND_IN_SET( 1, s2.content_type ) OR FIND_IN_SET( 2, s2.content_type ) OR FIND_IN_SET( 3, s2.content_type ))
+        GROUP BY s.id
+        ORDER BY s.type ASC,
+        s.isConcept DESC,
+        s2.order_no ASC
+        ) f
+    </select>
 </mapper>