Caused by: org.xml.sax.SAXParseException: 元素内容必须由格式正确的字符数据或标记组成。
错误原因:mybatis查询的时候,需要用到运算符 小于号:<
和 大于号: >
,在mybatis配置文件里面,这种会被认为是标签,所以解析错误
错误事例:
select
<include refid="Base_Column_List" />
from t_time_interval where
status <> 99
and time_intvl_id >=29 and time_intvl_id <=45
order by time_intvl_id
解决方法:
select
<include refid="Base_Column_List" />
from t_time_interval where
<![CDATA[ status <> 99
and time_intvl_id >=29 and time_intvl_id <=45
order by time_intvl_id]]>
参考:
https://blog.csdn.net/moneyshi/article/details/48024113
https://blog.csdn.net/Hello_World_QWP/article/details/86513179