分页 分页 分页

  <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 //分页

猜你喜欢

转载自yuhuiblog6338999322098842.iteye.com/blog/2215824