mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 17:18:24 +08:00
update docs
This commit is contained in:
parent
84d64cdf18
commit
640f2e109a
@ -60,8 +60,9 @@ export default defineConfig({
|
||||
items: [
|
||||
{text: '增删改', link: '/zh/base/add-delete-update'},
|
||||
{text: '查询和分页', link: '/zh/base/query'},
|
||||
{text: 'IService', link: '/zh/base/service'},
|
||||
{text: 'QueryWrapper', link: '/zh/base/querywrapper'},
|
||||
{text: 'Db + Row', link: '/zh/base/db-row'},
|
||||
{text: 'IService', link: '/zh/base/service'},
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -70,7 +71,6 @@ export default defineConfig({
|
||||
{text: '@Table 注解', link: '/zh/core/table'},
|
||||
{text: '@Id 注解', link: '/zh/core/id'},
|
||||
{text: '@Column 注解', link: '/zh/core/column'},
|
||||
{text: 'Db + Row', link: '/zh/core/db-row'},
|
||||
{text: '逻辑删除', link: '/zh/core/logic-delete'},
|
||||
{text: '乐观锁', link: '/zh/core/version'},
|
||||
{text: '数据填充', link: '/zh/core/fill'},
|
||||
|
||||
@ -19,6 +19,9 @@
|
||||
- **selectListByQueryAs(query, asType)**: 和 `selectListByQuery` 方法类似,但是在某些场景下,`query` 可能包含了 `left join` 等多表查询,返回的数据和 entity 字段不一致时,
|
||||
可以通过 `asType` 参数来指定接收的数据类型(通常是 dto、vo 等)。
|
||||
- **selectAll**:查询所有数据。
|
||||
- **selectObjectByQuery(query)**:查询只返回 1 列,并只有 1 条数据的场景。
|
||||
- **selectObjectListByQuery(query)**:查询只返回 1 列场景,比如 `QueryWrapper.create().select(ACCOINT.ID).from(...)`。
|
||||
- **selectObjectListByQueryAs(query, asType)**:对 `selectObjectListByQuery` 进行封装,并转换为特定的类型。
|
||||
- **selectCountByCondition**:根据 QueryWrapper 查询数据量。
|
||||
- **selectCountByQuery**:根据 QueryWrapper 查询数据量。
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ MyBatis-Flex 提供了一个名为 `IService` 的接口,及其默认实现类
|
||||
```java
|
||||
public interface IAccountService extends IService{
|
||||
//你的自定义方法
|
||||
Account customMethod();
|
||||
List<Account> customMethod();
|
||||
}
|
||||
```
|
||||
|
||||
@ -27,8 +27,9 @@ public class AccountServiceImpl implements IAccountService
|
||||
extends ServiceImpl<AccountMapper, Account>{
|
||||
|
||||
@Override
|
||||
public Account customMethod(){
|
||||
return getMapper().selectOneByQuery("...");
|
||||
public List<Account> customMethod(){
|
||||
//返回 id >= 100 的数据
|
||||
return list(ACCOUNT.ID.ge(100));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user