mybatis 的#与$
#:1、例子:sql语句为:SELECT NAME FROM student_table WHERE id = #{id}
传入的 id = 1,则sql语句为:SELECT NAME FROM student_table WHERE id = "1"
2、作用:防止sql注入,迅速
$:1、例子:sql语句为:ORDER BY ${name}
传入的name = age ,则 ORDER BY age;
纯如的name = 1 , 则ORDER BY 1;
ORDER BY 语句时用 $
防sql注入:1)参数化sql语句 2)参数化存储过程 3)添加新的数据库架构