MyBatis: Mapper中方法定义多个参数要加@Param(“xxx“)注解

package tju.MyBtsBasic.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import tju.MyBtsBasic.domain.Season;

public interface XinwenMapper {
	@Insert("insert into xinwen(content,happenSeason,reportSeason) values(#{content},#{happenSeason},#{reportSeason})")
	//@Insert("insert into xinwen values(null,#{content},#{happenSeason},#{reportSeason})")
	int addXinwen(@Param("content") String content,@Param("happenSeason") Season happenSeason,@Param("reportSeason")Season reportSeason);

}

你可能感兴趣的:(MyBatis)