final StringBuilder sqlBuilder = new StringBuilder(400);
sqlBuilder.append("select ");
sqlBuilder.append(depositAccountMapper.schema());
sqlBuilder.append(" where sa.id = ? and sa.deposit_type_enum = ? ");
DepositAccountData account = this.jdbcTemplate.queryForObject(sqlBuilder.toString(), depositAccountMapper, new Object[] {
accountId, depositAccountType.getValue() });
Collection<EnumOptionData> onAccountClosureOptions = SavingsEnumerations
.depositAccountOnClosureType(DepositAccountOnClosureType.values());
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
final Collection<SavingsAccountData> savingsAccountDatas = this.savingsAccountReadPlatformService.retrieveActiveForLookup(
account.clientId(), DepositAccountType.SAVINGS_DEPOSIT);
if (depositAccountType.isFixedDeposit()) {
account = FixedDepositAccountData.withClosureTemplateDetails((FixedDepositAccountData) account, onAccountClosureOptions,
paymentTypeOptions, savingsAccountDatas);
} else if (depositAccountType.isRecurringDeposit()) {
account = RecurringDepositAccountData.withClosureTemplateDetails((RecurringDepositAccountData) account,