Change subscriptionType format

appm_improvement
Lasantha Dharmakeerthi 5 months ago
commit ddbf312c6a

@ -2646,23 +2646,23 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
List<CategorizedSubscriptionCountsDTO> subscriptionCounts = new ArrayList<>(); List<CategorizedSubscriptionCountsDTO> subscriptionCounts = new ArrayList<>();
subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( subscriptionCounts.add(new CategorizedSubscriptionCountsDTO(
"ALL", "All",
subscriptionDAO.getAllSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getAllSubscriptionCount(appReleaseId, tenantId),
subscriptionDAO.getAllUnsubscriptionCount(appReleaseId, tenantId))); subscriptionDAO.getAllUnsubscriptionCount(appReleaseId, tenantId)));
subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( subscriptionCounts.add(new CategorizedSubscriptionCountsDTO(
"DEVICE", "Device",
subscriptionDAO.getDeviceSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getDeviceSubscriptionCount(appReleaseId, tenantId),
subscriptionDAO.getDeviceUnsubscriptionCount(appReleaseId, tenantId))); subscriptionDAO.getDeviceUnsubscriptionCount(appReleaseId, tenantId)));
subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( subscriptionCounts.add(new CategorizedSubscriptionCountsDTO(
"GROUP", "Group",
subscriptionDAO.getGroupSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getGroupSubscriptionCount(appReleaseId, tenantId),
subscriptionDAO.getGroupUnsubscriptionCount(appReleaseId, tenantId))); subscriptionDAO.getGroupUnsubscriptionCount(appReleaseId, tenantId)));
subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( subscriptionCounts.add(new CategorizedSubscriptionCountsDTO(
"ROLE", "Role",
subscriptionDAO.getRoleSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getRoleSubscriptionCount(appReleaseId, tenantId),
subscriptionDAO.getRoleUnsubscriptionCount(appReleaseId, tenantId))); subscriptionDAO.getRoleUnsubscriptionCount(appReleaseId, tenantId)));
subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( subscriptionCounts.add(new CategorizedSubscriptionCountsDTO(
"USER", "User",
subscriptionDAO.getUserSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getUserSubscriptionCount(appReleaseId, tenantId),
subscriptionDAO.getUserUnsubscriptionCount(appReleaseId, tenantId))); subscriptionDAO.getUserUnsubscriptionCount(appReleaseId, tenantId)));

@ -646,8 +646,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
@Override @Override
public List<Device> searchDevicesInGroup(PaginationRequest request, int tenantId) public List<Device> searchDevicesInGroup(PaginationRequest request, int tenantId) throws DeviceManagementDAOException {
throws DeviceManagementDAOException {
List<Device> devices = null; List<Device> devices = null;
int groupId = request.getGroupId(); int groupId = request.getGroupId();
String deviceType = request.getDeviceType(); String deviceType = request.getDeviceType();
@ -687,6 +686,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
"gd.DESCRIPTION, " + "gd.DESCRIPTION, " +
"gd.NAME, " + "gd.NAME, " +
"gd.DEVICE_IDENTIFICATION, " + "gd.DEVICE_IDENTIFICATION, " +
"gd.LAST_UPDATED_TIMESTAMP " +
"FROM " + "FROM " +
"(SELECT d.ID AS DEVICE_ID, " + "(SELECT d.ID AS DEVICE_ID, " +
"d.DESCRIPTION, " + "d.DESCRIPTION, " +
@ -708,10 +708,10 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
sql = sql + " WHERE 1 = 1"; sql = sql + " WHERE 1 = 1";
//Add query for last updated timestamp //Add query for last updated timestamp
if (since != null) { if (since != null) {
sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?"; sql = sql + " AND gd.LAST_UPDATED_TIMESTAMP > ?";
isSinceProvided = true; isSinceProvided = true;
} }
sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? "; sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND e.TENANT_ID = ? ";
//Add the query for device-type //Add the query for device-type
if (deviceType != null && !deviceType.isEmpty()) { if (deviceType != null && !deviceType.isEmpty()) {
sql = sql + " AND e.DEVICE_TYPE = ?"; sql = sql + " AND e.DEVICE_TYPE = ?";

Loading…
Cancel
Save