mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
docs: update docs
This commit is contained in:
parent
1ce835a00d
commit
9f00376786
@ -19,7 +19,7 @@ class ArticleServiceTest {
|
|||||||
.select(ARTICLE.ALL_COLUMNS)
|
.select(ARTICLE.ALL_COLUMNS)
|
||||||
.from(ARTICLE)
|
.from(ARTICLE)
|
||||||
.where(ARTICLE.ID.ge(100))
|
.where(ARTICLE.ID.ge(100))
|
||||||
.list();
|
.getList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -31,14 +31,16 @@ List<Article> articles = QueryWrapperChain.create(mapper)
|
|||||||
.select(ARTICLE.ALL_COLUMNS)
|
.select(ARTICLE.ALL_COLUMNS)
|
||||||
.from(ARTICLE)
|
.from(ARTICLE)
|
||||||
.where(ARTICLE.ID.ge(100))
|
.where(ARTICLE.ID.ge(100))
|
||||||
.list();
|
.getList();
|
||||||
```
|
```
|
||||||
|
|
||||||
## QueryWrapperChain 的方法
|
## QueryWrapperChain 的方法
|
||||||
|
|
||||||
- one():获取一条数据
|
- getOne():获取一条数据
|
||||||
- list():获取多条数据
|
- getList():获取多条数据
|
||||||
- page():分页查询
|
- getPage():分页查询
|
||||||
|
- getObj():当 SQL 查询只返回 1 列数据的时候,且只有 1 条数据时,可以使用此方法
|
||||||
|
- getObjList():当 SQL 查询只返回 1 列数据的时候,可以使用此方法
|
||||||
- remove():删除数据
|
- remove():删除数据
|
||||||
- update(entity):更新数据
|
- update(entity):更新数据
|
||||||
- count():查询数据条数
|
- count():查询数据条数
|
||||||
@ -46,30 +48,49 @@ List<Article> articles = QueryWrapperChain.create(mapper)
|
|||||||
|
|
||||||
## 扩展方法
|
## 扩展方法
|
||||||
|
|
||||||
### `one()` 系列方法
|
### `getOne()` 系列方法
|
||||||
|
|
||||||
- one():获取一条数据
|
- getOne():获取一条数据
|
||||||
- oneAs(asType):查询数据,并直接转换为 vo、dto 等
|
- getOneAs(asType):查询数据,并直接转换为 vo、dto 等
|
||||||
- oneWithRelations:查询一条数据及其关联数据
|
- getOneWithRelations:查询一条数据及其关联数据
|
||||||
- oneWithRelationsAs:查询一条数据及其关联数据,并直接转换为 vo、dto 等
|
- getOneWithRelationsAs:查询一条数据及其关联数据,并直接转换为 vo、dto 等
|
||||||
- oneOpt:返回 Optional 类型,获取一条数据
|
- getOneOpt:返回 Optional 类型,获取一条数据
|
||||||
- oneAsOpt(asType):返回 Optional 类型,查询数据,并直接转换为 vo、dto 等
|
- getOneAsOpt(asType):返回 Optional 类型,查询数据,并直接转换为 vo、dto 等
|
||||||
- oneWithRelationsOpt:返回 Optional 类型,查询一条数据及其关联数据
|
- getOneWithRelationsOpt:返回 Optional 类型,查询一条数据及其关联数据
|
||||||
- oneWithRelationsAsOpt:返回 Optional 类型,查询一条数据及其关联数据,并直接转换为 vo、dto 等
|
- getOneWithRelationsAsOpt:返回 Optional 类型,查询一条数据及其关联数据,并直接转换为 vo、dto 等
|
||||||
|
|
||||||
|
|
||||||
### `list()` 系列方法
|
### `getList()` 系列方法
|
||||||
|
|
||||||
|
- getList():查询数据列表
|
||||||
|
- getListWithRelations():查询数据列表极其关联数据
|
||||||
|
- getListAs():查询数据列表,并直接转换为 vo、dto 等
|
||||||
|
- getListWithRelationsAs():查询数据列表,及其关联数据,并直接转换为 vo、dto 等
|
||||||
|
|
||||||
|
|
||||||
|
### `getPage()` 系列方法
|
||||||
|
|
||||||
|
- getPage(page):分页查询数据列表
|
||||||
|
- getPageWithRelations(page):分页查询数据列表极其关联数据
|
||||||
|
- getPageAs(page):分页查询数据列表,并直接转换为 vo、dto 等
|
||||||
|
- getPageWithRelationsAs(page):分页查询数据列表,及其关联数据,并直接转换为 vo、dto 等
|
||||||
|
|
||||||
|
### `getObj()` 系列方法
|
||||||
|
|
||||||
|
- getObj():查询第一列,且第一条数据
|
||||||
|
- getObjAs(asType):查询第一列,且第一条数据并转换为指定类型,比如 Long, String 等
|
||||||
|
- getObjOpt():返回 Optional 类型,查询第一列,且第一条数据
|
||||||
|
- getObjAsOpt(asType):返回 Optional 类型,查询第一列,且第一条数据并转换为指定类型,比如 Long, String 等
|
||||||
|
|
||||||
|
### `getObjList()` 系列方法
|
||||||
|
|
||||||
|
- getObjList():查询第一列
|
||||||
|
- getObjListAs(asType):查询第一列,并转换为指定类型,比如 Long, String 等
|
||||||
|
- getObjListOpt():返回 Optional 类型,查询第一列
|
||||||
|
- getObjListAsOpt(asType):返回 Optional 类型,查询第一列,并转换为指定类型,比如 Long, String 等
|
||||||
|
|
||||||
|
|
||||||
- list():查询数据列表
|
|
||||||
- listWithRelations():查询数据列表极其关联数据
|
|
||||||
- listAs():查询数据列表,并直接转换为 vo、dto 等
|
|
||||||
- listWithRelationsAs():查询数据列表,及其关联数据,并直接转换为 vo、dto 等
|
|
||||||
|
|
||||||
|
|
||||||
### `page()` 系列方法
|
|
||||||
|
|
||||||
- page(page):分页查询数据列表
|
|
||||||
- pageWithRelations(page):分页查询数据列表极其关联数据
|
|
||||||
- pageAs(page):分页查询数据列表,并直接转换为 vo、dto 等
|
|
||||||
- pageWithRelationsAs(page):分页查询数据列表,及其关联数据,并直接转换为 vo、dto 等
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user