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