When using mybatis, always meet all kinds of strange problems, the list goes on.
Tried-line summary of the god of various solutions, namespace, id is not on the right, did not add @Mapper comment, or does not work. Finally, go back and look at the configuration of their own projects, find mapper-locations
the path configured wrong, but small details wrong. Here is my 错误配置
:
mybatis-plus:
mapper-locations: classpath:cn.suvue.discipline.modular.mapper.mapping/*.xml
My path to the front part of the written form of the package path, certainly not right
The correct format is as follows:
mybatis-plus:
mapper-locations: classpath:cn/suvue/discipline/modular/mapper/mapping/*.xml
This is a problem I encountered my success depends on details, I hope to help you!