Mapper中sql语句不等于的表示

select from test where id<>1;

但是mybatis报错 <> 应该转义  &lt;&gt; 

select from test where id &lt;&gt; 1;


使用mybatis的时候,特殊字符,例如<,>,<>,.....

需使用以下进行转义

&lt;     < 
&gt;     >  
&lt;&gt;   <>
&amp;     & 
&apos;    '
&quot;    "


 

猜你喜欢

转载自blog.csdn.net/Thinkingcao/article/details/84026672