|
|
@@ -1,11 +1,19 @@
|
|
|
package com.usoftchina.saas.document.service.impl;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
|
|
|
+import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
|
+import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
import com.usoftchina.saas.document.entities.Bankinformation;
|
|
|
import com.usoftchina.saas.document.mapper.BankinformationMapper;
|
|
|
import com.usoftchina.saas.document.service.BankinformationService;
|
|
|
+import com.usoftchina.saas.page.PageRequest;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author heqw
|
|
|
@@ -31,4 +39,33 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
|
|
|
bankinformationMapper.deleteByPrimaryKey(id);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition) {
|
|
|
+ //设置默认分页
|
|
|
+ if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
|
|
|
+ page = new PageRequest();
|
|
|
+ page.setNumber(1);
|
|
|
+ page.setSize(10);
|
|
|
+ }
|
|
|
+ PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
+ List<Bankinformation> recbalancesList = this.getListByMode(condition);
|
|
|
+ //取分页信息
|
|
|
+ PageInfo<Bankinformation> pageInfo = new PageInfo<Bankinformation>(recbalancesList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<Bankinformation> getListByMode(ListReqDTO req) {
|
|
|
+ List<Bankinformation> recbalancesList = null;
|
|
|
+ Long companyId = BaseContextHolder.getCompanyId();
|
|
|
+ if (StringUtils.isEmpty(req)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String con = req.getFinalCondition();
|
|
|
+ if (null == con) {
|
|
|
+ con = "1=1";
|
|
|
+ }
|
|
|
+ recbalancesList = bankinformationMapper.selectBankinformationBycondition(con, companyId);
|
|
|
+ return recbalancesList;
|
|
|
+ }
|
|
|
}
|