优化:不依赖表前缀判断是否为视图

This commit is contained in:
iqudoo
2026-04-13 02:06:41 +08:00
parent 885f823203
commit 0bea5abfb6
6 changed files with 35 additions and 59 deletions

View File

@@ -5,10 +5,9 @@
本插件为 MyBatis Generator 提供了以下增强功能:
1. **TapeMybatisGeneratorPlugin** - 扩展 MyBatis Mapper添加 `selectPrimaryKeyByExample` 方法,支持分页查询主键列表
1. **TapeMybatisGeneratorPlugin** - 扩展 MyBatis Mapper添加 `selectPrimaryKeyByExample`, `batchInsert` 方法,拓展查询分页支持
2. **TapeRepositoryGeneratorPlugin** - 为非视图表自动生成 Repository 接口和实现类,提供完整的 CRUD 和软删除功能
3. **TapeRepoviewGeneratorPlugin** - 为视图表自动生成 RepoView 接口和实现类,提供查询功能
4. **分页支持** - 为 Example 类自动添加分页相关字段和方法offset、rows、usePage、limit 等)
## 插件说明
@@ -131,7 +130,6 @@
```xml
<context id="Mysql" targetRuntime="MyBatis3">
<!-- 配置属性 -->
<property name="viewKeyWords" value="VIEW_,V_"/>
<property name="targetProject" value="src/main/java"/>
<property name="modelPackage" value="com.iqudoo.platform.application.database.model"/>
<property name="mapperPackage" value="com.iqudoo.platform.application.database.mapper"/>
@@ -161,7 +159,6 @@
| 参数名 | 说明 | 默认值 | 必需 |
|----------------------------|-------------------------------|-------------------------------------------------------|------|
| `viewKeyWords` | 视图表关键字(逗号分隔,不区分大小写) | `VIEW_,V_` | 否 |
| `targetProject` | 生成代码的目标项目路径 | `src/main/java` | 否 |
| `modelPackage` | Model 类的包路径 | `com.iqudoo.platform.application.database.model` | 是 |
| `mapperPackage` | Mapper 接口的包路径 | `com.iqudoo.platform.application.database.mapper` | 是 |
@@ -177,11 +174,6 @@
| `startPageNum` | 分页开始页码 | `1` | 否 |
| `maxPageSize` | 最大每页数量 | `100` | 否 |
**视图表识别规则**
- 表名包含 `viewKeyWords` 中任一关键字的表将被识别为视图表,大小写不敏感
- 视图表会生成 RepoView不会生成 Repository
- 非视图表会生成 Repository不会生成 RepoView
## 数据库表结构要求
### 标准表结构模板