<?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="io.renren.modules.sys.dao.RdSiteDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="io.renren.modules.sys.entity.RdSiteEntity" id="rdSiteMap">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="nid" column="nid"/>
        <result property="level" column="level"/>
        <result property="pid" column="pid"/>
        <result property="leaf" column="leaf"/>
        <result property="status" column="status"/>
        <result property="type" column="type"/>
        <result property="url" column="url"/>
        <result property="sort" column="sort"/>
        <result property="description" column="description"/>
        <result property="addTime" column="add_time"/>
        <result property="addIp" column="add_ip"/>
        <result property="size" column="size"/>
        <result property="creator" column="creator"/>
        <result property="updateTime" column="update_time"/>
        <result property="editor" column="editor"/>
        <result property="delFlag" column="del_flag"/>

    </resultMap>


    <select id="queryList" resultType="io.renren.modules.sys.entity.RdSiteEntity">
        select t1.*,(select t2.name from rd_site t2 where t2.id=t1.pid)parentName from rd_site t1 where
        t1.del_flag = 0
        <if test="sql_filter != null">
            and ${sql_filter}
        </if>
    </select>

    <select id="querySiteIdList" resultType="Integer">
        select id from rd_site where pid = #{value} and del_flag = 0
    </select>
</mapper>