Skip to content

Commit

Permalink
‘下划线转驼峰策略,字段不做注解处理’
Browse files Browse the repository at this point in the history
  • Loading branch information
qmdx committed Sep 25, 2021
1 parent bc7e448 commit 6bc0756
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

[官方文档](https://baomidou.com)

[Mybatis-Plus](https://gitee.com/baomidou/mybatis-plus)

[企业版 Mybatis-Mate 高级特性](https://gitee.com/baomidou/mybatis-mate-examples)

### 安装

``` xml
Expand All @@ -8,7 +15,7 @@
</dependency>
```

### 使用(存在对历史版本的不兼容
### 使用(以下教程仅适用 3.5.1 以上版本,对历史版本的不兼容

#### 快速生成

Expand Down Expand Up @@ -194,7 +201,8 @@ new InjectionConfig.Builder()
| ------------------------- | ------------------------ | ----------------------------------------------------------------- |
| enableCapitalMode | 开启大写命名 | 默认值:false |
| enableSkipView | 开启跳过视图 | 默认值:false |
| disableSqlFilter | 禁用 sql 过滤 | 默认值:true,语法不能支持使用 sql 过滤表的话,可以考虑关闭此开关. |
| disableSqlFilter | 禁用 sql 过滤 | 默认值:true,语法不能支持使用 sql 过滤表的话,可以考虑关闭此开关 |
| enableSchema | 启用 schema | 默认值:false,多 schema 场景的时候打开 |
| likeTable(LikeTable) | 模糊表匹配(sql 过滤) | likeTable 与 notLikeTable 只能配置一项 |
| notLikeTable(LikeTable) | 模糊表排除(sql 过滤) | likeTable 与 notLikeTable 只能配置一项 |
| addInclude(String...) | 增加表匹配(内存过滤) | include 与 exclude 只能配置一项 |
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ext {
]

libraries = [
mybatisPlusVersion = '3.4.3.2',
mybatisPlusVersion = '3.4.3.4',
junitVersion = '5.6.2',
]

Expand Down Expand Up @@ -49,16 +49,16 @@ ext {
"firebird" : "org.firebirdsql.jdbc:jaybird:4.0.1.java8",
//code generator
"mybatis-plus" : "com.baomidou:mybatis-plus:${mybatisPlusVersion}",
"velocity" : "org.apache.velocity:velocity-engine-core:2.2",
"freemarker" : "org.freemarker:freemarker:2.3.30",
"beetl" : "com.ibeetl:beetl:3.2.1.RELEASE",
"velocity" : "org.apache.velocity:velocity-engine-core:2.3",
"freemarker" : "org.freemarker:freemarker:2.3.31",
"beetl" : "com.ibeetl:beetl:3.7.0.RELEASE",
"swagger-annotations" : "io.swagger:swagger-annotations:1.6.2",
]
}

allprojects {
group = 'com.baomidou'
version = "3.5.0"
version = "3.5.1"
}

description = "Mybatis 增强工具包 - 只做增强不做改变,简化CRUD操作"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ public TableField(@NotNull ConfigBuilder configBuilder, @NotNull String name) {
* @return this
* @since 3.5.0
*/
//TODO 待调整.
public TableField setPropertyName(@NotNull String propertyName, @NotNull IColumnType columnType) {
this.columnType = columnType;
if (entity.isBooleanColumnRemoveIsPrefix()
&& "boolean".equalsIgnoreCase(this.getPropertyType()) && propertyName.startsWith("is")) {
this.convert = true;
this.propertyName = StringUtils.removePrefixAfterPrefixToLower(propertyName, 2);
return this;
} else {
} else if(this.entity.getColumnNaming() != NamingStrategy.underline_to_camel) {
// 非下划线转驼峰策略,判断是否一致
this.convert = !propertyName.equalsIgnoreCase(this.columnName);
}
if (entity.isTableFieldAnnotationEnable()) {
Expand Down

0 comments on commit 6bc0756

Please sign in to comment.