Like {@link #leftJoin(QueryBuilder)} but this combines the WHERE statements of two query builders with a SQL
"OR".
330065
public QueryBuilder<T, ID> leftJoinOr(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
		addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.OR);
		return this;
	}
959852
@NonNull
    @Override
    public Joins join(@NonNull Join... joins) {
        if (joins == null) {
            throw new IllegalArgumentException("joins cannot be null.");
        }
        return new Joins(this, Arrays.asList(joins));
    }
406711
public function leftJoin($table, $field1, $operator, $field2) {
        array_push($this->_joins, ' LEFT JOIN ' . $table . ' ON ' . $field1 . ' ' . $operator . ' ' . $field2 . ' ');
    
        return $this;
    }
39201
public function leftJoin($join, $on = null): self
    {
        $this->statement->join('left', $join, $on);
        return $this;
    }
167080
public function leftJoin($fromAlias, $join, $alias, $condition = null)
    {
        $this->_dbPending[] = [
            'name' => 'leftJoin',
            'args' => [
                $fromAlias,
                $join,
                $alias,
                $condition
            ],
        ];

        return $this;
    }
316909
public function leftJoin(string $table, string $key, string $operator, string $value): SelectQueryBuilder
    {
        $this->addJoin($table, $key, $operator, $value, 'left');
        return $this;
    }
571950
private function applyWhereClause(Builder $query, $field, $operator, $value, $or = false) {
        $verb = $or ? 'orWhere' : 'where';
        $null_verb = $or ? 'orWhereNull' : 'whereNull';
        $not_null_verb = $or ? 'orWhereNotNull' : 'whereNotNull';

        $value = $this->base64decodeIfNecessary($value);

        switch ($value) {
            case 'today':
                return $query->$verb($field, 'like', Carbon::now()->format('Y-m-d') . '%');
            case 'nottoday':
                return $query->$verb(function ($q) use ($field) {
                    $q->where($field, 'not like', Carbon::now()->format('Y-m-d') . '%')
                        ->orWhereNull($field);
                });
            case 'null':
                return $query->$null_verb($field);
            case 'notnull':
                return $query->$not_null_verb($field);
            default:
                return $query->$verb($field, $operator, $value);
        }
    }
582465
private void addSubQuery(BoolQueryBuilder boolQuery, Where where, QueryBuilder subQuery) {
        if(where instanceof Condition){
            Condition condition = (Condition) where;

			if (condition.isNested()) {
				boolean isNestedQuery = subQuery instanceof NestedQueryBuilder;
				InnerHitBuilder ihb = null;
				if (condition.getInnerHits() != null) {
                    try (JsonXContentParser parser = new JsonXContentParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, new JsonFactory().createParser(condition.getInnerHits()))) {
                        ihb = InnerHitBuilder.fromXContent(parser);
                    } catch (IOException e) {
                        throw new IllegalArgumentException("couldn't parse inner_hits: " + e.getMessage(), e);
                    }
                }

                // bugfix #628
                if ("missing".equalsIgnoreCase(String.valueOf(condition.getValue())) && (condition.getOpear() == Condition.OPEAR.IS || condition.getOpear() == Condition.OPEAR.EQ)) {
                    NestedQueryBuilder q = isNestedQuery ? (NestedQueryBuilder) subQuery : QueryBuilders.nestedQuery(condition.getNestedPath(), QueryBuilders.boolQuery().mustNot(subQuery), ScoreMode.None);
					if (ihb != null) {
						q.innerHit(ihb);
                    }
                    boolQuery.mustNot(q);
                    return;
                }

                if (!isNestedQuery) {
					subQuery = QueryBuilders.nestedQuery(condition.getNestedPath(), subQuery, ScoreMode.None);
				}
                if (ihb != null) {
                    ((NestedQueryBuilder) subQuery).innerHit(ihb);
                }
            } else if(condition.isChildren()) {
            	subQuery = JoinQueryBuilders.hasChildQuery(condition.getChildType(), subQuery, ScoreMode.None);
            }
        }

		//zhongshu-comment 将subQuery对象纳入到boolQuery中，即boolQuery是上一级，subQuery是下一级
		if (where.getConn() == CONN.AND) {
			boolQuery.must(subQuery);
		} else {
			boolQuery.should(subQuery);
		}
	}
1204297
public function addJoin($join_field, $alias, $type = Join::INNER_JOIN, $cond = '')
    {
        if ($cond != '')
        {
            $cond = " with {$cond} ";
        }
        $join_method   = $type == Join::INNER_JOIN ? "innerJoin" : "leftJoin";
        $this->queryBuilder->$join_method($join_field, $alias, null, $cond);
        $this->joins[] = array($join_field, $alias, $type, $cond);
        return $this;
    }
1241138
public void appendQuerytoSQL(Collection<Match> matches, StringBuilder sb, List<Object> params) {

        // 如果query为空，则直接返回
        if (matches == null || matches.size() == 0) {
            return;
        }

        sb.append(" where ");
        appendMatches(matches, sb, params);
    }
229757
private Where<ExtendedRelation, Long> addToWhere(
			QueryBuilder<ExtendedRelation, Long> qb,
			Where<ExtendedRelation, Long> where) {
		if (where == null) {
			where = qb.where();
		} else {
			where.and();
		}
		return where;
	}
911894
public static <L, R> Either<L, R> leftOf(L reference) {
        require(reference != null, "Expected non-null reference");
        return new Left<>(reference);
    }
1159394
public function leftJoinUsing($table, $where)
    {
        $where = func_get_args();
        $table = array_shift($where);

        $this->join[] = [self::LEFT, $table, $where, true];

        return $this;
    }
314420
@Override
  public String toSql(QueryData queryData, String indent)
  {
    Assert.notEmpty(queryData.getAlternatives(), "BUG: no alternatives");

    StringBuffer sb = new StringBuffer();

    List<String> alternatives = new ArrayList<>();
    for (List<QueryNode> alternative : queryData.getAlternatives())
    {
      alternatives.add(createSqlForAlternative(queryData, alternative, indent));
    }
    sb.append(StringUtils.join(alternatives, "\n" + indent + "UNION "));

    // ORDER BY and LIMIT/OFFSET clauses cannot depend on alternative?
    appendOrderByClause(sb, queryData, null, indent);
    appendLimitOffsetClause(sb, queryData, null, indent);

    return sb.toString();
  }
736525
public function leftJoin($table, $alias_or_cond, $cond = null) {
		if (is_null($cond))
			$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, null, $alias_or_cond);
		else
			$this->joins[] = new JoinClause(JoinClause::LEFT_JOIN, $table, $alias_or_cond, $cond);
		return $this;
	}
765128
public Either<String, Either<Joiner4All, Mapper4All>> query(String sqlOrJsonQuery, NamedParameters namedParams, Map<String, String> reqHeaders, boolean printToConsole, String queryMode) {
        return query(sqlOrJsonQuery, namedParams, reqHeaders, printToConsole, queryMode, false);
    }
244711
public static String buildSqlSELECT(String tableName, String[][] columns, String[] whereColumns,
            Object[] whereValues) {
        final String SQL_TEMPLATE_WHERE = "SELECT {1} FROM {0} WHERE {2}";
        final String SQL_TEMPLATE = "SELECT {1} FROM {0}";

        final List<String> WHERE_CLAUSE = new ArrayList<String>();
        if (whereColumns != null && whereValues != null) {
            if (whereColumns.length != whereValues.length) {
                throw new IllegalArgumentException(
                        "Number of whereColumns must be equal to number of whereValues.");
            }
            for (int i = 0; i < whereColumns.length; i++) {
                if (whereValues[i] instanceof ParamExpression) {
                    WHERE_CLAUSE.add("(" + whereColumns[i] + "="
                            + ((ParamExpression) whereValues[i]).getExpression() + ")");
                } else {
                    WHERE_CLAUSE.add("(" + whereColumns[i] + "=?)");
                }
            }
        }

        final List<String> SELECT_COLUMNS = new ArrayList<String>();
        for (String[] colDef : columns) {
            if (colDef.length > 1) {
                SELECT_COLUMNS.add(colDef[0] + " AS " + colDef[1]);
            } else {
                SELECT_COLUMNS.add(colDef[0]);
            }
        }

        String SQL;
        if (WHERE_CLAUSE.size() > 0) {
            SQL = MessageFormat.format(SQL_TEMPLATE_WHERE, tableName,
                    StringUtils.join(SELECT_COLUMNS, ", "),
                    StringUtils.join(WHERE_CLAUSE, " AND "));
        } else {
            SQL = MessageFormat.format(SQL_TEMPLATE, tableName,
                    StringUtils.join(SELECT_COLUMNS, ", "));
        }

        return SQL;
    }