|
|
|
@ -138,16 +138,16 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
|
+ "INNER JOIN AP_APP_RELEASE ON "
|
|
|
|
|
+ "AP_APP.ID = AP_APP_RELEASE.AP_APP_ID "
|
|
|
|
|
+ "INNER JOIN (SELECT AP_APP.ID FROM AP_APP ";
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getVersion()) || !StringUtils.isEmpty(filter.getAppReleaseState())
|
|
|
|
|
|| !StringUtils.isEmpty(filter.getAppReleaseType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getVersion()) || StringUtils.isNotEmpty(filter.getAppReleaseState())
|
|
|
|
|
|| StringUtils.isNotEmpty(filter.getAppReleaseType())) {
|
|
|
|
|
sql += "INNER JOIN AP_APP_RELEASE ON AP_APP.ID = AP_APP_RELEASE.AP_APP_ID ";
|
|
|
|
|
}
|
|
|
|
|
sql += "WHERE AP_APP.TENANT_ID = ? ";
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppType())) {
|
|
|
|
|
sql += "AND AP_APP.TYPE = ? ";
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppName())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppName())) {
|
|
|
|
|
sql += "AND LOWER (AP_APP.NAME) ";
|
|
|
|
|
if (filter.isFullMatch()) {
|
|
|
|
|
sql += "= ? ";
|
|
|
|
@ -155,26 +155,26 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
|
sql += "LIKE ? ";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getSubscriptionType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getSubscriptionType())) {
|
|
|
|
|
sql += "AND AP_APP.SUB_TYPE = ? ";
|
|
|
|
|
}
|
|
|
|
|
if (filter.getMinimumRating() > 0) {
|
|
|
|
|
sql += "AND AP_APP.RATING >= ? ";
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getVersion())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getVersion())) {
|
|
|
|
|
sql += "AND AP_APP_RELEASE.VERSION = ? ";
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppReleaseType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppReleaseType())) {
|
|
|
|
|
sql += "AND AP_APP_RELEASE.RELEASE_TYPE = ? ";
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppReleaseState())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppReleaseState())) {
|
|
|
|
|
sql += "AND AP_APP_RELEASE.CURRENT_STATE = ? ";
|
|
|
|
|
}
|
|
|
|
|
if (deviceTypeId != -1) {
|
|
|
|
|
sql += "AND AP_APP.DEVICE_TYPE_ID = ? ";
|
|
|
|
|
}
|
|
|
|
|
sql += "GROUP BY AP_APP.ID ";
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getSortBy())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getSortBy())) {
|
|
|
|
|
sql += "ORDER BY ID " + filter.getSortBy() +" ";
|
|
|
|
|
}
|
|
|
|
|
if (filter.getLimit() != -1) {
|
|
|
|
@ -186,29 +186,29 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
|
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
|
int paramIndex = 1;
|
|
|
|
|
stmt.setInt(paramIndex++, tenantId);
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppType())) {
|
|
|
|
|
stmt.setString(paramIndex++, filter.getAppType());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppName())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppName())) {
|
|
|
|
|
if (filter.isFullMatch()) {
|
|
|
|
|
stmt.setString(paramIndex++, filter.getAppName().toLowerCase());
|
|
|
|
|
} else {
|
|
|
|
|
stmt.setString(paramIndex++, "%" + filter.getAppName().toLowerCase() + "%");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getSubscriptionType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getSubscriptionType())) {
|
|
|
|
|
stmt.setString(paramIndex++, filter.getSubscriptionType());
|
|
|
|
|
}
|
|
|
|
|
if (filter.getMinimumRating() > 0) {
|
|
|
|
|
stmt.setInt(paramIndex++, filter.getMinimumRating());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getVersion())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getVersion())) {
|
|
|
|
|
stmt.setString(paramIndex++, filter.getVersion());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppReleaseType())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppReleaseType())) {
|
|
|
|
|
stmt.setString(paramIndex++, filter.getAppReleaseType());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(filter.getAppReleaseState())) {
|
|
|
|
|
if (StringUtils.isNotEmpty(filter.getAppReleaseState())) {
|
|
|
|
|
stmt.setString(paramIndex++, filter.getAppReleaseState());
|
|
|
|
|
}
|
|
|
|
|
if (deviceTypeId > 0) {
|
|
|
|
|