问题:'getBaseMapper()' in 'com.baomidou.mybatisplus.extension.service.impl.ServiceImpl' clashes with 'getBaseMapper()' in 'com.baomidou.mybatisplus.extension.service.IService'; attempting to use incompatible return type
错误原因:ServiceImpl<M,T>泛型传递的参数的类型与Mapper层继承的MP中BaseMapper<T>的泛型参数的数据类型不同所导致的
我们具体看一下ServiceImpl类:
可以发现BaseMapper<T>泛型的数据类型应和ServiceImpl<...,T>的数据类型一样
解决方法:
看一下自己的Mapper中的BaseMapper<>中泛型的数据类型是否和ServiceImpl中泛型的数据类型一样,不一样的话修改和BaseMapper<>一样的即可。