Mybatis踩坑记录(where xx in(?)参数问题)

Mybatis踩坑记录(where id in(?)参数问题)

先看原来的代码
Mybatis踩坑记录(where xx in(?)参数问题)
第二条语句由于只传了一个参数,所以就用**${value}**接收

整合之后
Mybatis踩坑记录(where xx in(?)参数问题)
自我感觉没问题,然后,问题就来了Mybatis踩坑记录(where xx in(?)参数问题)

控制台输出的SQL语句我感觉没问题啊,可为什么 Total = 1 ???
折腾好一会儿才发现是 #{ids} 和 **${ids}**的问题
Mybatis踩坑记录(where xx in(?)参数问题)
Mybatis踩坑记录(where xx in(?)参数问题)

where xx in()的时候,参数不能用 #{} 要用**${}**