ibatis mybatis sql语句配置 符号不兼容 大于号 小于号

在mybatis中对sql语句中涉及到大于号,小于号,如何操作:

方法一、

将其放入到]]>标签中

如:

 to_date(#{startDateTime},'yyyy-mm-dd hh24:mi:ss')
       and mm.ttime <= to_date(#{endDateTime},'yyyy-mm-dd hh24:mi:ss')
]]>

方法二、

如果是在动态语句中,则需要转换

如:

  and mm.ttime > to_date(#{startDateTime},'yyyy-mm-dd hh24:mi:ss')
  and mm.ttime <= to_date(#{endDateTime},'yyyy-mm-dd hh24:mi:ss')


符号:

    <          < 
    >          >  
    <>   <>
    &      & 
    '      '
    "      "


你可能感兴趣的:(MyBatis)