三张表 一对多 分页查询
<resultMap id="queryListMap" type="com.mtqg.identify.identifyServer.domain.Order">
<result column="or_id" property="or_id"/>
<result column="create_time" property="create_time"/>
<result column="user_comment" property="user_comment"/>
<result column="ordertype" property="ordertype"/>
<result column="identifytype" property="identifytype"/>
<association property="user" javaType="com.mtqg.identify.identifyServer.domain.User">
<id column="u_id" property="u_id"/>
<result column="u_name" property="u_name"/>
<result column="u_head_img" property="u_head_img"/>
</association>
<collection property="images" javaType="java.util.List" ofType="com.mtqg.identify.expertServer.domain.Image">
<id column="imid" property="imid"/>
<result column="image_url" property="image_url"/>
</collection>
</resultMap>
<!--首页订单列表 -->
<select id="findOrderList" resultMap="queryListMap">
select o.or_id,o.create_time,o.user_comment,o.ordertype,o.identifytype,i.image_url,u.u_name,u.u_head_img
from (select a.or_id,a.user_id,a.create_time,a.user_comment,a.ordertype,a.identifytype from orders a order BY a.or_id DESC limit #{0},10) o
left join images i on (i.or_id=o.or_id)
left join users u on (u.u_id=o.user_id)
order by o.or_id desc
</select>