事例发生在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>