When passing parameters Mybatis, the quotes will be added

When the parameters requires quotes, with a # {}.  

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

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

 

When the parameter does not require quotation marks, by $ {}

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

 SQL:select * from user_user order by id

Guess you like

Origin www.cnblogs.com/WINTER-KING/p/12275131.html