mybatis #与$区别

你的名字 2022-03-30 09:21 448阅读 0赞

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;

发表评论

表情:
评论列表 (有 0 条评论,448人围观)

还没有评论,来说两句吧...

相关阅读