首页 > 技术文章 > mybatis mapper.xml的特殊操作符

meituan 2019-04-26 17:22 原文

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;    "

推荐阅读