mybatis配置文件,sql語句中含有轉義字符:
錯誤語句:
select * from table_base where flag_topic & #{topic_num}
錯誤信息:
Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 54; The entity name must immediately follow the '&' in the entity reference.
正確語句:
select * from table_base where flag_topic & #{topic_num}
將語句中的位運算(與)”&“符使用“&”替換
mybatis配置文件寫SQL語句的某些字符需要轉義:
< <
> >
<> <>
& &
' '
" "
注意:要加上分號!