TEST
In the XML map SQL file, in many cases will use the greater than, less than the special symbols, such as, if you do not control is not compiled through, this time need to use the <![ cdata[]]> symbols are described, and the symbols are not parsed, In fact, this problem is not only common in mybatis, but it is common to any XML file used, such as Hibernate, Wabacus, spring, etc. in the configuration file, as long as the XML file is the line, such problems in the future work, often used.
Case code
<select id= "findallkiaanalysisbycondition" parametertype= "map" resulttype= "kiaanalysis" >select * FROM (SELECT Unitname, To_char (rdate, ' yyyy-mm ') Rdate,keytype, scope from kiaanalysis<where><if test= ' startDate!= '%null% "' > and Rdate >= to_date (#{startdate}, ' yyyy-mm ') </if><if test= ' enddate!="%null% "' ><strong> <span style= "color: #3333ff;" ><! [Cdata[</span><span style= "color: #3366ff;" > </span></strong>and rdate <= to_date (#{enddate}, ' yyyy-mm ') <span style= "color: #3333ff;" ><strong>]]></strong></span></if><if test= ' unitname!= "%null%" ' >and unitname= #{unitname}</if></where>) Pivot (sum (scope) for KeyType in (${themes})) </select>
TEST
MyBatis and Ibatis Dynamic SQL statement configuration symbols, incompatible with special symbol issues such as greater than sign, less than sign X