版权声明: https://blog.csdn.net/qq_32157851/article/details/89082421
方法一:
select *
from tbl_web where 1=1 and delete_flag = 0
<if test="Url !=null and Url !=''">and url like '%'|| #{Url} ||'%' </if>
方法二:
select *
from tbl_web where 1=1 and delete_flag = 0
<if test="Url !=null and Url !=''">and url like '%${Url}%' </if>
注:方法一可以有效的防止sql注入