mybatis大于小于的转义

最近在使用mybatis,然后用到了小于等于,直接在XML中使用了<=,结果XML文件一直显示红色错误,如下:

sum(case when p.pool_year <= '2014' then p.pool_rmb else 0 end) as "one",

猜想可能是由于特殊字符的缘故,于是用了转义字符进行了替换了,如下:

sum(case when p.pool_year &lt;= '2014' then p.pool_rmb else 0 end) as "one",

记录下来,防止以后出错。
xml中常用转义字符:

  • &lt; < 小于号
  • &gt; > 大于号
  • &amp; & 和
  • &apos; '单引号
  • &quot; "双引号
原文地址:https://www.cnblogs.com/xieshuang/p/5848161.html