MyBatis注解版使用
1.导入依赖
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
2.创建mapper层
package com.sell.dataobject.mapper;
import com.sell.dataobject.ProductCategory;
import org.apache.ibatis.annotations.*;
import java.util.Map;
public interface ProductCategoryMapper {
@Insert("insert into product_category(category_name,category_type) values(#{category_name,jdbcType=VARCHAR},#{category_type,jdbcType=INTEGER})")
int insertByMap(Map&l