resultType是sql映射文件中定义返回值类型,返回值有基本类型,对象类型,List类型,Map类型等。
resultType:
基本类型 :resultType=基本类型
List类型: resultType=List中元素的类型
Map类型 单条记录:resultType =map
多条记录:resultType =Map中value的类型
对象类型:对于对象类型resultType直接写对象的全类名就可以了
1、基本数据类型,例如int
studentMapper接口
2、List类型,返回值为List类型,resultType为List中对象的类型,如List<Student>,resultType为Student
studentMapper接口
3、Map类型,
a、返回单条记录的map,key为属性,值为属性值。resultType为map
studentMapper接口