|
|
@ -605,10 +605,11 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
|
|
|
sql = sql + " AND e.OWNERSHIP = ?";
|
|
|
|
sql = sql + " AND e.OWNERSHIP = ?";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sql = sql + " GROUP BY SUBSTRING(e.DATE_OF_ENROLMENT, 1, 10) LIMIT ?,?";
|
|
|
|
sql = sql + " GROUP BY SUBSTRING(e.DATE_OF_ENROLMENT, 1, 10) LIMIT ? OFFSET ?";
|
|
|
|
|
|
|
|
|
|
|
|
try (Connection conn = this.getConnection();
|
|
|
|
try {
|
|
|
|
PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
Connection conn = this.getConnection();
|
|
|
|
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
int paramIdx = 1;
|
|
|
|
int paramIdx = 1;
|
|
|
|
stmt.setInt(paramIdx++, tenantId);
|
|
|
|
stmt.setInt(paramIdx++, tenantId);
|
|
|
|
stmt.setString(paramIdx++, fromDate);
|
|
|
|
stmt.setString(paramIdx++, fromDate);
|
|
|
@ -621,8 +622,8 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
|
|
|
if (ownership != null) {
|
|
|
|
if (ownership != null) {
|
|
|
|
stmt.setString(paramIdx++, ownership);
|
|
|
|
stmt.setString(paramIdx++, ownership);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stmt.setInt(paramIdx++, request.getStartIndex());
|
|
|
|
stmt.setInt(paramIdx++, request.getRowCount());
|
|
|
|
stmt.setInt(paramIdx, request.getRowCount());
|
|
|
|
stmt.setInt(paramIdx, request.getStartIndex());
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
Count count = new Count(
|
|
|
|
Count count = new Count(
|
|
|
@ -632,12 +633,14 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
|
|
|
countList.add(count);
|
|
|
|
countList.add(count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg = "Error occurred while retrieving information of all " +
|
|
|
|
String msg = "Error occurred while retrieving information of all " +
|
|
|
|
"registered devices under tenant id " + tenantId + " between " + fromDate + " to " + toDate;
|
|
|
|
"registered devices under tenant id " + tenantId + " between " + fromDate + " to " + toDate;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new DeviceManagementDAOException(msg, e);
|
|
|
|
throw new DeviceManagementDAOException(msg, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return countList;
|
|
|
|
return countList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|