本文共 225 字,大约阅读时间需要 1 分钟。
从service 传入参数name=123;
select name,id from table where name = #{name}--->解析后select name,id from table where name='123'
而${name} 会被解析成 select name,id from table where name=123;
#{}防止了sql注入的问题,如果在动态排序可以用${},这里大致的讲解一下,还有不懂的可以私聊我
转载地址:http://fqvbi.baihongyu.com/