class BankBranchRepository {

	public BankBranchContractRequest update(BankBranchContractRequest bankBranchContractRequest) {

		List<Object[]> batchArgs = new ArrayList<>();
		if (bankBranchContractRequest.getBankBranches() != null)
			for (BankBranchContract bankBranchContract : bankBranchContractRequest.getBankBranches()) {
				bankBranchContract.setLastModifiedBy(bankBranchContractRequest.getRequestInfo().getUserInfo().getId());
				bankBranchContract.setLastModifiedDate(new Date(System.currentTimeMillis()));
				Object[] lobRecord = { bankBranchContract.getBank().getId(), bankBranchContract.getCode(),
						bankBranchContract.getName(), bankBranchContract.getAddress(), bankBranchContract.getAddress2(),
						bankBranchContract.getCity(), bankBranchContract.getState(), bankBranchContract.getPincode(),
						bankBranchContract.getPhone(), bankBranchContract.getFax(),
						bankBranchContract.getContactPerson(), bankBranchContract.getActive(),
						bankBranchContract.getDescription(), bankBranchContract.getMicr(),
						bankBranchContract.getTenantId(), bankBranchContract.getLastModifiedBy(),
						bankBranchContract.getLastModifiedDate(), bankBranchContract.getId(),
						bankBranchContract.getTenantId() };
				batchArgs.add(lobRecord);
			}
		if (bankBranchContractRequest.getBankBranch() != null
				&& bankBranchContractRequest.getBankBranch().getName() != null) {
			bankBranchContractRequest.getBankBranch()
					.setLastModifiedBy(bankBranchContractRequest.getRequestInfo().getUserInfo().getId());
			bankBranchContractRequest.getBankBranch().setLastModifiedDate(new Date(System.currentTimeMillis()));
			Object[] lobRecord = { bankBranchContractRequest.getBankBranch().getBank().getId(),
					bankBranchContractRequest.getBankBranch().getCode(),
					bankBranchContractRequest.getBankBranch().getName(),
					bankBranchContractRequest.getBankBranch().getAddress(),
					bankBranchContractRequest.getBankBranch().getAddress2(),
					bankBranchContractRequest.getBankBranch().getCity(), 4,
					bankBranchContractRequest.getBankBranch().getState(),
					bankBranchContractRequest.getBankBranch().getPincode(),
					bankBranchContractRequest.getBankBranch().getPhone(),
					bankBranchContractRequest.getBankBranch().getFax(),
					bankBranchContractRequest.getBankBranch().getContactPerson(),
					bankBranchContractRequest.getBankBranch().getActive(),
					bankBranchContractRequest.getBankBranch().getDescription(),
					bankBranchContractRequest.getBankBranch().getMicr(),
					bankBranchContractRequest.getBankBranch().getTenantId(),
					bankBranchContractRequest.getBankBranch().getLastModifiedBy(),
					bankBranchContractRequest.getBankBranch().getLastModifiedDate(),
					bankBranchContractRequest.getBankBranch().getId(),
					bankBranchContractRequest.getBankBranch().getTenantId() };

			batchArgs.add(lobRecord);
		}

		try {
			jdbcTemplate.batchUpdate(UPDATE_BANKBRANCH_QUERY, batchArgs);
		} catch (DataAccessException ex) {
			ex.printStackTrace();
			throw new RuntimeException(ex.getMessage());
		}

		return bankBranchContractRequest;

	}

	@Autowired public  BankBranchRepository(final JdbcTemplate jdbcTemplate, BankBranchRowMapper bankBranchRowMapper,
			BankBranchQueryBuilder bankBranchQueryBuilder);

}