Mybatis sql map 小于号配置

Mybatis SQL map配置中出现小于号转义时,通过<![CDATA[查询条件]]>解决。

 

EXCEMPLE:

<select id="getComments" parameterType="Pagination" resultType="CustomerComments">
  SELECT * FROM kk_customercomments
  <if test="condition != null">
    WHERE true
      <if test="condition.enddate != null">
        and <![CDATA[COMMENTSDATE <= '${condition.enddate}']]>
      </if>
  </if>
</select>

posted @ 2014-03-02 01:07  cloudyland  阅读(535)  评论(0编辑  收藏  举报