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