diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/WaterDaoImpl.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/WaterDaoImpl.java index 0ba3d13be..d15314d84 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/WaterDaoImpl.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/WaterDaoImpl.java @@ -720,7 +720,8 @@ public List> getLedgerReport(String consumercode, String ten newlimit = limit; if (limit != null && limit >= wsConfiguration.getMaxLimit()) newlimit = wsConfiguration.getMaxLimit(); - + if (limit != null && limit == -1) // Handling the case when limit is -1 + newlimit = -1; if (offset != null) newoffset = offset; @@ -737,6 +738,9 @@ public List> getLedgerReport(String consumercode, String ten ledgerReportRowMapper.setEndYear(endYear); ledgerReportRowMapper.setConsumerCode(consumercode); List> ledgerReportList= jdbcTemplate.query(query.toString(), preparedStatement.toArray(), ledgerReportRowMapper); + if (newlimit == -1) { + return ledgerReportList; + } int fromIndex = Math.min(newoffset, ledgerReportList.size()); int toIndex = Math.min(fromIndex + newlimit, ledgerReportList.size()); return ledgerReportList.subList(fromIndex, toIndex);