Skip to content

Commit 79291d4

Browse files
committed
增加 application.properties 配置示例
1 parent 2076ff9 commit 79291d4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,26 @@ pagehelper:
5151
params: count=countSql
5252
```
5353
54+
## application.properties 配置
55+
因为使用这种方式的人多,为了避免部分人看不懂上面的配置方式,这里提供 properties 方式的配置
56+
```properties
57+
#mybatis
58+
mybatis.type-aliases-package=tk.mybatis.springboot.model
59+
mybatis.mapper-locations=classpath:mapper/*.xml
60+
61+
#mapper
62+
#mappers 多个接口时逗号隔开
63+
mapper.mappers=tk.mybatis.springboot.util.MyMapper
64+
mapper.not-empty=false
65+
mapper.identity=MYSQL
66+
67+
#pagehelper
68+
pagehelper.helperDialect=mysql
69+
pagehelper.reasonable=true
70+
pagehelper.supportMethodsArguments=true
71+
pagehelper.params=count=countSql
72+
```
73+
5474
注意 mapper 配置,因为参数名固定,所以接收参数使用的对象,按照 Spring Boot 配置规则,大写字母都变了带横线的小写字母。针对如 IDENTITY(对应i-d-e-n-t-i-t-y)提供了全小写的 identity 配置,如果 IDE 能自动提示,看自动提示即可。
5575

5676
注意 pagehelper 配置,因为分页插件根据自己的扩展不同,支持的参数也不同,所以不能用固定的对象接收参数,所以这里使用的 `Map<String,String>`,因此参数名是什么这里就写什么,IDE 也不会有自动提示。

0 commit comments

Comments
 (0)