Ver a proveniência

列翻页时,不传total

master
郑根木 há 2 anos
ascendente
cometimento
8b0c263e45
2 ficheiros alterados com 13 adições e 2 eliminações
  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 ficheiro

@@ -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 ficheiro

@@ -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();
}


Carregando…
Cancelar
Guardar