use of com.baidu.ub.common.db.DaoPage in project disconf by knightliao.
the class DaoUtils method daoPageAdapter.
/**
* 将业务的Page转成Dao的Page
*
* @param page
*
* @return
*/
public static DaoPage daoPageAdapter(Page page) {
DaoPage daoPage = new DaoPage();
daoPage.setPageNo(page.getPageNo());
daoPage.setPageSize(page.getPageSize());
List<Order> orderList = new ArrayList<Order>();
if (!StringUtils.isEmpty(page.getOrderBy())) {
Order order = new Order(page.getOrderBy(), page.isAsc());
orderList.add(order);
}
daoPage.setOrderList(orderList);
return daoPage;
}
use of com.baidu.ub.common.db.DaoPage in project disconf by knightliao.
the class ConfigDaoImpl method getConfigList.
/**
*
*/
@Override
public DaoPageResult<Config> getConfigList(Long appId, Long envId, String version, Page page) {
DaoPage daoPage = DaoUtils.daoPageAdapter(page);
List<Match> matchs = new ArrayList<Match>();
matchs.add(new Match(Columns.APP_ID, appId));
matchs.add(new Match(Columns.ENV_ID, envId));
matchs.add(new Match(Columns.VERSION, version));
matchs.add(new Match(Columns.STATUS, Constants.STATUS_NORMAL));
return page2(matchs, daoPage);
}