1. With @Mapper, there is no need to set the scan address in the Spring configuration. Spring will dynamically generate beans and inject them into ServiceImpl through the namespace attribute in mapper. XML corresponding to the related Mapper class.

2, @Repository needs to configure the scan package address in Spring, and then generate DAO layer beans, and then injected into the ServiceImpl @Repository annotation to modify the class, which indicates that this class has CRUD (add, delete, modify and search) function. And @Repository is a derivative of the @Component annotation, so classes with the @Repository annotation can be automatically found by @ComponentScan via a path scan. (This helps explain why classes annotated by @Repository can also be @Autowired)