我的原因是如下的"#{username}" 把双引号去掉就可以 我加双引号的原因是用MyBatisCodeHelper-Pro 测试代码不通过随即加个双引号通过测试,随即从页面传来值再查询时出现此bug
<where>
<if test="username != null and username != ''">
a.username LIKE CONCAT('%',"#{username}",'%')
</if>
<if test="phone != null and username != ''">
OR a.phone LIKE CONCAT('%',"#{username}",'%')
</if>
<if test="email != null and username != ''">
OR a.email LIKE CONCAT('%',"#{email}",'%')
</if>
</where>