In mybatis mapping file, if tags determine the strings are equal, in two ways:
Because mybatis mapping file is an ognl expression used, when judging whether the string sex variable is string Y,
<if test="sex=='Y'.toString()"><if test = 'sex== "Y"'>Note: You cannot use <if test="sex=='Y'">and 1=1</if>
Because mybatis will parse 'Y' into characters, and java is a strongly typed language, it cannot be written like this.
Summarize
The above are two ways to determine the equality of strings in the mybatis mapping file that the editor introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to Wulin.com website!