collection
<resultMap id="base_result" type="com.ithings.auth.entity.UserDto">
<result property="id" column="ID"/>
<result property="name" column="NAME"/>
<collection property="accountList" ofType="com.ithings.auth.entity.Account">
<id property="id" column="a_ID"/>
<result property="balance" column="BALANCE"/>
</collection>
</resultMap>
<select id="getUserDtoList" resultMap="base_result">
SELECT u.ID, u.NAME, a.ID a_ID, a.BALANCE from USERINFO u, ACCOUNT a WHERE u.id = a.user_id
</select>
<!-- dto结果集 -->
<resultMap id="result_dto" type="com.ithings.hdmng.dto.GoodsDto" extends="result_base">
<result property="ctgName" column="CTG_NAME"/>
<result property="stateName" column="STATE_NAME"/>
<collection property="glRalList" javaType="ArrayList"
column="{goodsId=ID}"
ofType="com.ithings.hdmng.entity.GoodsLabelRel" select="findGoodsLabelRelByGoodsId" />
</resultMap>
<select id="findGoodsLabelRelByGoodsId" parameterType="java.util.HashMap" resultMap="result_goods_label">
SELECT obj.GOODS_ID, obj.LABEL_ID
FROM hdm_goods_label_rel obj
WHERE obj.GOODS_ID = #{goodsId}
ORDER BY obj.LABEL_ID ASC
</select>