錯誤信息如下:
org.xml.sax.SAXParseException;在實體引用中, 實體名稱必須緊跟在 ‘’&’’ 后面
出現這個錯誤的原因是在xml中使用&,實際上xml中不支持這種方式,&其實是並列的意思,如果要在xml中使用&,需要將其改為英文 and才能使用。
問題代碼:
<select id="categoreListInfo" resultMap="BaseResultMap"> SELECT term.term_id,term.name, term.slug,tax.taxonomy,tax.description,tax.count FROM wp_terms AS term LEFT JOIN wp_term_taxonomy AS tax ON(term.term_id=tax.term_id) <where> <if test="name != null & name != ''"> and term.name like concat('%', #{name}, '%') </if> <if test ="taxonomy != null & taxonomy !=''"> and tax.taxonomy = #{taxonomy} </if> </where> limit #{start},#{size} </select>
將代碼中的&條件改為and即可
參考資料:
【java】org.xml.sax.SAXParseException;在實體引用中, 實體名稱必須緊跟在 ‘&’ 后面。解決方法:https://blog.csdn.net/demon_ll/article/details/78542356