Skip to content

Commit

Permalink
调整api的名称
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexiangjys committed Sep 3, 2020
1 parent 5cb7e89 commit 605cd11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ DBService<Student> mDBService = InternalDataBaseRepository.getInstance().getData
* queryForColumnFirst: 根据条件查询,返回第一个符合条件的对象。
* indistinctQueryForColumn: 根据条件模糊查询,返回一个对象集合。
* queryDataBySql: 根据sql语句查询,返回对象的集合。
* pageQuery: 根据某个字段进行分页查询
* queryPage: 根据某个字段排序进行分页查询

#### 更新

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void run() {

private List<Student> pageQuery(int pageIndex) {
try {
return mDBService.pageQuery("Id", true, pageIndex, 50);
return mDBService.queryPage(pageIndex, 50, "Id", true);
} catch (SQLException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ public List<T> queryAndOrderBy(String fieldName, Object value, String columnName
/**
* 根据某个字段进行分页查询
*
* @param pageIndex 页面的索引
* @param pageSize 一页的数据大小
* @param columnName 排序的列名
* @param ascending true:升序,false:降序
* @param pageIndex 页面的索引
* @param pageSize 一页的数据大小
* @return
* @throws SQLException
*/
public List<T> pageQuery(String columnName, boolean ascending, long pageIndex, long pageSize) throws SQLException {
public List<T> queryPage(long pageIndex, long pageSize, String columnName, boolean ascending) throws SQLException {
QueryBuilder<T, Integer> query = mDao.queryBuilder();
query.limit(pageSize);
query.offset(pageIndex * pageSize);
Expand Down

0 comments on commit 605cd11

Please sign in to comment.