执行一条update语句,执行成功后返回值是 1 ,所以就理所当然的认为返回的是受影响的行数,
但是当你再次执行这条update语句时,按正常的逻辑,数据已存在,更新不会成功,应当返回 0,但是返回值依旧
是 1 (已测试过),所以返回值并不是受影响的行数,查看别人的文章,得知返回值是matched记录数(匹配到的行数)
如果想设置返回值是受影响的行数,修改数据库链接配置:增加 useAffectedRows=true 即可
参考文章:点击查看参考文章