xml解析出错

前端之家收集整理的这篇文章主要介绍了xml解析出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

事例发生在mybitas中写sql的时候sql语句不通过。 在对应的sql添加

<![CDATA[

sql语句

]]>

即可。


注意,包括的范围中不要出现标签,会被解析成普通文本


eg:


<![CDATA[

SELECT

ubi.nick_name,ubi.sex,ubi.user_id,ubi.avatar,ubi.birthday,uba.phone,f.remark,f.state,

6378.137*ACOS(ACOS(#{lat}*pi()/180)*cos(up.lat*pi()/180)*cos(#{lon}*pi()/180-up.lon*pi()/180)+sin(#{lat}*pi()/180

)*sin(up.lat*pi()/180)) as

distance

FROM

t_user_basic_info AS ubi,

t_user_base_account AS uba,

t_friend AS f,

t_user_position AS up

WHERE

ubi.user_id=f.friend_id AND uba.user_id=f.friend_id AND

up.user_id=f.friend_id and

6378.137*ACOS(ACOS(#{lat}*pi()/180)*cos(up.lat*pi()/180)*cos(#{lon}*pi()/180-up.lon*pi()/180)+sin(#{lat}*pi()/180)*sin(up.lat*pi()/180))<50

and f.user_id=1111 order by

distance asc

]]>

<if test="begin != null">

limit #{begin},#{end}

</if>

猜你在找的XML相关文章