针对只查询一列,但是该列可能有多条记录时,用queryForList(sqlstring,null)
<select id="getRunningDpuId" resultClass="java.lang.String">
select dpu_id from vee_log lg where lg.wcsj is null
</select>
这样,返回的是一个List<Object>, 内容如:["HELLO","KITTY"].
ibatis中使用in,假如没创建java实体类作为传入参数,只是使用hashMap<String,Object>,那么也是可以将List类型加入到hashMap中,在写sql时,
<iterate prepend="in" open="(" close=")" property="hashMapKey" conjunction=",">
#hashMapKey[]#
</iterate>