启动类上加:
@MapperScan(value = {"com.example.demo.mapper"})
This issue has appeared in the testing of mybatis batch insert using xml file,
And I check the different with the correct configuration in the old project.
The problem is the mapperScan annotation is missing.
Then I add the mapperScan to the startup class.
The issue closed.