- Check the jar is not the introduction of conflict
- Check the scan path Mapper.java
- Check the namespace is normal? Check the package scan path typeAliasesPackage is normal? If not scan, MP can not be pre-injection
- Check if the primary key? If not specified, will lead selectById related ID does not work, please use the comment @TableId comment table ID primary key. Of course @TableId annotation can not! 5. But your primary key must be called id (ignore case)
- Do not use the native SqlSessionFactory, use MybatisSqlSessionFactory
I am a fifth solved