Commit eeef8185 authored by yanzg's avatar yanzg

表结构修改

parent ca6b468c
...@@ -303,8 +303,7 @@ public abstract class BaseDaoSql { ...@@ -303,8 +303,7 @@ public abstract class BaseDaoSql {
List<Object> paras = new ArrayList<>(); List<Object> paras = new ArrayList<>();
String sql = this.getPara(paras, sqlData, model, false); String sql = this.getPara(paras, sqlData, model, false);
Object cell = this.queryCellWithCache(sqlData.getName(), sql, paras.toArray()); return this.queryCellWithCache(sqlData.getName(), sql, paras.toArray());
return cell;
} }
...@@ -418,8 +417,7 @@ public abstract class BaseDaoSql { ...@@ -418,8 +417,7 @@ public abstract class BaseDaoSql {
pageSize.setPageIndex(1); pageSize.setPageIndex(1);
pageSize.setPageSize(1); pageSize.setPageSize(1);
List<T> list = this.queryPageData(cls, pageSize, sqlName, model, queryPara); List<T> list = this.queryPageData(cls, pageSize, sqlName, model, queryPara);
T retVal = list.size() > 0 ? list.get(0) : null; return list.size() > 0 ? list.get(0) : null;
return retVal;
} }
/** /**
...@@ -460,6 +458,27 @@ public abstract class BaseDaoSql { ...@@ -460,6 +458,27 @@ public abstract class BaseDaoSql {
* @return 查询的结果 * @return 查询的结果
*/ */
public <T extends Object> List<T> queryPageData(Class<T> cls, PageSizeReq pageSize, String sqlName, Object model, QueryPara queryPara) { public <T extends Object> List<T> queryPageData(Class<T> cls, PageSizeReq pageSize, String sqlName, Object model, QueryPara queryPara) {
SqlData to = getSqlData(pageSize, sqlName, queryPara);
return queryData(cls, to, model);
}
/**
* 查询分页数据,仅仅只是查询分页中的数据,不查询分页信息。如:包含的总数据数量
*
* @param cls 数据结果类型
* @param pageSize 分页参数
* @param sqlName SQL语句名称
* @param model 前台参数
* @param rowHandle 处理信息
* @param <T> 返回数据类型
* @return 查询的结果
*/
public <T extends Object> void queryPageData(Class<T> cls, PageSizeReq pageSize, String sqlName, Object model, DbRow<T> rowHandle, QueryPara queryPara) {
SqlData to = getSqlData(pageSize, sqlName, queryPara);
queryData(cls, rowHandle, to, model);
}
private SqlData getSqlData(PageSizeReq pageSize, String sqlName, QueryPara queryPara) {
SqlData from = this.getSql(sqlName); SqlData from = this.getSql(sqlName);
// 对SQL语句进行分页处理 // 对SQL语句进行分页处理
SqlData to = from.copy(); SqlData to = from.copy();
...@@ -468,7 +487,7 @@ public abstract class BaseDaoSql { ...@@ -468,7 +487,7 @@ public abstract class BaseDaoSql {
to.setSql(from.getSql()); to.setSql(from.getSql());
to.addCode("{LIMIT}", " LIMIT " + pageSize.getPageStart() + "," + pageSize.getPageSize()); to.addCode("{LIMIT}", " LIMIT " + pageSize.getPageStart() + "," + pageSize.getPageSize());
return queryData(cls, to, model); return to;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment