static int extractVariableOrLiteral(SqlParams params, String str) {
    if (str != null) {
      if (str.startsWith(":") && str.length() > 1) {
        String fetchVariableName = extractVariableName(str);
        if (params.contains(fetchVariableName)) {
          return ((Number) params.get(fetchVariableName)).intValue();
        }
      } else if (str.matches("[0-9]+")) {
        return Integer.parseInt(str);
      }
    }
    return 0;
  }