可能是因为在项目中存在其他的配置文件覆盖了mybatis-config.xml中的配置。可以尝试在其他配置文件中添加以下配置来关闭自动驼峰命名转换:

<mybatis.configuration>
  <settings>
    <setting name="mapUnderscoreToCamelCase" value="false"/>
  </settings>
</mybatis.configuration>

或者在Spring配置文件中使用MybatisPlusInterceptor来关闭自动驼峰命名转换:

<bean id="mybatisPlusInterceptor" class="com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor">
  <property name="overflow" value="false"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  <property name="dataSource" ref="dataSource"/>
  <property name="mapperLocations" value="classpath*:mapper/*.xml"/>
  <property name="configLocation" value="classpath:mybatis-config.xml"/>
  <property name="plugins">
    <list>
      <ref bean="mybatisPlusInterceptor"/>
    </list>
  </property>
</bean>
``
spring43+mybatis-plus 去掉自动驼峰设置在mybatis-configxml中添加如下配置来去掉自动驼峰设置:xmlconfiguration settings !-- 关闭自动驼峰命名转换 -- setting name=mapUnderscoreToCamelCase value=false settingsconfiguration没有生效

原文地址: https://www.cveoy.top/t/topic/f6yP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录