<resultMap id="type" type="com.jiuqi.entity.Type">
<id property="id" column="tid"/>
<result property="name" column="name"/>
<collection property="blogs" ofType="com.jiuqi.entity.Blog">
<id property="id" column="bid"/>
<result property="title" column="title"/>
<result property="typeId" column="type_id"/>
</collection>
</resultMap>
<!--分类页面查询-->
<select id="getAllTypeAndBlog" resultMap="type">
select t.id tid, t.name, b.id bid, b.title,b.type_id from t_type t,t_blog b where t.id = b.type_id
</select>