<?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" >
<mapper namespace="com.zhiqiyun.open.mapper.AuthorityInfoMapper">
    <resultMap id="BaseResultMap" type="com.zhiqiyun.open.models.AuthorityInfo">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="parent_id" property="parentId" jdbcType="BIGINT"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column">
        `id`
        , `parent_id`, `name`, `remark`
    </sql>

    <select id="findChildren" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select
        <include refid="Base_Column"/>
        from authority_info
        <where>
            `parent_id` = #{parentId}
        </where>
    </select>
</mapper>