Spring boot整合通用mapper
通用mapper可以实现自动凭借SQL语句,简化代码量。
首先在pom.xml文件中添加依赖:
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>
在mapper类中继承通用mapper:
package com.dsr.mapper;
import com.dsr.dao.Admin;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.spring.annotation