特别注意:说明图中红圈处包含了一个特殊字符,不是空格字符,查询的时候就报错了。
select count(guid) from class where id in
<foreach collection="GuidList" index="index" item="item" open="(" close=")" separator=",">
#{item}</foreach>
将</foreach>紧跟#{item}参数,删除之间的那个特殊字符,就行了。