Mybatis 中 in 语法 的# 与 $区别

今天写map时,(伪代码):update xxx t set t.a='1' where id in (#{ids}); 当ids传入为string 1,2,3 时,得出效果只是更新了id=1的数据,原来#{xxx}是一个字符串,mybatis只会当他是一个值,若是你想达到字面上的效果: 1 用${ids} 把ids当成字符串传进来 2 update xxx t set t.a='1' where
相关文章
相关标签/搜索