xiejun
2023-12-06 08a7b7b2bdc4c61267642da6fdd34d0c46a43546
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -1831,10 +1831,10 @@
         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;
@@ -1842,13 +1842,17 @@
         &&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);