场景:查询的列表数据中含有的某个属性有多个值
eg:public void blockchian{
private String id;
private String name;
private List<node> nodeList;
}
xml:
<resultMap id="BlockchainListMap" type="xx/blockchain">
<result column='id' property='id' />
<result column='name property='name' />
<collection property='nodeList' resultMap='nodeListResultMap'/>
</resultMap>
<resultMap id="nodeListResultMap" type="xx/node">
<result column='id' property='id' />
<result column='name property='name' />
</resultMap>
<select id='getList' resultMap='BlockchainListMap'>
select a.id , a.name , n.id ,n.name
from blockchain a ,node n
where a.id = n.blockchain_id
</select>