sql注入是我们极力避免的,如果mybatis需要模糊查询,建议使用以下语法。可以避免sql注入问题。
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'%','\%')),'%')
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'_','\_')),'%')
微信扫一扫
sql注入是我们极力避免的,如果mybatis需要模糊查询,建议使用以下语法。可以避免sql注入问题。
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'%','\%')),'%')
AND ur.routeName LIKE concat(concat('%',REPLACE(#{routeName},'_','\_')),'%')
相关推荐