mybatis种的ResultMap嵌套
mybatis中的返回类嵌套一个list,如何实现?
<resultMap id="CusMap" type="com.yang.webstarter.entity.SysUser">
<collection property="books" javaType="java.util.ArrayList" ofType="com.yang.webstarter.entity.UserBook"
select="selectUserBook"
column="{userId=id}"/>
</resultMap>
<select id="selectCusList" resultMap="CusMap">
select *
from sys_user
</select>
<select id="selectUserBook" resultType="com.yang.webstarter.entity.UserBook">
select *
from user_book
where user_id = #{userId}
</select>
调用返回