Merge pull request 'Fix app invisibility when retired' (#291) from osh.silva/device-mgt-core:apps-10154 into master

Reviewed-on: community/device-mgt-core#291
remotes/1712966534876109980/master
commit 63c0606fdf

@ -113,6 +113,11 @@ public class Filter {
*/ */
private String favouredBy; private String favouredBy;
/**
* Checking if retired apps needs to be excluded
*/
private boolean isNotRetired;
public int getLimit() { public int getLimit() {
return limit; return limit;
} }
@ -208,4 +213,12 @@ public class Filter {
public void setFavouredBy(String favouredBy) { public void setFavouredBy(String favouredBy) {
this.favouredBy = favouredBy; this.favouredBy = favouredBy;
} }
public boolean isNotRetired() {
return isNotRetired;
}
public void setNotRetired(boolean notRetired) {
isNotRetired = notRetired;
}
} }

@ -180,6 +180,9 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
if (deviceTypeId != -1) { if (deviceTypeId != -1) {
sql += "AND AP_APP.DEVICE_TYPE_ID = ? "; sql += "AND AP_APP.DEVICE_TYPE_ID = ? ";
} }
if (filter.isNotRetired()) {
sql += "AND AP_APP.STATUS != 'RETIRED' ";
}
sql += "GROUP BY AP_APP.ID ORDER BY AP_APP.ID "; sql += "GROUP BY AP_APP.ID ORDER BY AP_APP.ID ";
if (StringUtils.isNotEmpty(filter.getSortBy())) { if (StringUtils.isNotEmpty(filter.getSortBy())) {
sql += filter.getSortBy() +" "; sql += filter.getSortBy() +" ";
@ -308,6 +311,9 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
if (deviceTypeId != -1) { if (deviceTypeId != -1) {
sql += " AND AP_APP.DEVICE_TYPE_ID = ?"; sql += " AND AP_APP.DEVICE_TYPE_ID = ?";
} }
if (filter.isNotRetired()) {
sql += " AND AP_APP.STATUS != 'RETIRED'";
}
try { try {
conn = this.getDBConnection(); conn = this.getDBConnection();

Loading…
Cancel
Save