因爲在mybatis框架的xml中<= , >=解析會出現問題,編譯報錯,因此須要轉譯
第一種寫法:sql
原符號 < <= > >= & ’ "
替換符號 < <= > >= & ' "
例如:sql以下:mybatis
1 unix_timestamp(target.mc_end_date)<= unix_timestamp(#{MonthEndTime});unix_timestamp(target.mc_start_date) >= unix_timestamp(#{MonthBeginTime})
第二種寫法:
大於等於框架
<![CDATA[ >= ]]>spa
小於等於unix
<![CDATA[ <= ]]>code
例如:sql以下:xml
1 mc_end_date <![CDATA[ >= ]]> #{endTime} and mc_start_date <![CDATA[ <= ]]> #{startTime}