<resultMap id="ExtResultMap" type="com.demo.partner.po.PartnerPO">
<id column="Id" property="id" jdbcType="INTEGER" />
<result column="Name" property="name" jdbcType="VARCHAR" />
<association property="partnerUser"
javaType="com.demo.partner.domain.PartnerUser">
<result property="trueName" column="trueName" />
<result property="partnerId" column="partnerId" />
<result property="email" column="email" />
<result property="mobileNo" column="mobileNo" />
<result property="gender" column="gender" />
</association>
<collection property="distributorList"
ofType="com.demo.partner.domain.Distributor">
<result property="trueName" column="dtrueName" />
<result property="partnerId" column="dpartnerId" />
<result property="email" column="demail" />
<result property="mobileNo" column="dmobileNo" />
<result property="gender" column="dgender" />
</collection>
</resultMap>
association 为一对一聚合,collection 为一对多.
property为com.demo.partner.po.PartnerPO中的字段
column为数据库字段名字