Fix role pagination issue

pull/469/head^2
Lasantha Dharmakeerthi 4 months ago
commit 3d0fdd9f3f

@ -118,7 +118,7 @@ public class RoleBasedSubscriptionManagementHelperServiceImpl implements Subscri
} else { } else {
deviceSubscriptionDTOS = subscriptionDAO.getSubscriptionDetailsByDeviceIds(applicationReleaseDTO.getId(), deviceSubscriptionDTOS = subscriptionDAO.getSubscriptionDetailsByDeviceIds(applicationReleaseDTO.getId(),
isUnsubscribe, tenantId, deviceIdsOwnByRole, dbSubscriptionStatus, isUnsubscribe, tenantId, deviceIdsOwnByRole, dbSubscriptionStatus,
subscriptionInfo.getSubscriptionType(), deviceSubscriptionFilterCriteria.getTriggeredBy(), limit, offset); subscriptionInfo.getSubscriptionType(), deviceSubscriptionFilterCriteria.getTriggeredBy(), -1, -1);
deviceCount = SubscriptionManagementHelperUtil.getTotalDeviceSubscriptionCount(deviceSubscriptionDTOS, deviceCount = SubscriptionManagementHelperUtil.getTotalDeviceSubscriptionCount(deviceSubscriptionDTOS,
subscriptionInfo.getDeviceSubscriptionFilterCriteria(), applicationDTO.getDeviceTypeId()); subscriptionInfo.getDeviceSubscriptionFilterCriteria(), applicationDTO.getDeviceTypeId());

@ -3505,7 +3505,8 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
boolean isDeviceNameProvided = false; boolean isDeviceNameProvided = false;
try { try {
Connection connection = getConnection(); Connection connection = getConnection();
String sql = "SELECT COUNT(DISTINCT e.DEVICE_ID) FROM DM_DEVICE d INNER JOIN DM_ENROLMENT e " + String sql = "SELECT COUNT(DISTINCT e.DEVICE_ID) AS COUNT " +
"FROM DM_DEVICE d INNER JOIN DM_ENROLMENT e " +
"ON d.ID = e.DEVICE_ID " + "ON d.ID = e.DEVICE_ID " +
"WHERE e.TENANT_ID = ? " + "WHERE e.TENANT_ID = ? " +
"AND e.DEVICE_ID IN (" + deviceIdStringList+ ") " + "AND e.DEVICE_ID IN (" + deviceIdStringList+ ") " +

Loading…
Cancel
Save