对象下面嵌套的对象采用<association>写法,嵌套的集合采用<collection>写法
<collection>中使用ofType属性或者resultMap属性指向对象
参考https://blog.youkuaiyun.com/zhenwei1994/article/details/81569398
这3种都可以实现对象包含list;第1 、2种list分页数量是统计的list的总数,第3种才统计的是外层的数量
mybits对象包含list 分页问题
<resultMap type="com.dahuatech.servicearea.bean.CarTypeResultBean" id="carTypeMap">
<result column="INNER_CAR_TYPE" jdbcType="VARCHAR" property="innerCarType" />
<result column="INNER_CAR_TYPE_NAME" jdbcType="VARCHAR" property="innerCarTypeName" />
<collection property="carTypeList" ofType="com.dahuatech.servicearea.bean.ItemBean" select="getBatchList" column="INNER_CAR_TYPE">
</collection>
</resultMap>
<select id="getBatchList" resultType="com.dahuatech.servicearea.bean.ItemBean">
SELECT b.ITEM_CODE itemCode,
c.ITEM_NAME itemName from sa_car_type_mapping b
LEFT JOIN sa_sys_dic c ON c.TYPE_CODE = b.TYPE_CODE
AND c.ITEM_CODE = b.ITEM_CODE
where b.INNER_CAR_TYPE = #{innerCarType}
</select>
<sql id="Base_Column_List">
a.INNER_CAR_TYPE ,
a.INNER_CAR_TYPE_NAME
</sql>
<select id="queryCarTypeList" resultMap="carTypeMap">
SELECT
<include refid="Base_Column_List"/>
FROM
sa_inner_car_type a
</select>