分页 分页 分页

  <sql id="pageConditions">
    <where>
      <trim suffixOverrides="and">
        <if test="userId != null">user_id=#{userId} and</if>
        <if test="eventId != null">event_id=#{eventId} and</if>
        <if test="subsystem != null">subsystem=#{subsystem} and</if>
        <if test="operateType != null">operate_type=#{operateType} and</if>
        <if test="startTime != null">create_time&gt;=#{startTime} and</if>
        <if test="endTime != null">create_time&lt;=#{endTime} and</if>
       </trim>
    </where>
   
    <if test="orderField != null">order by ${orderField}</if>
    <if test="orderType == 1">desc</if>
    <if test="startNum >= 0 and pageSize > 0">limit ${startNum}, ${pageSize}</if>
  </sql>
 
  SELECT * from  t_resource t LIMIT 1,8 //分页

你可能感兴趣的:(分页)