1、xml文件中的resultType都指定为HashMap:
-
select
-
iid.username,age,password
-
from sys_user
-
where id=#{id,jdbcType=VARCHAR}
-
-
select
-
iid.username,age,password
-
from sys_user
-
where id=#{id,jdbcType=VARCHAR}
修改interface增加两个接口方法,
-
List selectListMap(String id);
-
Map selectMap(String id);
总结: 两者在xml里面的resulttype均指定为hashmap,但interface里面,则一个是返回map,一个是返回list.