BaseMapper使用报错
错误场景:
解决方法:
@Select、@Insert、@Update、@Delete注解代替xxxMapper.xml里面的内容,不存在异常,那就是扫描xxxMapper.xml文件的问题了,检查 application.yml 里面的配置
mybatis-plus:
type-aliases-package:
mapper-locations: classpath:********/mapper/*Mapper.xml
global-config:
refresh-mapper: true
#驼峰下划线转换
column-underline: true
configuration:
map-underscore-to-camel-case: true
我的解决:
@Mapper
public interface XXXX extends BaseMapper<T> {
/**
* 查询所有
*
* @return
*/
@Select("SELECT * FROM T")
public List<T> querAllSuperWallets();
@Insert("INSERT INTO T" +
" (xxx," +
" xxx," +
" xx," +
" xx," +
" xx)" +
"VALUES (#{xx}," +
" #{xx}," +
" #{xx}," +
" #{xx}," +
" #{xx});")
int insertWallet(T t);
总结:
能解决就好,不要嫌麻烦,慢慢来不要灰心!加油。。。看客