Mybatis转义字符

时间:2023-03-09 03:14:49
Mybatis转义字符

Mybatis的sql语句中需要用到'>'或者'<'时,不能直接使用。

&lt;      <    小于号
&gt; > 大于号
&amp; & 和
&apos; ' 单引号
&quot; '' 双引号

例如查询汽车价格小于一万元的语句

select * from car where car_price_new &lt; 

另外,使用like语句

查询订单中name的like语句

 select * from orderEntity where order_name like  CONCAT('%-',#{value},'-%')