MyBatis-Plus 入门
一、基础
1. 保存记录,主键回显
2. 更新记录,实体中字段有值就更新
3. 分页查询
4. Service CRUD接口返回值为空对象,不会为null,我们逻辑可以省略判断;
二、application.yml配置
mybatis-plus: global-config: db-config:
# 全局主键类型 id-type: auto configuration:
# 是否开启下划线转驼峰规则映射 map-underscore-to-camel-case: true
# mapper xml配置文件路径 mapper-locations: classpath*:mapper/*.xml
# 直接使用类名,而非全限定类名 type-aliases-package: ${application.base-package}.entity
可参考:Mybatis-Plus配置参数