1. 程式人生 > 其它 >Mybatis在XML中寫SQL比較運算子<=時報錯解決方法

Mybatis在XML中寫SQL比較運算子<=時報錯解決方法

技術標籤:MyBatismybatisjavaxml

問題描述

在這裡插入圖片描述

解決

  <select id="selectStockWarning" resultType="java.lang.Integer">
   select COUNT(id)
   from mall_stock
   where deleted = 0 and <![CDATA[`number` <= `warning`]]>
  </select>

將表示式放在 <![CDATA[表示式]]>中