mybatis中的#{}和${}

好比说用#{},和 ${}传参的区别:sql         使用#传入参数时,sql语句解析会自动给参数加上"",好比 select * from table where name = #{name} ,传入的name为小天,那么最后生成的sql语句就是 select * from table where name = “小天”,会当成字符串来解析,相比于$的好处是比较明显的,#{}传参可以防止
相关文章
相关标签/搜索