问题:
mapper需要写如下的sql语句:
select * from A where A.id <> 1
写过mapper文件的应该都知道,在mapper中是不能直接这么些。
解决方法
1、转义
<——小于号
>——大于号
< > ——不等于
select * from A where A.id <> 1
2、使用<![CDATA[]]>
<![CDATA[]]>这个标记所包含的内容将表示为纯文本。
select * from A where A.id <![CDATA[<>]]> 1
所有评论(0)