@Mapper

Xxxmapper. XML is used to implement this Mapper. This happens when the Server layer uses the @AutoWired annotation, but it doesn’t affect usage.

@Repository

The @repository annotation is a Spring annotation. With this annotation and the @autowired annotation, there will be no viral hits for the simple reason that the @repository annotation is an Sring annotation that registers the current class as a bean. The diagram below:

You can get rid of the @Mapper here, but you have to put it on the startup class

@MapperScan(value = {"com.bf.spring4.mapper"})
Copy the code

Scan the Mapper class.