When using MyBatis, special characters such as <,>,<>,.....
You need to escape using the following
< |
< |
Less than sign |
> |
> |
Greater than sign |
& |
& |
And |
' |
‘ |
Single quotation marks |
" |
" |
Double quotes |
<SelectID= "Selectbyexampleext"ParameterType= "Com.cn21.redisCluster.model.AppInfoExampleExt"Resultmap= "Baseresultmapext">Select temp.*,r.* from (select A.* from AppInfo as a where 1=1<ifTest= "AppID ! = null and AppID! =" ">and A.appid=#{appid,jdbctype=varchar}</if> <ifTest= "ProductID! = NULL">and A.productid=#{productid,jdbctype=integer}</if>ORDER by A.lastupdatetime DESC<ifTest= "limitstart>=0 and limit>0"> (here is a similar <if test= "limitstart>=0 and limit>0"> )LIMIT ${limitstart}, ${limit}</if> <ifTest= "Limitstart==-1 and limit>0">LIMIT ${limit}</if>) Temp,redisdb r where Temp.appid = R.appid</Select>
MyBatis Special Character escapes