In mybatis, a number greater than, less than the number, and the SQL editor are not the same.
SELECT * FROM test WHERE 1 = 1 AND start_date <= CURRENT_DATE AND end_date> = CURRENT_DATE no problem,
however, when executed mybaits, the total error message:
Error Creating Document instance the Cause: org.xml.sax.SAXParseException; the lineNumber.: 74; columnNumber: 17; the element content must be properly formatted character data or of the marking.
The AND start_date> = CURRENT_DATE AND end_date < = CURRENT_DATE removed, there is no problem because the problem is so determined number is greater than, less than the number caused.
So I think of the special symbols, so with the escape character to> and <replaced, then there is no problem.
SELECT * FROM test WHERE 1 = 1 AND start_date & lt; = CURRENT_DATE AND end_date & gt; = CURRENT_DATE
Annex: XML escape character
& lt; <smaller than the number
& gt;> greater than sign
& amp; & and
& apos; 'single quotes
& quot; "double quotes
said xml: <= Less than or equal to> = greater than or equal need to add this tag: <! [CDATA []]> <! [CDATA [&]]> There & xml symbols representing & need
Attached: XML escape character
<= Less than or equal to: <[CDATA [<=]]>!
> = Greater than or equal to: <[CDATA [> =]]>!
Original Address: https: //www.cnblogs.com/azhqiang/p/6297530.htmlIn mybatis, a number greater than, less than the number, and the SQL editor are not the same.
SELECT * FROM test WHERE 1 = 1 AND start_date <= CURRENT_DATE AND end_date> = CURRENT_DATE no problem,
however, when executed mybaits, the total error message:
Error Creating Document instance the Cause: org.xml.sax.SAXParseException; the lineNumber.: 74; columnNumber: 17; the element content must be properly formatted character data or of the marking.
The AND start_date> = CURRENT_DATE AND end_date < = CURRENT_DATE removed, there is no problem because the problem is so determined number is greater than, less than the number caused.
So I think of the special symbols, so with the escape character to> and <replaced, then there is no problem.
SELECT * FROM test WHERE 1 = 1 AND start_date & lt; = CURRENT_DATE AND end_date & gt; = CURRENT_DATE
Annex: XML escape character
& lt; <smaller than the number
& gt;> greater than sign
& amp; & and
& apos; 'single quotes
& quot; "double quotes
said xml: <= Less than or equal to> = greater than or equal need to add this tag: <! [CDATA []]> <! [CDATA [&]]> There & xml symbols representing & need
Attached: XML escape character
<= Less than or equal to: <[CDATA [<=]]>!
> = Greater than or equal to: <[CDATA [> =]]>!
Original Address: https: //www.cnblogs.com/azhqiang/p/6297530.html