The processing method of mybatis in the xml file is greater than and less than the number

the first method:

Replace > and < with escape characters 

 

SELECT * FROM test WHERE  length_min <= 1 AND length_max >= 10

P.S. XML escape characters

 

                     <                                 

                     <

                     Less than sign                                           

                     >

                     >        

                     greater than sign

                     &

                     &

                     and

                     '

                     ’

                     apostrophe

                     "

                     "

                     Double quotes

 

The second method:

 

 

Because this is in xml format, characters like ">" are not allowed, but they can be described with the <![CDATA[ ]]> symbol. If such symbols are not parsed 
, you can write this: 

mapper file sample code
<![CDATA[  count_min < 1 ) ]]>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326693060&siteId=291194637
Recommended