Mybatis在Springboot中字段映射驼峰问题

如果映射失败只能查到id等和数据库字段名字一样的数据,其他数据是null

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: 123456
    url: jdbc:mysql://127.0.0.1:3306/mall?characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
mybatis:
  configuration:
    map-underscore-to-camel-case: true

就是开启这个就行了

mybatis:
  configuration:
    map-underscore-to-camel-case: true

你可能感兴趣的:(Mybatis在Springboot中字段映射驼峰问题)