update docs

This commit is contained in:
开源海哥 2023-03-17 09:30:06 +08:00
parent 238c5484b6
commit 9b83827c4f
2 changed files with 35 additions and 35 deletions

View File

@ -78,9 +78,9 @@ QueryWrapper query = QueryWrapper.create()
.and(ACCOUNT.USER_NAME.like("zhang").or(ACCOUNT.USER_NAME.like("li")));
// execute SQL
// ELECT * FROM `tb_account`
// WHERE `tb_account`.`id` >= 100
// AND (`tb_account`.`user_name` LIKE '%zhang%' OR `tb_account`.`user_name` LIKE '%li%' )
// ELECT * FROM tb_account
// WHERE tb_account.id >= 100
// AND (tb_account.user_name LIKE '%zhang%' OR tb_account.user_name LIKE '%li%' )
List<Account> accounts = MybatisFlexBootstrap.getInstance()
.execute(AccountMapper.class, mapper ->
mapper.selectListByQuery(query)
@ -99,10 +99,10 @@ QueryWrapper query = QueryWrapper.create()
.orderBy(ACCOUNT.ID.desc());
// execute SQL
// ELECT * FROM `tb_account`
// WHERE `tb_account`.`id` >= 100
// AND (`tb_account`.`user_name` LIKE '%zhang%' OR `tb_account`.`user_name` LIKE '%li%' )
// ORDER BY `tb_account`.`id` DESC
// ELECT * FROM tb_account
// WHERE tb_account.id >= 100
// AND (tb_account.user_name LIKE '%zhang%' OR tb_account.user_name LIKE '%li%' )
// ORDER BY tb_account.id DESC
// LIMIT 40,10
Page<Account> accountPage = MybatisFlexBootstrap.getInstance()
.execute(AccountMapper.class, mapper ->
@ -257,8 +257,8 @@ QueryWrapper queryWrapper=QueryWrapper.create()
.orderBy(ACCOUNT.AGE.asc(), ACCOUNT.USER_NAME.desc().nullsLast());
// SQL:
// SELECT * FROM `tb_account`
// ORDER BY `age` ASC, `user_name` DESC NULLS LAST
// SELECT * FROM tb_account
// ORDER BY age ASC, user_name DESC NULLS LAST
```
@ -291,27 +291,27 @@ QueryWrapper queryWrapper = QueryWrapper.create()
// MySql:
// SELECT * FROM `tb_account` ORDER BY `id` DESC LIMIT 20, 10
// postgreSQL:
// PostgreSQL:
// SELECT * FROM "tb_account" ORDER BY "id" DESC LIMIT 20 OFFSET 10
// informix:
// Informix:
// SELECT SKIP 20 FIRST 10 * FROM "tb_account" ORDER BY "id" DESC
// oracle:
// Oracle:
// SELECT * FROM (SELECT TEMP_DATAS.*,
// ROWNUM RN FROM (
// SELECT * FROM "tb_account" ORDER BY "id" DESC)
// TEMP_DATAS WHERE ROWNUM <=30)
// WHERE RN >20
// db2:
// Db2:
// SELECT * FROM "tb_account" ORDER BY "id" DESC
// OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
// sybase:
// Sybase:
// SELECT TOP 10 START AT 21 * FROM "tb_account" ORDER BY "id" DESC
// firebird:
// Firebird:
// SELECT * FROM "tb_account" ORDER BY "id" DESC ROWS 20 TO 30
```

View File

@ -98,9 +98,9 @@ QueryWrapper query=QueryWrapper.create()
.and(ACCOUNT.USER_NAME.like("张").or(ACCOUNT.USER_NAME.like("李")));
// 执行 SQL
// ELECT * FROM `tb_account`
// WHERE `tb_account`.`id` >= 100
// AND (`tb_account`.`user_name` LIKE '%张%' OR `tb_account`.`user_name` LIKE '%李%' )
// ELECT * FROM tb_account
// WHERE tb_account.id >= 100
// AND (tb_account.user_name LIKE '%张%' OR tb_account.user_name LIKE '%李%' )
List<Account> accounts = MybatisFlexBootstrap.getInstance()
.execute(AccountMapper.class,mapper->
mapper.selectListByQuery(query)
@ -120,9 +120,9 @@ QueryWrapper query=QueryWrapper.create()
.orderBy(ACCOUNT.ID.desc());
// 执行 SQL
// ELECT * FROM `tb_account`
// WHERE `id` >= 100
// AND (`user_name` LIKE '%张%' OR `user_name` LIKE '%李%' )
// ELECT * FROM tb_account
// WHERE id >= 100
// AND (user_name LIKE '%张%' OR user_name LIKE '%李%' )
// ORDER BY `id` DESC
// LIMIT 40,10
Page<Account> accounts = MybatisFlexBootstrap.getInstance()
@ -214,9 +214,9 @@ QueryWrapper queryWrapper = QueryWrapper.create()
));
// SQL:
// SELECT * FROM `tb_account`
// WHERE `id` >=
// (SELECT `account_id` FROM `tb_article` WHERE `id` >= ? )
// SELECT * FROM tb_account
// WHERE id >=
// (SELECT account_id FROM tb_article WHERE id >= ? )
```
### exists, not exists
@ -295,8 +295,8 @@ QueryWrapper queryWrapper=QueryWrapper.create()
, ACCOUNT.USER_NAME.desc().nullsLast());
// SQL:
// SELECT * FROM `tb_account`
// ORDER BY `age` ASC, `user_name` DESC NULLS LAST
// SELECT * FROM tb_account
// ORDER BY age ASC, user_name DESC NULLS LAST
```
### join
@ -330,27 +330,27 @@ QueryWrapper queryWrapper = QueryWrapper.create()
// MySql:
// SELECT * FROM `tb_account` ORDER BY `id` DESC LIMIT 20, 10
// postgreSQL:
// PostgreSQL:
// SELECT * FROM "tb_account" ORDER BY "id" DESC LIMIT 20 OFFSET 10
// informix:
// Informix:
// SELECT SKIP 20 FIRST 10 * FROM "tb_account" ORDER BY "id" DESC
// oracle:
// Oracle:
// SELECT * FROM (SELECT TEMP_DATAS.*,
// ROWNUM RN FROM (
// SELECT * FROM "tb_account" ORDER BY "id" DESC)
// TEMP_DATAS WHERE ROWNUM <=30)
// WHERE RN >20
// db2:
// Db2:
// SELECT * FROM "tb_account" ORDER BY "id" DESC
// OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
// sybase:
// Sybase:
// SELECT TOP 10 START AT 21 * FROM "tb_account" ORDER BY "id" DESC
// firebird:
// Firebird:
// SELECT * FROM "tb_account" ORDER BY "id" DESC ROWS 20 TO 30
```
@ -487,7 +487,7 @@ account.addOption("c3", new Date());
```
mybatis 日志:
```
==> Preparing: INSERT INTO `tb_account`(user_name, options) VALUES (?, ?)
==> Preparing: INSERT INTO tb_account (user_name, options) VALUES (?, ?)
==> Parameters: test(String), {"c3":"2023-03-17 09:10:16.546","c1":11,"c2":"zhang"}(String)
```