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
相關文章
相關標籤/搜索