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
238c5484b6
commit
9b83827c4f
30
readme.md
30
readme.md
@ -78,9 +78,9 @@ QueryWrapper query = QueryWrapper.create()
|
|||||||
.and(ACCOUNT.USER_NAME.like("zhang").or(ACCOUNT.USER_NAME.like("li")));
|
.and(ACCOUNT.USER_NAME.like("zhang").or(ACCOUNT.USER_NAME.like("li")));
|
||||||
|
|
||||||
// execute SQL:
|
// execute SQL:
|
||||||
// ELECT * FROM `tb_account`
|
// ELECT * FROM tb_account
|
||||||
// WHERE `tb_account`.`id` >= 100
|
// WHERE tb_account.id >= 100
|
||||||
// AND (`tb_account`.`user_name` LIKE '%zhang%' OR `tb_account`.`user_name` LIKE '%li%' )
|
// AND (tb_account.user_name LIKE '%zhang%' OR tb_account.user_name LIKE '%li%' )
|
||||||
List<Account> accounts = MybatisFlexBootstrap.getInstance()
|
List<Account> accounts = MybatisFlexBootstrap.getInstance()
|
||||||
.execute(AccountMapper.class, mapper ->
|
.execute(AccountMapper.class, mapper ->
|
||||||
mapper.selectListByQuery(query)
|
mapper.selectListByQuery(query)
|
||||||
@ -99,10 +99,10 @@ QueryWrapper query = QueryWrapper.create()
|
|||||||
.orderBy(ACCOUNT.ID.desc());
|
.orderBy(ACCOUNT.ID.desc());
|
||||||
|
|
||||||
// execute SQL:
|
// execute SQL:
|
||||||
// ELECT * FROM `tb_account`
|
// ELECT * FROM tb_account
|
||||||
// WHERE `tb_account`.`id` >= 100
|
// WHERE tb_account.id >= 100
|
||||||
// AND (`tb_account`.`user_name` LIKE '%zhang%' OR `tb_account`.`user_name` LIKE '%li%' )
|
// AND (tb_account.user_name LIKE '%zhang%' OR tb_account.user_name LIKE '%li%' )
|
||||||
// ORDER BY `tb_account`.`id` DESC
|
// ORDER BY tb_account.id DESC
|
||||||
// LIMIT 40,10
|
// LIMIT 40,10
|
||||||
Page<Account> accountPage = MybatisFlexBootstrap.getInstance()
|
Page<Account> accountPage = MybatisFlexBootstrap.getInstance()
|
||||||
.execute(AccountMapper.class, mapper ->
|
.execute(AccountMapper.class, mapper ->
|
||||||
@ -257,8 +257,8 @@ QueryWrapper queryWrapper=QueryWrapper.create()
|
|||||||
.orderBy(ACCOUNT.AGE.asc(), ACCOUNT.USER_NAME.desc().nullsLast());
|
.orderBy(ACCOUNT.AGE.asc(), ACCOUNT.USER_NAME.desc().nullsLast());
|
||||||
|
|
||||||
// SQL:
|
// SQL:
|
||||||
// SELECT * FROM `tb_account`
|
// SELECT * FROM tb_account
|
||||||
// ORDER BY `age` ASC, `user_name` DESC NULLS LAST
|
// ORDER BY age ASC, user_name DESC NULLS LAST
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -291,27 +291,27 @@ QueryWrapper queryWrapper = QueryWrapper.create()
|
|||||||
// MySql:
|
// MySql:
|
||||||
// SELECT * FROM `tb_account` ORDER BY `id` DESC LIMIT 20, 10
|
// 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
|
// 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
|
// SELECT SKIP 20 FIRST 10 * FROM "tb_account" ORDER BY "id" DESC
|
||||||
|
|
||||||
// oracle:
|
// Oracle:
|
||||||
// SELECT * FROM (SELECT TEMP_DATAS.*,
|
// SELECT * FROM (SELECT TEMP_DATAS.*,
|
||||||
// ROWNUM RN FROM (
|
// ROWNUM RN FROM (
|
||||||
// SELECT * FROM "tb_account" ORDER BY "id" DESC)
|
// SELECT * FROM "tb_account" ORDER BY "id" DESC)
|
||||||
// TEMP_DATAS WHERE ROWNUM <=30)
|
// TEMP_DATAS WHERE ROWNUM <=30)
|
||||||
// WHERE RN >20
|
// WHERE RN >20
|
||||||
|
|
||||||
// db2:
|
// Db2:
|
||||||
// SELECT * FROM "tb_account" ORDER BY "id" DESC
|
// SELECT * FROM "tb_account" ORDER BY "id" DESC
|
||||||
// OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
|
// OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
|
||||||
|
|
||||||
// sybase:
|
// Sybase:
|
||||||
// SELECT TOP 10 START AT 21 * FROM "tb_account" ORDER BY "id" DESC
|
// 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
|
// SELECT * FROM "tb_account" ORDER BY "id" DESC ROWS 20 TO 30
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
40
readme_zh.md
40
readme_zh.md
@ -98,10 +98,10 @@ QueryWrapper query=QueryWrapper.create()
|
|||||||
.and(ACCOUNT.USER_NAME.like("张").or(ACCOUNT.USER_NAME.like("李")));
|
.and(ACCOUNT.USER_NAME.like("张").or(ACCOUNT.USER_NAME.like("李")));
|
||||||
|
|
||||||
// 执行 SQL:
|
// 执行 SQL:
|
||||||
// ELECT * FROM `tb_account`
|
// ELECT * FROM tb_account
|
||||||
// WHERE `tb_account`.`id` >= 100
|
// WHERE tb_account.id >= 100
|
||||||
// AND (`tb_account`.`user_name` LIKE '%张%' OR `tb_account`.`user_name` LIKE '%李%' )
|
// AND (tb_account.user_name LIKE '%张%' OR tb_account.user_name LIKE '%李%' )
|
||||||
List<Account> accounts=MybatisFlexBootstrap.getInstance()
|
List<Account> accounts = MybatisFlexBootstrap.getInstance()
|
||||||
.execute(AccountMapper.class,mapper->
|
.execute(AccountMapper.class,mapper->
|
||||||
mapper.selectListByQuery(query)
|
mapper.selectListByQuery(query)
|
||||||
);
|
);
|
||||||
@ -120,12 +120,12 @@ QueryWrapper query=QueryWrapper.create()
|
|||||||
.orderBy(ACCOUNT.ID.desc());
|
.orderBy(ACCOUNT.ID.desc());
|
||||||
|
|
||||||
// 执行 SQL:
|
// 执行 SQL:
|
||||||
// ELECT * FROM `tb_account`
|
// ELECT * FROM tb_account
|
||||||
// WHERE `id` >= 100
|
// WHERE id >= 100
|
||||||
// AND (`user_name` LIKE '%张%' OR `user_name` LIKE '%李%' )
|
// AND (user_name LIKE '%张%' OR user_name LIKE '%李%' )
|
||||||
// ORDER BY `id` DESC
|
// ORDER BY `id` DESC
|
||||||
// LIMIT 40,10
|
// LIMIT 40,10
|
||||||
Page<Account> accounts=MybatisFlexBootstrap.getInstance()
|
Page<Account> accounts = MybatisFlexBootstrap.getInstance()
|
||||||
.execute(AccountMapper.class,mapper->
|
.execute(AccountMapper.class,mapper->
|
||||||
mapper.paginate(5,10,query)
|
mapper.paginate(5,10,query)
|
||||||
);
|
);
|
||||||
@ -214,9 +214,9 @@ QueryWrapper queryWrapper = QueryWrapper.create()
|
|||||||
));
|
));
|
||||||
|
|
||||||
// SQL:
|
// SQL:
|
||||||
// SELECT * FROM `tb_account`
|
// SELECT * FROM tb_account
|
||||||
// WHERE `id` >=
|
// WHERE id >=
|
||||||
// (SELECT `account_id` FROM `tb_article` WHERE `id` >= ? )
|
// (SELECT account_id FROM tb_article WHERE id >= ? )
|
||||||
```
|
```
|
||||||
|
|
||||||
### exists, not exists
|
### exists, not exists
|
||||||
@ -295,8 +295,8 @@ QueryWrapper queryWrapper=QueryWrapper.create()
|
|||||||
, ACCOUNT.USER_NAME.desc().nullsLast());
|
, ACCOUNT.USER_NAME.desc().nullsLast());
|
||||||
|
|
||||||
// SQL:
|
// SQL:
|
||||||
// SELECT * FROM `tb_account`
|
// SELECT * FROM tb_account
|
||||||
// ORDER BY `age` ASC, `user_name` DESC NULLS LAST
|
// ORDER BY age ASC, user_name DESC NULLS LAST
|
||||||
```
|
```
|
||||||
|
|
||||||
### join
|
### join
|
||||||
@ -330,27 +330,27 @@ QueryWrapper queryWrapper = QueryWrapper.create()
|
|||||||
// MySql:
|
// MySql:
|
||||||
// SELECT * FROM `tb_account` ORDER BY `id` DESC LIMIT 20, 10
|
// 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
|
// 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
|
// SELECT SKIP 20 FIRST 10 * FROM "tb_account" ORDER BY "id" DESC
|
||||||
|
|
||||||
// oracle:
|
// Oracle:
|
||||||
// SELECT * FROM (SELECT TEMP_DATAS.*,
|
// SELECT * FROM (SELECT TEMP_DATAS.*,
|
||||||
// ROWNUM RN FROM (
|
// ROWNUM RN FROM (
|
||||||
// SELECT * FROM "tb_account" ORDER BY "id" DESC)
|
// SELECT * FROM "tb_account" ORDER BY "id" DESC)
|
||||||
// TEMP_DATAS WHERE ROWNUM <=30)
|
// TEMP_DATAS WHERE ROWNUM <=30)
|
||||||
// WHERE RN >20
|
// WHERE RN >20
|
||||||
|
|
||||||
// db2:
|
// Db2:
|
||||||
// SELECT * FROM "tb_account" ORDER BY "id" DESC
|
// SELECT * FROM "tb_account" ORDER BY "id" DESC
|
||||||
// OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
|
// OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
|
||||||
|
|
||||||
// sybase:
|
// Sybase:
|
||||||
// SELECT TOP 10 START AT 21 * FROM "tb_account" ORDER BY "id" DESC
|
// 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
|
// SELECT * FROM "tb_account" ORDER BY "id" DESC ROWS 20 TO 30
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ account.addOption("c3", new Date());
|
|||||||
```
|
```
|
||||||
mybatis 日志:
|
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)
|
==> Parameters: test(String), {"c3":"2023-03-17 09:10:16.546","c1":11,"c2":"zhang"}(String)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user