update docs

This commit is contained in:
开源海哥 2023-04-01 12:23:51 +08:00
parent 56c399725b
commit d2c526bb39

View File

@ -293,6 +293,7 @@ QueryWrapper queryWrapper=QueryWrapper.create()
.where(ACCOUNT.AGE.ge(10)); .where(ACCOUNT.AGE.ge(10));
``` ```
其查询生成的 Sql 如下: 其查询生成的 Sql 如下:
```sql ```sql
@ -302,6 +303,51 @@ INNER JOIN tb_article ON tb_account.id = tb_article.account_id
WHERE tb_account.age >= ? WHERE tb_account.age >= ?
``` ```
## join on 多个条件
```java
QueryWrapper queryWrapper = QueryWrapper.create()
.select()
.from(ACCOUNT)
.leftJoin(ARTICLE).on(
ACCOUNT.ID.eq(ARTICLE.ACCOUNT_ID).and(ACCOUNT.AGE.eq(18))
)
.where(ACCOUNT.AGE.ge(10));
```
其查询生成的 Sql 如下:
```sql
SELECT * FROM tb_account LEFT JOIN tb_article
ON tb_account.id = tb_article.account_id AND tb_account.age = ?
WHERE tb_account.age >= ?
```
## join select
```java
QueryWrapper queryWrapper = QueryWrapper.create()
.select()
.from(ACCOUNT)
.leftJoin(
select().from(ARTICLE).where(ARTICLE.ID.ge(100))
).as("a").on(
ACCOUNT.ID.eq(raw("a.id"))
)
.where(ACCOUNT.AGE.ge(10));
```
其查询生成的 Sql 如下:
```sql
SELECT * FROM tb_account
LEFT JOIN (SELECT * FROM tb_article WHERE id >= ? ) AS a
ON tb_account.id = a.id
WHERE tb_account.age >= ?
```
## limit... offset ## limit... offset
::: tip 提示 ::: tip 提示