|
@@ -300,26 +300,71 @@
|
|
|
|
|
|
<select id="getRuleInitDTO" resultType="com.diagbot.dto.RuleInitDTO">
|
|
|
SELECT
|
|
|
- CONCAT_WS("_",t1.concept_id,t1.rule_type) AS conceptGroup,
|
|
|
- t1.id AS ruleId,
|
|
|
- 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
|
|
|
+ *
|
|
|
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
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.concept_id AS conceptId,
|
|
|
+ CONCAT_WS(
|
|
|
+ "_",
|
|
|
+ t1.concept_id,
|
|
|
+ t1.rule_type
|
|
|
+ ) AS conceptGroup,
|
|
|
+ t1.id AS ruleId,
|
|
|
+ t4.lib_name AS libName,
|
|
|
+ t4.lib_type AS libType,
|
|
|
+ t1.rule_type AS ruleType,
|
|
|
+ t1.has_sub_cond AS hasSubCond,
|
|
|
+ t1.msg AS msg,
|
|
|
+ t1.gmt_modified AS gmtModified
|
|
|
+ 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 t4.lib_type BETWEEN 100 AND 299
|
|
|
+ UNION
|
|
|
+ SELECT
|
|
|
+ t11.id AS conceptId,
|
|
|
+ CONCAT_WS("_", t11.id, t1.rule_type) AS conceptGroup,
|
|
|
+ t1.id AS ruleId,
|
|
|
+ t11.lib_name AS libName,
|
|
|
+ t11.lib_type AS libType,
|
|
|
+ t1.rule_type AS ruleType,
|
|
|
+ t1.has_sub_cond AS hasSubCond,
|
|
|
+ t1.msg AS msg,
|
|
|
+ t1.gmt_modified AS gmtModified
|
|
|
+ FROM
|
|
|
+ kl_rule t1,
|
|
|
+ kl_concept t4,
|
|
|
+ kl_relation t10,
|
|
|
+ kl_concept t11
|
|
|
+ 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 t4.lib_type BETWEEN 300 AND 399
|
|
|
+ AND t10.start_id = t4.id
|
|
|
+ AND t10.relation_id = 600
|
|
|
+ AND t10.end_id = t11.id
|
|
|
+ AND t11.lib_type BETWEEN 100 AND 299
|
|
|
+ AND t10.is_deleted = "N"
|
|
|
+ AND t11.is_deleted = "N"
|
|
|
+ AND t10. STATUS = 1
|
|
|
+ AND t11. STATUS = 1
|
|
|
+ ) t12
|
|
|
ORDER BY
|
|
|
- t1.concept_id,
|
|
|
- t1.rule_type,
|
|
|
- t1.has_sub_cond
|
|
|
+ t12.conceptId,
|
|
|
+ t12.ruleType,
|
|
|
+ t12.hasSubCond,
|
|
|
+ t12.gmtModified DESC,
|
|
|
+ t12.ruleId DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="getRuleConditionInitDTO" resultType="com.diagbot.dto.RuleConditionInitDTO">
|
|
@@ -331,9 +376,7 @@
|
|
|
FROM
|
|
|
kl_rule_condition t2
|
|
|
ORDER BY
|
|
|
- t2.rule_id,
|
|
|
- t2.group_type,
|
|
|
- t2.rule_base_id
|
|
|
+ t2.id DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="getRuleBaseInitDTO" resultType="com.diagbot.dto.RuleBaseInitDTO">
|