mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
update docs
This commit is contained in:
parent
f1d07d5341
commit
bf809f6098
@ -102,7 +102,7 @@ export default defineConfig({
|
||||
"script",
|
||||
{},
|
||||
`
|
||||
if (location.protocol !== 'https:') {
|
||||
if (location.protocol !== 'https:' && location.hostname != 'localhost') {
|
||||
location.href = 'https://' + location.hostname + location.pathname + location.search;
|
||||
}
|
||||
`
|
||||
|
||||
@ -347,6 +347,25 @@ ON tb_account.id = a.id
|
||||
WHERE tb_account.age >= ?
|
||||
```
|
||||
|
||||
## union, union all
|
||||
|
||||
```java
|
||||
QueryWrapper query = new QueryWrapper()
|
||||
.select(ACCOUNT.ID)
|
||||
.from(ACCOUNT)
|
||||
.orderBy(ACCOUNT.ID.desc())
|
||||
.union(select(ARTICLE.ID).from(ARTICLE))
|
||||
.unionAll(select(ARTICLE.ID).from(ARTICLE));
|
||||
```
|
||||
|
||||
其查询生成的 Sql 如下:
|
||||
|
||||
```sql
|
||||
(SELECT id FROM tb_account ORDER BY id DESC)
|
||||
UNION (SELECT id FROM tb_article)
|
||||
UNION ALL (SELECT id FROM tb_article)
|
||||
```
|
||||
|
||||
|
||||
## limit... offset
|
||||
|
||||
|
||||
@ -83,6 +83,7 @@ public class AccountSqlTester {
|
||||
QueryWrapper query = new QueryWrapper()
|
||||
.select(ACCOUNT.ID)
|
||||
.from(ACCOUNT)
|
||||
.orderBy(ACCOUNT.ID.desc())
|
||||
.union(select(ARTICLE.ID).from(ARTICLE))
|
||||
.unionAll(select(ARTICLE.ID).from(ARTICLE));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user