用mybaits的resultMap查询数据时,为什么只能返库的最后一条数据


select
tb_item.*,
tb_item_pic.id as itemPic_id,
tb_item_pic.item_id,
tb_item_pic.url
from tb_item,
tb_item_pic
where
tb_item.id=tb_item_pic.item_id
and
tb_item.id
in
open="(" separator="," close=")">
#{ids}


这个是定义的resultMap





















这个是mapper.java中的方法
public List selectItemAndPic(Integer []ids) throws Exception;

缺很多东西啊,看不出来问题。你手动执行一下你这SQL,查出来几条数据

你把代码补全吧,大片空白真不知道你写的什么

Integer []ids传入数组?你确定么。另外,建议返回写成List<你要的类型>。
先在外面执行SQL语句,再写入到mapper中

代码再贴的多一点,这样比较容易找问题所在。。

提问题专业点,将问题描述清楚。