mybatis映射文件

xiaoxiao2021-02-28  149

1:#

是以预编译的形式放在sql文中,类似于?占位符,防止sql注入

select * from ssh1 where id=? and name=?

2:$

取出的值直接放在sql语句中,会有安全问题

select * from ssh1 where id=2 and name='carry'

在不支持占位符的地方应该使用$符号取值

比如:

select *  from $(year)_salary where XXX

转载请注明原文地址: https://www.6miu.com/read-22792.html

最新回复(0)