Browse Source

所有规则加载到换里面去

gaodm 4 years ago
parent
commit
99c958099a

+ 26 - 24
src/main/java/com/diagbot/config/CacheDeleteInit.java

@@ -29,32 +29,34 @@ public class CacheDeleteInit implements CommandLineRunner {
         cacheFacade.clear();
         log.info("CDSS-CORE服务启动清除redis缓存成功!");
 
-        cacheFacade.loadDrugTypeCache();
-        log.info("CDSS-CORE服务启动加载药品类型对应关系缓存成功!");
-
-        cacheFacade.getSymptomCache();
-        log.info("CDSS-CORE服务启动加载图谱症状缓存成功!");
-
-        cacheFacade.getVitalCache();
-        log.info("CDSS-CORE服务启动加载图谱体征缓存成功!");
-
-        cacheFacade.getSymptomFeatureCache();
-        log.info("CDSS-CORE服务启动加载症状特征缓存成功!");
-
+//        cacheFacade.loadDrugTypeCache();
+//        log.info("CDSS-CORE服务启动加载药品类型对应关系缓存成功!");
+//
+//        cacheFacade.getSymptomCache();
+//        log.info("CDSS-CORE服务启动加载图谱症状缓存成功!");
+//
+//        cacheFacade.getVitalCache();
+//        log.info("CDSS-CORE服务启动加载图谱体征缓存成功!");
+//
+//        cacheFacade.getSymptomFeatureCache();
+//        log.info("CDSS-CORE服务启动加载症状特征缓存成功!");
+//
         cacheFacade.getDiseaseCorrespondCache();
         log.info("CDSS-CORE服务启动加载疾病对应ICD10缓存成功!");
-
-        cacheFacade.getdiseaseFilterCache();
-        log.info("CDSS-CORE服务启动加载疾病过滤缓存成功!");
-
-        cacheFacade.getSymptomMainCache();
-        log.info("CDSS-CORE服务启动加载典型症状缓存成功!");
-
-        cacheFacade.loadDiseaseTypeCache();
-        log.info("CDSS-CORE服务启动加载疾病属性(性别、年龄、发病率)缓存成功!");
-
-        cacheFacade.getSymptomNumCache();
-        log.info("CDSS-CORE服务启动加载疾病对应的症状个数缓存成功!");
+//
+//        cacheFacade.getdiseaseFilterCache();
+//        log.info("CDSS-CORE服务启动加载疾病过滤缓存成功!");
+//
+//        cacheFacade.getSymptomMainCache();
+//        log.info("CDSS-CORE服务启动加载典型症状缓存成功!");
+//
+//        cacheFacade.loadDiseaseTypeCache();
+//        log.info("CDSS-CORE服务启动加载疾病属性(性别、年龄、发病率)缓存成功!");
+//
+//        cacheFacade.getSymptomNumCache();
+//        log.info("CDSS-CORE服务启动加载疾病对应的症状个数缓存成功!");
+        cacheFacade.loadAllRuleCache();
+        log.info("CDSS-CORE服务启动加载医学知识库中的所有规则缓存成功!");
 
 
         log.info("CDSS-CORE初始化完成!");

+ 26 - 0
src/main/java/com/diagbot/dto/RuleBaseDTO.java

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:25
+ */
+@Getter
+@Setter
+public class RuleBaseDTO {
+    private String baseLibName;
+    private Integer baseLibType;
+    private Integer baseType;
+    private String baseMinOperator;
+    private String baseMinValue;
+    private String baseMinUnit;
+    private String baseMaxOperator;
+    private String baseMaxValue;
+    private String baseMaxUnit;
+    private String baseEqOperator;
+    private String baseEqValue;
+    private String baseEqUnit;
+}

+ 20 - 0
src/main/java/com/diagbot/dto/RuleConditionDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:32
+ */
+@Getter
+@Setter
+public class RuleConditionDTO {
+    private Integer hasSubCond;
+    private String ruleGroup;
+    private List<RuleBaseDTO> ruleBaseDTOList = new ArrayList<>();
+}

+ 22 - 0
src/main/java/com/diagbot/dto/RuleDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:34
+ */
+@Getter
+@Setter
+public class RuleDTO {
+    private String libName;
+    private Integer libType;
+    private Integer ruleType;
+    private String msg;
+    private List<RuleConditionDTO> ruleConditionDTOList = new ArrayList<>();
+}

+ 2 - 1
src/main/java/com/diagbot/enums/RedisEnum.java

@@ -19,7 +19,8 @@ public enum RedisEnum implements KeyedNamed {
     symptomMainFeature(7, "symptomMainFeature:"),
     diseaseCorrespond(8, "diseaseCorrespond:"),
     diseaseFilter(9, "diseaseFilter:"),
-    diseaseType(2, "diseaseType:");
+    diseaseType(2, "diseaseType:"),
+    allRule(10, "allRule:");
 
     @Setter
     private int key;

+ 10 - 0
src/main/java/com/diagbot/facade/CacheFacade.java

@@ -151,6 +151,16 @@ public class CacheFacade {
 
     }
 
+    /**
+     * 缓存医学知识库中的所有规则
+     *
+     * @return
+     */
+    public void loadAllRuleCache(){
+        redisUtil.deleteByPrex(RedisEnum.allRule.getName());
+        neoFacade.allRuleCache();
+    }
+
     public void clearLoadCache(String str) {
         redisUtil.deleteByPrex(str);
     }

+ 13 - 0
src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.KlRuleServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:44
+ */
+@Component
+public class KlRuleFacade extends KlRuleServiceImpl {
+}

+ 74 - 26
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -6,8 +6,24 @@ import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.client.ChiefPresentSimilarityServiceClient;
 import com.diagbot.client.StandConvertServiceClient;
-import com.diagbot.dto.*;
-import com.diagbot.entity.*;
+import com.diagbot.dto.BillNeoDTO;
+import com.diagbot.dto.CriticalNeoDTO;
+import com.diagbot.dto.HighRiskNeoDTO;
+import com.diagbot.dto.NeoPushDTO;
+import com.diagbot.dto.NodeNeoDTO;
+import com.diagbot.dto.OtherTipNeoDTO;
+import com.diagbot.dto.OtherTipPacsNeoDTO;
+import com.diagbot.dto.OtherTipTransfusionNeoDTO;
+import com.diagbot.dto.RuleDTO;
+import com.diagbot.dto.StandConvertCrfBatchDTO;
+import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.entity.DiseaseInfo;
+import com.diagbot.entity.DiseaseProperty;
+import com.diagbot.entity.KlDiseaseCorresponding;
+import com.diagbot.entity.SymptomFeature;
+import com.diagbot.entity.SymptomNumOfDiS;
+import com.diagbot.entity.TranHospitalFilter;
 import com.diagbot.entity.node.LisRemind;
 import com.diagbot.entity.relationship.LisRemindGroup;
 import com.diagbot.entity.relationship.LisRemindMedicine;
@@ -18,7 +34,6 @@ import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.enums.StaticTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.mapper.KlDiseaseCorrespondingMapper;
 import com.diagbot.mapper.SymptomFeatureMapper;
 import com.diagbot.mapper.TranHospitalFilterMapper;
 import com.diagbot.model.entity.PD;
@@ -28,9 +43,18 @@ import com.diagbot.util.ListUtil;
 import com.diagbot.util.NeoUtil;
 import com.diagbot.util.RedisUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.BillNeoVO;
+import com.diagbot.vo.CriticalNeoVO;
 import com.diagbot.vo.Drug;
-import com.diagbot.vo.*;
-import com.diagbot.vo.neoPushEntity.*;
+import com.diagbot.vo.NeoPushVO;
+import com.diagbot.vo.StandConvert;
+import com.diagbot.vo.StandConvertCrfVO;
+import com.diagbot.vo.neoPushEntity.ChiefPushVo;
+import com.diagbot.vo.neoPushEntity.Diag;
+import com.diagbot.vo.neoPushEntity.LisPushVo;
+import com.diagbot.vo.neoPushEntity.PacsPushVo;
+import com.diagbot.vo.neoPushEntity.PresentPushVo;
+import com.diagbot.vo.neoPushEntity.Symptom;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import io.github.lvyahui8.spring.facade.DataFacade;
@@ -46,7 +70,14 @@ import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -119,6 +150,9 @@ public class NeoFacade {
     @Autowired
     TranHospitalFilterMapper tranHospitalFilterMapper;
 
+    @Autowired
+    private KlRuleFacade klRuleFacade;
+
     /**
      * 返回药品缓存信息
      *
@@ -504,10 +538,10 @@ public class NeoFacade {
     public List<String> addDiagFromPresent(List<String> lis_dis, List<String> presentDiags) {
         List<String> lis_dis_new = Lists.newArrayList();
         if (ListUtil.isNotEmpty(lis_dis) && ListUtil.isNotEmpty(presentDiags)) {
-//            if (lis_dis.size() >= 10) {
+            //            if (lis_dis.size() >= 10) {
             if (lis_dis.size() >= 1) {
                 for (int i = 0; i < lis_dis.size(); i++) {
-//                    if (i == 10 - presentDiags.size()) {
+                    //                    if (i == 10 - presentDiags.size()) {
                     if (i == 1) {
                         for (String dis : presentDiags) {
                             if (!lis_dis_new.contains(dis)) {
@@ -810,9 +844,9 @@ public class NeoFacade {
         });
         disPack.forEach((x, y) -> {
             //倒序排序
-//            Map<String, Double> collect = y.entrySet().stream()
-//                    .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
-//                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));
+            //            Map<String, Double> collect = y.entrySet().stream()
+            //                    .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
+            //                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));
             //正序排序
             Map<String, Double> collect = y.entrySet().stream()
                     .sorted(Map.Entry.comparingByValue())
@@ -845,7 +879,7 @@ public class NeoFacade {
      */
     public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository, List<String> symptoms) {
         List<String> allDis = Lists.newArrayList();
-//        allDis = symptomNameRepository.getDisBySymptoms(symptoms);
+        //        allDis = symptomNameRepository.getDisBySymptoms(symptoms);
         allDis = symptomNameRepository.getDisBySymptoms_1(symptoms);
         return allDis;
     }
@@ -966,17 +1000,17 @@ public class NeoFacade {
      */
     public List<BillNeoDTO> getBillNeo(BillNeoVO billNeoVO) {
         List<BillNeoDTO> billNeoDTOs = new ArrayList<>();
-//                try {
-//                    billNeoDTOs.addAll(getDrugBill(billNeoVO.getDrugList()));
-//                    billNeoDTOs.addAll(getPacsBill(billNeoVO.getPacsList()));
-//                    billNeoDTOs.addAll(getLisDetailBill(billNeoVO.getLisDetailList()));
-//                    billNeoDTOs.addAll(getLisBill(billNeoVO.getLisList()));
-//                    billNeoDTOs.addAll(getOperationBill(billNeoVO.getOperationList()));
-//                    billNeoDTOs.addAll(getCombiOpBill(billNeoVO.getCombiopList()));
-//                    billNeoDTOs.addAll(getTransfusionBill(billNeoVO.getTransfusionList()));
-//                } catch (Exception ex) {
-//                    ex.printStackTrace();
-//                }
+        //                try {
+        //                    billNeoDTOs.addAll(getDrugBill(billNeoVO.getDrugList()));
+        //                    billNeoDTOs.addAll(getPacsBill(billNeoVO.getPacsList()));
+        //                    billNeoDTOs.addAll(getLisDetailBill(billNeoVO.getLisDetailList()));
+        //                    billNeoDTOs.addAll(getLisBill(billNeoVO.getLisList()));
+        //                    billNeoDTOs.addAll(getOperationBill(billNeoVO.getOperationList()));
+        //                    billNeoDTOs.addAll(getCombiOpBill(billNeoVO.getCombiopList()));
+        //                    billNeoDTOs.addAll(getTransfusionBill(billNeoVO.getTransfusionList()));
+        //                } catch (Exception ex) {
+        //                    ex.printStackTrace();
+        //                }
 
         try {
             Map<String, Object> invokeParams = new HashMap<>();
@@ -1260,8 +1294,8 @@ public class NeoFacade {
     public NeoPushDTO getDiagInfo(NeoPushVO neoPushVO) {
         NeoPushDTO pushDTO = new NeoPushDTO();
         String term = neoPushVO.getDiagVo().getDiags().get(0).getName();
-//        String o = (String) redisUtil.get(RedisEnum.diseaseCorrespond.getName() + term);
-//        term = StringUtil.isNotBlank(o) ? o : term;
+        //        String o = (String) redisUtil.get(RedisEnum.diseaseCorrespond.getName() + term);
+        //        term = StringUtil.isNotBlank(o) ? o : term;
         pushDTO = this.reverseInfo(term);
 
         return pushDTO;
@@ -1349,7 +1383,7 @@ public class NeoFacade {
      * 类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 辅助检查:vital"
      *
      * @param standConvert
-     * @return Map<String, Map < String, String>> -->Map<类型, Map<原始词, 标准词>>
+     * @return Map<String ,   Map   <   String ,   String>> -->Map<类型, Map<原始词, 标准词>>
      */
     public Map<String, Map<String, String>> standConvertCrf(StandConvert standConvert) {
         Map<String, Map<String, String>> map = new LinkedHashMap<>();
@@ -1542,4 +1576,18 @@ public class NeoFacade {
         }
         map.put(type, typeMap);
     }
+
+    public void allRuleCache() {
+        List<RuleDTO> ruleDTOList = klRuleFacade.getAllRule();
+        if (ListUtil.isNotEmpty(ruleDTOList)) {
+            Map map = ruleDTOList.stream().collect(Collectors.toMap(
+                    k -> RedisEnum.allRule.getName() + k.getLibType() + "_" + k.getLibName() + "_" + k.getRuleType(),
+                    v -> {
+                        return v;
+                    },
+                    (v1, v2) -> (v2)
+            ));
+            redisTemplate.opsForValue().multiSet(map);
+        }
+    }
 }

+ 5 - 0
src/main/java/com/diagbot/mapper/KlRuleMapper.java

@@ -1,8 +1,11 @@
 package com.diagbot.mapper;
 
+import com.diagbot.dto.RuleDTO;
 import com.diagbot.entity.KlRule;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 规则信息表 Mapper 接口
@@ -13,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KlRuleMapper extends BaseMapper<KlRule> {
 
+    List<RuleDTO> getAllRule();
+
 }

+ 4 - 1
src/main/java/com/diagbot/service/KlRuleService.java

@@ -1,9 +1,12 @@
 package com.diagbot.service;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.diagbot.dto.RuleDTO;
 import com.diagbot.entity.KlRule;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 规则信息表 服务类
@@ -14,5 +17,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 @DS("med")
 public interface KlRuleService extends IService<KlRule> {
-
+    List<RuleDTO> getAllRule();
 }

+ 7 - 2
src/main/java/com/diagbot/service/impl/KlRuleServiceImpl.java

@@ -1,11 +1,14 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.RuleDTO;
 import com.diagbot.entity.KlRule;
 import com.diagbot.mapper.KlRuleMapper;
 import com.diagbot.service.KlRuleService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 规则信息表 服务实现类
@@ -16,5 +19,7 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class KlRuleServiceImpl extends ServiceImpl<KlRuleMapper, KlRule> implements KlRuleService {
-
+    public List<RuleDTO> getAllRule() {
+        return baseMapper.getAllRule();
+    }
 }

+ 1 - 0
src/main/java/com/diagbot/web/CacheController.java

@@ -41,6 +41,7 @@ public class CacheController {
         cacheFacade.getSymptomNumCache();
         cacheFacade.getSymptomFeatureCache();
         cacheFacade.getDiseaseCorrespondCache();
+        cacheFacade.loadAllRuleCache();
         return RespDTO.onSuc(true);
     }
 

+ 121 - 11
src/main/resources/mapper/KlRuleMapper.xml

@@ -1,19 +1,129 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.diagbot.mapper.KlRuleMapper">
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.KlRule">
-        <id column="id" property="id" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
-        <result column="concept_id" property="conceptId" />
-        <result column="description" property="description" />
-        <result column="rule_type" property="ruleType" />
-        <result column="status" property="status" />
+        <id column="id" property="id"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
+        <result column="concept_id" property="conceptId"/>
+        <result column="description" property="description"/>
+        <result column="rule_type" property="ruleType"/>
+        <result column="status" property="status"/>
     </resultMap>
 
+    <resultMap id="SchemaResultMap" type="com.diagbot.dto.RuleDTO">
+        <result column="libName" property="libName"/>
+        <result column="libType" property="libType"/>
+        <result column="ruleType" property="ruleType"/>
+        <result column="msg" property="msg"/>
+        <collection property="ruleConditionDTOList" ofType="com.diagbot.dto.RuleConditionDTO">
+            <result column="hasSubCond" property="hasSubCond"/>
+            <result column="ruleGroup" property="ruleGroup"/>
+            <collection property="ruleBaseDTOList" ofType="com.diagbot.dto.RuleBaseDTO">
+                <result column="baseLibName" property="baseLibName"/>
+                <result column="baseLibType" property="baseLibType"/>
+                <result column="baseType" property="baseType"/>
+                <result column="baseMinOperator" property="baseMinOperator"/>
+                <result column="baseMinValue" property="baseMinValue"/>
+                <result column="baseMinUnit" property="baseMinUnit"/>
+                <result column="baseMaxOperator" property="baseMaxOperator"/>
+                <result column="baseMaxValue" property="baseMaxValue"/>
+                <result column="baseMaxUnit" property="baseMaxUnit"/>
+                <result column="baseEqOperator" property="baseEqOperator"/>
+                <result column="baseEqValue" property="baseEqValue"/>
+                <result column="baseEqUnit" property="baseEqUnit"/>
+            </collection>
+        </collection>
+    </resultMap>
+
+    <select id="getAllRule" resultMap="SchemaResultMap">
+		SELECT
+			t10.*
+		FROM
+			(
+				SELECT
+					t4.lib_name AS libName,
+					t4.lib_type AS libType,
+					t1.rule_type AS ruleType,
+					t1.msg AS msg,
+					t1.has_sub_cond AS hasSubCond,
+					CONCAT_WS("-", t1.id, 1) AS ruleGroup,
+					"" AS baseLibName,
+					0 AS baseLibType,
+					0 AS baseType,
+					"" AS baseMinOperator,
+					"" AS baseMinValue,
+					"" AS baseMinUnit,
+					"" AS baseMaxOperator,
+					"" AS baseMaxValue,
+					"" AS baseMaxUnit,
+					"" AS baseEqOperator,
+					"" AS baseEqValue,
+					"" AS baseEqUnit
+				FROM
+					kl_rule t1,
+					kl_concept t4
+				WHERE
+					t1.is_deleted = "N"
+				AND t4.is_deleted = "N"
+				AND t1.concept_id = t4.id
+				AND t1. STATUS = 1
+				AND t4. STATUS = 1
+				AND t1.has_sub_cond = 0
+				UNION ALL
+					SELECT
+						t4.lib_name AS libName,
+						t4.lib_type AS libType,
+						t1.rule_type AS ruleType,
+						t1.msg AS msg,
+						t1.has_sub_cond AS hasSubCond,
+						CONCAT_WS("-", t1.id, t2.group_type) AS ruleGroup,
+						t5.lib_name AS baseLibName,
+						t5.lib_type AS baseLibType,
+						t3.type AS baseType,
+						t3.min_operator AS baseMinOperator,
+						t3.min_value AS baseMinValue,
+						t3.min_unit AS baseMinUnit,
+						t3.max_operator AS baseMaxOperator,
+						t3.max_value AS baseMaxValue,
+						t3.max_unit AS baseMaxUnit,
+						t3.eq_operator AS baseEqOperator,
+						t3.eq_value AS baseEqValue,
+						t3.eq_unit AS baseEqUnit
+					FROM
+						kl_rule t1,
+						kl_rule_condition t2,
+						kl_rule_base t3,
+						kl_concept t4,
+						kl_concept t5
+					WHERE
+						t1.is_deleted = "N"
+					AND t2.is_deleted = "N"
+					AND t3.is_deleted = "N"
+					AND t4.is_deleted = "N"
+					AND t5.is_deleted = "N"
+					AND t1. STATUS = 1
+					AND t3. STATUS = 1
+					AND t4. STATUS = 1
+					AND t5. STATUS = 1
+					AND t1.id = t2.rule_id
+					AND t2.rule_base_id = t3.id
+					AND t1.concept_id = t4.id
+					AND t3.concept_id = t5.id
+					AND t1.has_sub_cond = 1
+			) t10
+
+		ORDER BY
+			t10.libType,
+			t10.libName,
+			t10.ruleType,
+			t10.ruleGroup
+    </select>
+
 </mapper>