MySQL中大於等於小於等於的寫法

因爲在mybatis框架的xml中<= , >=解析會出現問題,編譯報錯,因此須要轉譯
第一種寫法:sql

原符號 < <= > >= & ’ "
替換符號 &lt; &lt;= &gt; &gt;= &amp; &apos; &quot;
例如:sql以下:mybatis

1 unix_timestamp(target.mc_end_date)&lt;= unix_timestamp(#{MonthEndTime});unix_timestamp(target.mc_start_date) &gt;= unix_timestamp(#{MonthBeginTime})

第二種寫法:
大於等於框架

<![CDATA[ >= ]]>spa

小於等於unix

<![CDATA[ <= ]]>code

例如:sql以下:xml

1 mc_end_date <![CDATA[ >= ]]> #{endTime} and  mc_start_date <![CDATA[ <= ]]> #{startTime}
相關文章
相關標籤/搜索