mybatis 中站位符 #{};
example: select * from user where id=' #{id}
mybatis 中的字符串拼接 ${}
example: select * from user where name ='%${小明}%'
使用${} 可能导致sql注入
${}传入简单类型是 只能使用value 即 ${value}
版权声明:本文为qq_21586623原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
mybatis 中站位符 #{};
example: select * from user where id=' #{id}
mybatis 中的字符串拼接 ${}
example: select * from user where name ='%${小明}%'
使用${} 可能导致sql注入
${}传入简单类型是 只能使用value 即 ${value}