@Override
public Collection<DepositAccountInterestRateChartData> extractData(ResultSet rs) throws SQLException, DataAccessException {
List<DepositAccountInterestRateChartData> chartDataList = new ArrayList<>();
DepositAccountInterestRateChartData chartData = null;
Long interestRateChartId = null;
int ircIndex = 0;// Interest rate chart index
while (rs.next()) {
Long tempIrcId = rs.getLong("ircId");
// first row or when interest rate chart id changes
if (chartData == null || (interestRateChartId != null && !interestRateChartId.equals(tempIrcId))) {
interestRateChartId = tempIrcId;
chartData = chartMapper.mapRow(rs, ircIndex++);
chartDataList.add(chartData);
}
final DepositAccountInterestRateChartSlabData chartSlabsData = chartSlabsMapper.extractData(rs);
if (chartSlabsData != null) {
chartData.addChartSlab(chartSlabsData);
}
}
return chartDataList;
}