Mybatis if the tag judgment variable equal

两种方式:
<if test = 'sex== "Y"'>
<if test="sex=='Y'.toString()">

 

can not be used:

<if test="sex=='Y'">
  and 1=1
</if>

We will complain: for example, for input string 

Guess you like

Origin www.cnblogs.com/MrXiaoMa/p/11903964.html