mybatis #与$区别

mybatis #与$区别

#{}变量解析到SQL有带引号字符串;如查询条件变量
如:select * from user where name = #{name};
为:select * from user where name = 'Jack';

${}变量解析到ORACLE是没带引号的字符串;如表前缀

如:select * from ${}.user where name 1=1;

为:select * from TABLEPER.user where name 1=1;

posted @ 2017-02-20 20:05  jenson138  阅读(245)  评论(0编辑  收藏  举报