|
|
@ -117,15 +117,14 @@ public class SQLServerApplicationDAOImpl extends GenericApplicationDAOImpl {
|
|
|
|
if (deviceTypeId != -1) {
|
|
|
|
if (deviceTypeId != -1) {
|
|
|
|
sql += "AND AP_APP.DEVICE_TYPE_ID = ? ";
|
|
|
|
sql += "AND AP_APP.DEVICE_TYPE_ID = ? ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sql += "GROUP 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 += "ORDER BY ID " + filter.getSortBy() + " ";
|
|
|
|
sql += filter.getSortBy() +" ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (filter.getLimit() != -1) {
|
|
|
|
if (filter.getLimit() != -1) {
|
|
|
|
sql += "ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
|
|
|
sql += "ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sql += ") AS app_data ON app_data.ID = AP_APP.ID " +
|
|
|
|
sql += ") AS app_data ON app_data.ID = AP_APP.ID WHERE AP_APP.TENANT_ID = ? ORDER BY AP_APP.ID";
|
|
|
|
"WHERE AP_APP.TENANT_ID = ?";
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = this.getDBConnection();
|
|
|
|
Connection conn = this.getDBConnection();
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|