Mybatis中传递参数时,会加上引号

时间:2020-02-08 10:48:42   收藏:0   阅读:933

当参数需要加上引号的时候,用#{}。  

例:select * from user_user where name= #{name}   

SQL:select * from user_user where name= "name"

 

当参数不需要加上引号的时候,用${}

例:select * from user_user order by ${id} 

 SQL:select * from user_user order by id

原文:https://www.cnblogs.com/WINTER-KING/p/12275131.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!