Explorar el Código

列翻页时,不传total

master
郑根木 hace 2 años
padre
commit
8b0c263e45
Se han modificado 2 ficheros con 13 adiciones y 2 borrados
  1. +5
    -2
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/mvc/service/AbstractListHandler.java
  2. +8
    -0
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/mvc/service/SwListData.java

+ 5
- 2
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/mvc/service/AbstractListHandler.java Ver fichero

@@ -58,7 +58,6 @@ public abstract class AbstractListHandler extends AbstractHandler {
List<SwMap> listData;
SqlPara sqlPara = buildDataSql();


String sort = params.readString("sort");
String order = params.readString("order");
String sql;
@@ -73,7 +72,11 @@ public abstract class AbstractListHandler extends AbstractHandler {
listData = queryData(sql, sqlPara);

afterQuery(listData);
return SwListData.create(listData, sqlPara.rows);
if (sqlPara.page <= 1) {
return SwListData.create(listData, sqlPara.rows);
} else {
return SwListData.create(listData);
}
}

protected List<SwMap> queryData(String sql, SqlPara sqlPara) {


+ 8
- 0
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/mvc/service/SwListData.java Ver fichero

@@ -30,6 +30,14 @@ public class SwListData {
}
}

public static SwListData create(List list) {
if (list == null) {
return SwListData.EMPTY;
}

return new SwListData(list, -1);
}

public boolean isEmpty() {
return this.rows == null || this.rows.isEmpty();
}


Cargando…
Cancelar
Guardar