RuleTreeNode_Mapper.xml 1.2 KB
Newer Older
1 2
<?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">
A
atsuc 已提交
3
<mapper namespace="cn.atsuc.frame.infrastructure.dao.RuleTreeNodeDao">
4

A
atsuc 已提交
5
    <resultMap id="ruleTreeNodeMap" type="cn.atsuc.frame.infrastructure.po.RuleTreeNodePO">
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
        <id column="id" property="id"/>
        <result column="tree_id" property="treeId"/>
        <result column="node_type" property="nodeType"/>
        <result column="node_value" property="nodeValue"/>
        <result column="rule_key" property="ruleKey"/>
        <result column="rule_desc" property="ruleDesc"/>
    </resultMap>

    <select id="queryRuleTreeNodeList" resultMap="ruleTreeNodeMap">
        SELECT id, tree_id, node_type, node_value, rule_key, rule_desc
        FROM rule_tree_node
        where tree_id = #{treeId}
    </select>

    <select id="queryTreeNodeCount" resultType="java.lang.Integer">
        select count(id) from rule_tree_node where tree_id = #{treeId}
    </select>

    <select id="queryTreeRulePoint" resultMap="ruleTreeNodeMap">
        SELECT distinct (rule_key), rule_desc
        FROM rule_tree_node
        where tree_id = #{treeId} and rule_key is not null
    </select>

</mapper>