MyBatis中传入参数parameterType

本文章转载:https://cloud.tencent.com/developer/article/1455806

Mybatis的Mapper文件中的select、insert、update、delete元素中有一个parameterType属性,用于对应的mapper接口方法接受的参数类型。

1.MyBatis的传入参数parameterType类型分两种
1.1基本数据类型:int,string,long,Date;
1.2复杂数据类型:类和Map

2.如何获取参数中的值:
2.1 基本数据类型:#{参数} 获取参数中的值
2.2 复杂数据类型:#{属性名} ,map中则是#{key}

猜你喜欢

转载自www.cnblogs.com/YoungLiu/p/12324878.html