|
@@ -694,74 +694,82 @@
|
|
|
</if>
|
|
|
) t12
|
|
|
<if test="(baseLibType!=null) or (baseLibName!=null and baseLibName!='')">
|
|
|
- INNER JOIN
|
|
|
- (SELECT
|
|
|
- t2.rule_id AS ruleId,
|
|
|
- t3.id AS ruleBaseId,
|
|
|
- t5.lib_name AS baseLibName,
|
|
|
- t5.lib_type AS baseLibType,
|
|
|
- t3.type AS baseType
|
|
|
- FROM
|
|
|
- kl_rule_condition t2,
|
|
|
- kl_rule_base t3,
|
|
|
- kl_concept t5
|
|
|
- WHERE
|
|
|
- t3.is_deleted = "N"
|
|
|
- AND t5.is_deleted = "N"
|
|
|
- AND t2.is_deleted = "N"
|
|
|
- AND t2.rule_base_id = t3.id
|
|
|
- AND t3. STATUS = 1
|
|
|
- AND t5. STATUS = 1
|
|
|
- AND t3.concept_id = t5.id
|
|
|
- <if test="baseLibName!=null and baseLibName!=''">
|
|
|
- AND UPPER(t5.lib_name) LIKE CONCAT('%', UPPER(trim(#{baseLibName})), '%')
|
|
|
- </if>
|
|
|
- <if test="baseLibType !=null">
|
|
|
- AND t5.lib_type = #{baseLibType}
|
|
|
- </if>
|
|
|
- AND (t5.lib_type BETWEEN 100 AND 299
|
|
|
- OR t5.lib_type= 410)
|
|
|
- UNION ALL
|
|
|
- SELECT
|
|
|
- t2.rule_id AS ruleId,
|
|
|
- t3.id AS ruleBaseId,
|
|
|
- t11.lib_name AS baseLibName,
|
|
|
- t11.lib_type AS baseLibType,
|
|
|
- t3.type AS baseType
|
|
|
- FROM
|
|
|
- kl_rule_condition t2,
|
|
|
- kl_rule_base t3,
|
|
|
- kl_concept t5,
|
|
|
- kl_relation t10,
|
|
|
- kl_concept t11
|
|
|
- WHERE
|
|
|
- t3.is_deleted = "N"
|
|
|
- AND t5.is_deleted = "N"
|
|
|
- AND t2.is_deleted = "N"
|
|
|
- AND t2.rule_base_id = t3.id
|
|
|
- AND t3. STATUS = 1
|
|
|
- AND t5. STATUS = 1
|
|
|
- AND t3.concept_id = t5.id
|
|
|
- AND t5.lib_type BETWEEN 300 AND 399
|
|
|
- AND t10.start_id = t5.id
|
|
|
- AND t10.relation_id = 600
|
|
|
- AND t10.end_id = t11.id
|
|
|
- <if test="baseLibName!=null and baseLibName!=''">
|
|
|
- AND UPPER(t11.lib_name) LIKE CONCAT('%', UPPER(trim(#{baseLibName})), '%')
|
|
|
- </if>
|
|
|
- <if test="baseLibType !=null">
|
|
|
- AND t11.lib_type = #{baseLibType}
|
|
|
- </if>
|
|
|
- AND (t11.lib_type BETWEEN 100 AND 299
|
|
|
- OR t11.lib_type = 410)
|
|
|
- AND t10.is_deleted = "N"
|
|
|
- AND t11.is_deleted = "N"
|
|
|
- AND t10. STATUS = 1
|
|
|
- AND t11. STATUS = 1) t13 ON t12.ruleId = t13.ruleId
|
|
|
+ WHERE t12.ruleId IN
|
|
|
+ <foreach collection="ruleIds" open="(" close=")" separator="," item="ruleId">
|
|
|
+ #{ruleId}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
ORDER BY
|
|
|
t12.gmtModified DESC,
|
|
|
t12.ruleId DESC,
|
|
|
t12.conceptId DESC
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getRuleNotHaveClass" resultType="com.diagbot.dto.RuleIdDTO" parameterType="com.diagbot.vo.RuleBaseQueryVO">
|
|
|
+ SELECT
|
|
|
+ t2.rule_id AS ruleId,
|
|
|
+ t3.id AS ruleBaseId,
|
|
|
+ t5.lib_name AS baseLibName,
|
|
|
+ t5.lib_type AS baseLibType,
|
|
|
+ t3.type AS baseType
|
|
|
+ FROM
|
|
|
+ kl_rule_condition t2,
|
|
|
+ kl_rule_base t3,
|
|
|
+ kl_concept t5
|
|
|
+ WHERE
|
|
|
+ t3.is_deleted = "N"
|
|
|
+ AND t5.is_deleted = "N"
|
|
|
+ AND t2.is_deleted = "N"
|
|
|
+ AND t2.rule_base_id = t3.id
|
|
|
+ AND t3. STATUS = 1
|
|
|
+ AND t5. STATUS = 1
|
|
|
+ AND t3.concept_id = t5.id
|
|
|
+ <if test="baseLibName!=null and baseLibName!=''">
|
|
|
+ AND UPPER(t5.lib_name) LIKE CONCAT('%', UPPER(trim(#{baseLibName})), '%')
|
|
|
+ </if>
|
|
|
+ <if test="baseLibType !=null">
|
|
|
+ AND t5.lib_type = #{baseLibType}
|
|
|
+ </if>
|
|
|
+ AND (t5.lib_type BETWEEN 100 AND 299
|
|
|
+ OR t5.lib_type= 410)
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getRuleHaveClass" resultType="com.diagbot.dto.RuleIdDTO" parameterType="com.diagbot.vo.RuleBaseQueryVO">
|
|
|
+ SELECT
|
|
|
+ t2.rule_id AS ruleId,
|
|
|
+ t3.id AS ruleBaseId,
|
|
|
+ t11.lib_name AS baseLibName,
|
|
|
+ t11.lib_type AS baseLibType,
|
|
|
+ t3.type AS baseType
|
|
|
+ FROM
|
|
|
+ kl_rule_condition t2,
|
|
|
+ kl_rule_base t3,
|
|
|
+ kl_concept t5,
|
|
|
+ kl_relation t10,
|
|
|
+ kl_concept t11
|
|
|
+ WHERE
|
|
|
+ t3.is_deleted = "N"
|
|
|
+ AND t5.is_deleted = "N"
|
|
|
+ AND t2.is_deleted = "N"
|
|
|
+ AND t2.rule_base_id = t3.id
|
|
|
+ AND t3. STATUS = 1
|
|
|
+ AND t5. STATUS = 1
|
|
|
+ AND t3.concept_id = t5.id
|
|
|
+ AND t5.lib_type BETWEEN 300 AND 399
|
|
|
+ AND t10.start_id = t5.id
|
|
|
+ AND t10.relation_id = 600
|
|
|
+ AND t10.end_id = t11.id
|
|
|
+ <if test="baseLibName!=null and baseLibName!=''">
|
|
|
+ AND UPPER(t11.lib_name) LIKE CONCAT('%', UPPER(trim(#{baseLibName})), '%')
|
|
|
+ </if>
|
|
|
+ <if test="baseLibType !=null">
|
|
|
+ AND t11.lib_type = #{baseLibType}
|
|
|
+ </if>
|
|
|
+ AND (t11.lib_type BETWEEN 100 AND 299
|
|
|
+ OR t11.lib_type = 410)
|
|
|
+ AND t10.is_deleted = "N"
|
|
|
+ AND t11.is_deleted = "N"
|
|
|
+ AND t10. STATUS = 1
|
|
|
+ AND t11. STATUS = 1
|
|
|
+ </select>
|
|
|
</mapper>
|