<resultMap type="XX" >         

    <id property="id" column="colid"/>  

        <id property="name" column="colname"/>  

       <collection property="list" javaType="ArrayList" column="{id = colid,name=colname}" select="getSubXXX"/>  

</resultMap> 

前为别名后为主查询getXXX语句中字段

<select >          SELECT colid,colname FROM table1

 </select> 

 <select > #{id} AND name = #{name}   </select> 

相关文章: