<resultMapid="VideoOrderResultMapLazy"type="VideoOrder"><idcolumn="id"property="id"/><resultcolumn="user_id"property="userId"/><resultcolumn="out_trade_no"property="outTradeNo"/><resultcolumn="create_time"property="createTime"/><resultcolumn="state"property="state"/><resultcolumn="total_fee"property="totalFee"/><resultcolumn="video_id"property="videoId"/><resultcolumn="video_title"property="videoTitle"/><resultcolumn="video_img"property="videoImg"/><!-- select: 指定延迟加载需要执??的statement id column: 和select查询关联的字段 --><associationproperty="user"javaType="User"column="user_id"select="findUserByUserId"/></resultMap><!--一对一管?查询订单, 订单内部包含?户属性 懒加载--><selectid="queryVideoOrderListLazy"resultMap="VideoOrderResultMapLazy">selecto.id id,o.user_id ,o.out_trade_no,o.create_time,o.state,o.total_fee,o.video_id,o.video_title,o.video_imgfrom video_order o</select><selectid="findUserByUserId"resultType="User">select * from user where id=#{id}
</select>