@MapperScan(basePackages = "com.lzc.mapper")的作用
有了@MapperScan我们就不需要在mapper包下的abcMapper接口的上面写@Mapper注解了。
@Repository是为了将Mapper接口放入了SpringIOC容器中。
@MapperScan(basePackages = "com.lzc.mapper")可以将com.lzc.mapper包下的所有mapper接口放入SpringIOC容器中。
有了@MapperScan我们就不需要在mapper包下的abcMapper接口的上面写@Mapper注解了。
@Repository是为了将Mapper接口放入了SpringIOC容器中。
@MapperScan(basePackages = "com.lzc.mapper")可以将com.lzc.mapper包下的所有mapper接口放入SpringIOC容器中。