<resultMap id='BaseMap' type='com.luoyu.entity.Student'>
<id column='id' jdbcType="Integer" property="productId">
<result column='name' jdbcType="VARCHAR" property="name">
</resultMap>
<resultMap id="withClassMap" extends="BaseMap" type="com.luoyu.entity.Class">
<collection column="id" property="classVOList“ select="com.luoyu.mapper.ClassMapper.selectClassById">
</collection>
<resultMap>
然后在实际使用这个resultMap的地方这么写
<select id="selectPage" parameterType="com.luoyu.entity.request.StudentDto" resultMap="withClassMap">
select id ,name from student
</select>