为什么这个<where>标签中的条件status=3不执行?(语言-java)mysql

为啥这里的status=3不执行,在输入值为空的时候还是显示出了status值不为3的数据

img

代码写的有问题,参照以下写法:


    <where>
        status=3
      <if test="name!=null and name!=''">
        and name  LIKE concat('%',#{name},'%')
      </if>
    </where>

若有帮助,谢谢采纳~

img


name like concat('%',#{name},'%')

抱歉了大伙儿,是我servlet里写错了,已经解决了

status = 3后边的分号删掉,然后if里边的那个status = 3和外边的写重复了