mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'application-mgt-new' into 'application-mgt-new'
Modify get applications query to support retrieving all applications See merge request entgra/carbon-device-mgt!210
This commit is contained in:
commit
4077bc95e3
@ -172,6 +172,10 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|||||||
sql += " AND AP_APP.DEVICE_TYPE_ID = ?";
|
sql += " AND AP_APP.DEVICE_TYPE_ID = ?";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filter.getLimit() == -1) {
|
||||||
|
sql = sql.replace("LIMIT ? OFFSET ?", "");
|
||||||
|
}
|
||||||
|
|
||||||
String sortingOrder = "ASC";
|
String sortingOrder = "ASC";
|
||||||
if (!StringUtils.isEmpty(filter.getSortBy() )) {
|
if (!StringUtils.isEmpty(filter.getSortBy() )) {
|
||||||
sortingOrder = filter.getSortBy();
|
sortingOrder = filter.getSortBy();
|
||||||
@ -182,12 +186,14 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|||||||
Connection conn = this.getDBConnection();
|
Connection conn = this.getDBConnection();
|
||||||
try (PreparedStatement stmt = conn.prepareStatement(sql);
|
try (PreparedStatement stmt = conn.prepareStatement(sql);
|
||||||
){
|
){
|
||||||
|
if (filter.getLimit() != -1) {
|
||||||
if (filter.getLimit() == 0) {
|
if (filter.getLimit() == 0) {
|
||||||
stmt.setInt(paramIndex++, 100);
|
stmt.setInt(paramIndex++, 100);
|
||||||
} else {
|
} else {
|
||||||
stmt.setInt(paramIndex++, filter.getLimit());
|
stmt.setInt(paramIndex++, filter.getLimit());
|
||||||
}
|
}
|
||||||
stmt.setInt(paramIndex++, filter.getOffset());
|
stmt.setInt(paramIndex++, filter.getOffset());
|
||||||
|
}
|
||||||
stmt.setInt(paramIndex++, tenantId);
|
stmt.setInt(paramIndex++, tenantId);
|
||||||
|
|
||||||
if (filter.getAppType() != null && !filter.getAppType().isEmpty()) {
|
if (filter.getAppType() != null && !filter.getAppType().isEmpty()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user