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


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

例: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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM