<mapper namespace="org.lfz.dao.INewLabelDao">
<!-- <select id="" resultMap="">
select id,name,pid from tb_newslabel where id=#{xxx}
</select> -->
<resultMap type="NewsLabel" id="newsLabelMapper" >
<id column="id" property="id"/>
<result column="name" property="name"/>
<association
property="parent"
javaType="NewsLabel"
select="selectNewsLabelById"
column="pid"/>
</resultMap>
<select id="selectNewsLabelById" resultMap="newsLabelMapper">
select id,name,pid
from tb_newslabel
where id=#{xxx}
</select>
</mapper>
<!-- <select id="" resultMap="">
select id,name,pid from tb_newslabel where id=#{xxx}
</select> -->
<resultMap type="NewsLabel" id="newsLabelMapper" >
<id column="id" property="id"/>
<result column="name" property="name"/>
<association
property="parent"
javaType="NewsLabel"
select="selectNewsLabelById"
column="pid"/>
</resultMap>
<select id="selectNewsLabelById" resultMap="newsLabelMapper">
select id,name,pid
from tb_newslabel
where id=#{xxx}
</select>
</mapper>