* for #4311,Fixed Derby data source related SQL LIMIT exception. * fix code style. * code format.
This commit is contained in:
parent
7f2a3307d6
commit
3bf8844992
@ -1116,16 +1116,26 @@ public class EmbeddedStoragePersistServiceImpl implements PersistService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getTenantIdList(int page, int pageSize) {
|
public List<String> getTenantIdList(int page, int pageSize) {
|
||||||
|
PaginationHelper<String> helper = createPaginationHelper();
|
||||||
|
|
||||||
String sql = "SELECT tenant_id FROM config_info WHERE tenant_id != '' GROUP BY tenant_id LIMIT ?,?";
|
String sql = "SELECT tenant_id FROM config_info WHERE tenant_id != '' GROUP BY tenant_id LIMIT ?,?";
|
||||||
int from = (page - 1) * pageSize;
|
int from = (page - 1) * pageSize;
|
||||||
return databaseOperate.queryMany(sql, new Object[] {from, pageSize}, String.class);
|
|
||||||
|
Page<String> pageList = helper.fetchPageLimit(sql, new Object[] {from, pageSize}, page, pageSize,
|
||||||
|
(resultSet, i) -> resultSet.getString("tenant_id"));
|
||||||
|
return pageList.getPageItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getGroupIdList(int page, int pageSize) {
|
public List<String> getGroupIdList(int page, int pageSize) {
|
||||||
|
PaginationHelper<String> helper = createPaginationHelper();
|
||||||
|
|
||||||
String sql = "SELECT group_id FROM config_info WHERE tenant_id ='' GROUP BY group_id LIMIT ?,?";
|
String sql = "SELECT group_id FROM config_info WHERE tenant_id ='' GROUP BY group_id LIMIT ?,?";
|
||||||
int from = (page - 1) * pageSize;
|
int from = (page - 1) * pageSize;
|
||||||
return databaseOperate.queryMany(sql, new Object[] {from, pageSize}, String.class);
|
|
||||||
|
Page<String> pageList = helper.fetchPageLimit(sql, new Object[] {from, pageSize}, page, pageSize,
|
||||||
|
(resultSet, i) -> resultSet.getString("group_id"));
|
||||||
|
return pageList.getPageItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user