方案1

<if test="projectName!=null and projectName!=''">
       <bind name="projectName_" value="'%'+projectName+'%'"/>
       AND info.name like #{projectName_}
</if>

方案2

<if test="projectName!=null and projectName!=''">
       AND info.name like concat('%',#{projectName_},'%')
</if>



原文链接:https://blog.csdn.net/qwdafedv/article/details/80068144