paging paging paging

  <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>=#{startTime} and</if>
        <if test="endTime != null">create_time<=#{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 //分页

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326422893&siteId=291194637