| | |
| | | tableName = VciBaseUtil.getTableName(btmTypeId); |
| | | } |
| | | |
| | | String countSql = "select count(*) from (select * FROM " + tableName +" where 1=1" + |
| | | String countSql = "select count(*) from " + tableName +" where 1=1" + |
| | | " and lastr = '1'" + |
| | | " and lastv='1'" + |
| | | " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%' {}"; |
| | | " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%'"; |
| | | |
| | | //先查询总数 |
| | | int total = 0; |
| | |
| | | &&exportAttrDTO.getPage() !=null && exportAttrDTO.getPage() >0 |
| | | &&exportAttrDTO.getEndPage()>exportAttrDTO.getPage()){ |
| | | //从多少页到多少页的查询方式, |
| | | String countPageSql = "select count(*) from (select * FROM " + tableName +" where 1=1" + |
| | | " and lastr = '1'" + |
| | | " and lastv='1'" + |
| | | " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%' {}"; |
| | | for(int i = exportAttrDTO.getPage() ;i <= exportAttrDTO.getEndPage();i++){ |
| | | PageHelper thisPage = new PageHelper(exportAttrDTO.getLimit()==null?-1:exportAttrDTO.getLimit()); |
| | | thisPage.setPage(exportAttrDTO.getPage()==null?1:exportAttrDTO.getPage()); |
| | | thisPage.setSort(exportAttrDTO.getSort()); |
| | | thisPage.setOrder(exportAttrDTO.getOrder()); |
| | | thisPage.addDefaultDesc("createTime"); |
| | | total += commonsMapper.queryCountBySql(StringUtil.format(countSql," limit " + exportAttrDTO.getLimit() +" offset "+ i +")subquery;")); |
| | | total += commonsMapper.queryCountBySql(StringUtil.format(countPageSql," limit " + exportAttrDTO.getLimit() +" offset "+ i +")subquery;")); |
| | | } |
| | | }else{ |
| | | total = commonsMapper.queryCountBySql(countSql); |