<select id="getAllMap" resultClass="hashmap">
select * from jnrj limit 0,10
</select>
JAVA代码
//第三个参数 keyProp 表示当前行记录保存在Map中的主键 一般需要用唯一值的一列标识 不然为是 null
Map map = sqlMap.queryForMap("getAllMap", null, "id");
<select id="getAllMap" resultClass="hashmap">
select * from jnrj limit 0,10
</select>
JAVA代码
//第三个参数 keyProp 表示当前行记录保存在Map中的主键 一般需要用唯一值的一列标识 不然为是 null
Map map = sqlMap.queryForMap("getAllMap", null, "id");
转载于:https://my.oschina.net/asilan/blog/634105