sql注入是我们极力避免的,如果mybatis需要模糊查询,建议使用以下语法。可以避免sql注入问题。
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'%','\%')),'%')
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'_','\_')),'%')
mysql防止注入的模糊查询
阅读 87
2022-03-11
sql注入是我们极力避免的,如果mybatis需要模糊查询,建议使用以下语法。可以避免sql注入问题。
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'%','\%')),'%')
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'_','\_')),'%')
相关推荐
精彩评论(0)