0
点赞
收藏
分享

微信扫一扫

若依项目整合mybatisplus

1、导入依赖

<dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.4.1</version>
        </dependency>

2、在yml里配置注释mybatis配置和framwork中config中mybatisconfig的注解,并添加一下配置

mybatis-plus:
  #扫描mapper文件所在位置
  mapper-locations: classpath*:mapper/**/*Mapper.xml
  #可以指定实体类所在包路径
  typeAliasesPackage: com.ruoyi.**.domain
  global-config:
    banner: false
    db-config:
      # 主键类型 0:数据库ID自增 1.未定义 2.用户输入 3 id_worker 4.uuid 5.id_worker字符串表示
      id-type: AUTO
      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
      field-strategy: NOT_NULL
      # 默认数据库表下划线命名
      table-underline: true
#  configuration:
#    map-underscore-to-camel-case: false
#    cache-enabled: true #配置的缓存的全局开关
#    lazyLoadingEnabled: true #延时加载的开关
#    multipleResultSetsEnabled: true #开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用

3、正常替换为了mybatisplus了

举报

相关推荐

0 条评论