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>
调用返回
参考:https://www.cnblogs.com/mark5/p/15559640.html
标签:返回,ResultMap,嵌套,user,mybatis,select From: https://www.cnblogs.com/seekwind/p/17195691.html