更新生成插件

This commit is contained in:
iqudoo
2026-04-09 16:41:32 +08:00
parent 8a5ff1c44c
commit caeaad6426
3 changed files with 42 additions and 2 deletions

View File

@@ -41,6 +41,7 @@
- `countByValid({Example} example)` - 统计有效记录数
- `countByTrash({Example} example)` - 统计回收站记录数
- `insert({Model} record)` - 插入记录(自动生成 GUID、设置默认值
- `updateByExampleSelective({Model} record, {Example} example)` - 按条件更新记录
- `update({Model} record)` - 更新记录(支持乐观锁)
### TapeRepoviewGeneratorPlugin
@@ -54,8 +55,8 @@
- `getList({Example} example)` - 获取记录列表(支持分页)
- `count({Example} example)` - 统计记录数
### 分页功能
通过 `AbstractWithLimitPlugin` 为所有 Example 类添加分页支持:
### 其他功能
通过 `TapeMybatisGeneratorPlugin` 为所有 Example 类添加支持:
**添加的字段**
- `offset` - 偏移量
@@ -64,6 +65,7 @@
- `ignorePageSize` - 忽略分页数量(默认 10000每页数量大于10000时忽略分页
- `defaultPageSize` - 默认每页数量(默认 20
- `maxPageSize` - 最大每页数量(默认 100
- `withBLOBs` - 是否返回BLOBs列的数据
**添加的方法**
- `limit(int rows)` - 设置每页数量
@@ -71,6 +73,8 @@
- `usePage(int pageNum, int pageSize)` - 使用页码和每页数量(自动计算 offset
- `getPageNum()` - 获取当前页码
- `getPageSize()` - 获取当前每页数量
- `setWithBLOBs(boolean withBLOBs)` - 设置是否返回BLOBs列的数据
- `isWithBLOBs()` - 是否返回BLOBs列的数据
## 使用方法
### 1. 在 `pom.xml` 中配置插件