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

时间:2023-03-08 17:34:08
ibatis mybatis sql语句配置 符号不兼容 大于号 小于号<!CDATA[ ]>

ibatis mybatis sql语句配置 符号不兼容 大于号 小于号<!CDATA[ ]>

因为这个是xml格式的,所以不允许出现类似“>”这样的字符,但是都可以使用<![CDATA[ ]]>符号进行说明,将此类符号不进行解析 
你的可以写成这个:

mapper文件示例代码<![CDATA[ when min(starttime)<='12:00' and max(endtime)<='12:00' ]]>   &lt;          < 
    &gt;          >  
    &lt;&gt;   <>
    &amp;      & 
    &apos;      '
    &quot;      "

实例:

select  to_date(to_char(tf.created_time,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') from t_ff_rt_workitem tf
where to_date(to_char(tf.created_time,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')<=to_date(to_char('2012-05-19','yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')

错误:ORA-01722:无效数字

select  to_date(to_char(tf.created_time,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') from t_ff_rt_workitem tf
where to_date(to_char(tf.created_time,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')<=to_date('2012-05-19','yyyy-mm-dd hh24:mi:ss')

0