@Override
  public Page<AddressLocationDetails> retrieveAllAddressLocations(
      final SearchSqlQuery searchAddresses) {
    try {
      context.authenticatedUser();
      final AddressLocationMapper locationMapper = new AddressLocationMapper();

      final StringBuilder sqlBuilder = new StringBuilder(200);
      sqlBuilder.append("select ");
      sqlBuilder.append(locationMapper.schema());
      String sqlSearch = searchAddresses.getSqlSearch();
      String extraCriteria = "";
      if (sqlSearch != null) {
        sqlSearch = sqlSearch.trim();
        extraCriteria = "  where country_name like '%" + sqlSearch + "%' ";
      }

      sqlBuilder.append(extraCriteria);

      if (searchAddresses.isLimited()) {
        sqlBuilder.append(" limit ").append(searchAddresses.getLimit());
      }
      if (searchAddresses.isOffset()) {
        sqlBuilder.append(" offset ").append(searchAddresses.getOffset());
      }
      return this.paginationHelper.fetchPage(
          this.jdbcTemplate,
          "SELECT FOUND_ROWS()",
          sqlBuilder.toString(),
          new Object[] {},
          locationMapper);
    } catch (final EmptyResultDataAccessException e) {
      return null;
    }
  }
  @GET
  @Consumes({MediaType.APPLICATION_JSON})
  @Produces({MediaType.APPLICATION_JSON})
  public String retrieveUploadFiles(
      @Context final UriInfo uriInfo,
      @QueryParam("sqlSearch") final String sqlSearch,
      @QueryParam("limit") final Integer limit,
      @QueryParam("offset") final Integer offset) {

    context.authenticatedUser().validateHasReadPermission(RESOURCENAME_FOR_PERMISSIONS);
    final SearchSqlQuery searchUploads = SearchSqlQuery.forSearch(sqlSearch, offset, limit);
    final Page<UploadStatusData> uploadstatusdata =
        this.dataUploadReadPlatformService.retrieveAllUploadStatusData(searchUploads);
    return this.toApiJsonSerializer.serialize(uploadstatusdata);
  }
  @GET
  @Consumes({MediaType.APPLICATION_JSON})
  @Produces({MediaType.APPLICATION_JSON})
  public String retrieveAllDetailsForPayments(
      @Context final UriInfo uriInfo,
      @QueryParam("sqlSearch") final String sqlSearch,
      @QueryParam("source") final String source,
      @QueryParam("limit") final Integer limit,
      @QueryParam("offset") final Integer offset,
      @QueryParam("tabType") final String type) {

    this.context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
    final SearchSqlQuery searchItemDetails = SearchSqlQuery.forSearch(sqlSearch, offset, limit);
    Page<PaymentGatewayData> paymentData =
        readPlatformService.retrievePaymentGatewayData(searchItemDetails, type, source);
    return this.toApiJsonSerializer.serialize(paymentData);
  }