Integer pageNum = partsConInfo.getPageNum();
Integer pageSize = partsConInfo.getPageSize();
Integer fromIndex = pageNum * pageSize - pageSize;
Integer toIndex = fromIndex + pageSize;
partsConInfo.setFromIndex(fromIndex); //第几页开始
partsConInfo.setToIndex(toIndex); //第几页结束
select * from (
select tmp.*,rownum rowsid from (
select trim(t$orno) orno,trim(T$BPID) bpid ,trim(T$RKDT) rkdt ,trim(T$SCDH) scdh ,trim(T$ITEM) item ,trim(T$CORN) corn,trim(T$CKDT) ckdt from Ttdsct461400
<where>
<if test="condition.bpidFrom != null and condition.bpidFrom != '' and condition.bpidTo != null and condition.bpidTo != '' ">
and t$bpid >= #{condition.bpidFrom} and t$bpid <= #{condition.bpidTo}
</if>
<if test="condition.rkdtFrom != null and condition.rkdtFrom != '' and condition.rkdtTo != null and condition.rkdtTo != '' ">
and t$rkdt >= #{condition.rkdtFrom} and t$rkdt <= #{condition.rkdtTo}
</if>
<if test="condition.itemFrom != null and condition.itemFrom != '' and condition.itemTo != null and condition.itemTo != '' ">
and t$item >= #{condition.itemFrom} and t$item <= #{condition.itemTo}
</if>
<if test="condition.scdhFrom != null and condition.scdhFrom != '' and condition.scdhTo != null and condition.scdhTo != '' ">
and t$scdh >= #{condition.scdhFrom} and t$scdh <= #{condition.scdhTo}
</if>
</where>
) tmp where rownum <= #{condition.toIndex})
where rowsid > #{condition.fromIndex}