如何实现分页,请给出语句 <select id="selectLikeDxx" parameterType="com.hrdz.model.bo.Dxx" resultMap="BaseResultMap">
select
mesid, sender, sendphone,
sendtime, sendcontext, sendtype,
receiver, recephone, recetime,
receunit, recedept, contexttype,
sendstatus, recestatus, ifcase,
casetype, ifsee, ifworked,
resulted, workpeople, worktime,
systime1, systime2, dxx1,
dxx2, dxx3, picture
from
Dxx
where
1=1
<if test="sender !=''">
and receiver like '%${sender}%'
</if>
<if test="sendphone !=''">
and sendphone like '%${sendphone}%'
</if>
<if test="ifcase!=''">
and ifcase = #{ifcase}
</if>
<if test="receiver!=''">
and receiver like '%${receiver}%'
</if>
<if test="recephone!=''">
and recephone like '%${recephone}%'
</if>
<if test="sendtime !='' " >
<if test="dxx3!=''">
and sendtime between #{sendtime} and #{dxx3}
</if>
<if test="dxx3==''">
and sendtime >= #{sendtime}
</if>
</if>
<if test="sendtime ==''">
<if test="dxx3!=''">
and sendtime <= #{dxx3}
</if>
</if>
order by sendtime desc
</select>分页MyBatis
select
mesid, sender, sendphone,
sendtime, sendcontext, sendtype,
receiver, recephone, recetime,
receunit, recedept, contexttype,
sendstatus, recestatus, ifcase,
casetype, ifsee, ifworked,
resulted, workpeople, worktime,
systime1, systime2, dxx1,
dxx2, dxx3, picture
from
Dxx
where
1=1
<if test="sender !=''">
and receiver like '%${sender}%'
</if>
<if test="sendphone !=''">
and sendphone like '%${sendphone}%'
</if>
<if test="ifcase!=''">
and ifcase = #{ifcase}
</if>
<if test="receiver!=''">
and receiver like '%${receiver}%'
</if>
<if test="recephone!=''">
and recephone like '%${recephone}%'
</if>
<if test="sendtime !='' " >
<if test="dxx3!=''">
and sendtime between #{sendtime} and #{dxx3}
</if>
<if test="dxx3==''">
and sendtime >= #{sendtime}
</if>
</if>
<if test="sendtime ==''">
<if test="dxx3!=''">
and sendtime <= #{dxx3}
</if>
</if>
order by sendtime desc
</select>分页MyBatis
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货