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配置参数

 

posted @ 2020-03-25 09:24  如幻行云  阅读(364)  评论(0编辑  收藏  举报