mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 08:38:26 +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")));
|
||||
|
||||
// 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
|
||||
```
|
||||
|
||||
|
||||
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("李")));
|
||||
|
||||
// 执行 SQL:
|
||||
// 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()
|
||||
// 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,12 +120,12 @@ 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()
|
||||
Page<Account> accounts = MybatisFlexBootstrap.getInstance()
|
||||
.execute(AccountMapper.class,mapper->
|
||||
mapper.paginate(5,10,query)
|
||||
);
|
||||
@ -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)
|
||||
```
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user