首先,记录一下springboot整合mybatis的使用:
pom.xml:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.2.0</version>
</dependency>
建立mapper类:
package com.xt.sell.dataobject.mapper;
import com.xt.sell.dataobject.ProductCategory;
public interface ProductCategoryMapper {
ProductCategory selectByCategoryType(Integer categoryType);
}
建立对应的xml文件:
文件路径在resource目录下:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper