手写分页

release
yishiqihuasheng 2 years ago
parent 6ba3469c63
commit c2216bf8e5
  1. 23
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  2. 6
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml

@ -486,17 +486,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
}
String isChooseAll = (String) pramsMap.get("isChooseAll");
//如果不是勾选所有进行统计和分页
if ("N".equalsIgnoreCase(isChooseAll)){
int curr = (int) pramsMap.get("curr");
int size = (int) pramsMap.get("size");
// 合计信息,仅第一页时需要统计,减少数据库压力
if (curr == 1) {
String hjsl = "0";
String hjje = "0";
String hjse = "0";
@ -515,10 +507,21 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
json.put("code", "501");
return super.responseResult(json);
}
}
PageHelper.startPage(curr, size);
int total = Integer.parseInt(hjsl);
int totalPage = total % size == 0?total/size:total/size+1;
if (curr<1){
curr =1;
}
if (curr>totalPage){
curr = totalPage;
}
curr = (curr -1)*size;
pramsMap.put("curr",curr);
List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectInTellingCheck(pramsMap);

@ -1410,7 +1410,11 @@
and qs_status = '1'
</if>
/*keep orderby*/ ORDER BY tax_amount
ORDER BY tax_amount
<if test="isChooseAll != null and isChooseAll != '' and isChooseAll == 'Y'">
limit #{curr},#{size}
</if>
) AS subquery
WHERE <![CDATA[ max_tax <= #{maxTax} ]]>

Loading…
Cancel
Save