|
@@ -14,12 +14,7 @@
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
)) distance
|
|
)) distance
|
|
from `merchant` mt
|
|
from `merchant` mt
|
|
- <where>
|
|
|
|
- <if test="region > 0">
|
|
|
|
- mt.region = #{region}
|
|
|
|
- </if>
|
|
|
|
- and mt.status = 'ONLINE'
|
|
|
|
- </where>
|
|
|
|
|
|
+ where mt.region = #{param.region} and mt.status = 'ONLINE'
|
|
order by distance asc limit #{size}
|
|
order by distance asc limit #{size}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -29,12 +24,7 @@
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
)) distance
|
|
)) distance
|
|
from `merchant` mt
|
|
from `merchant` mt
|
|
- <where>
|
|
|
|
- <if test="region > 0">
|
|
|
|
- mt.region = #{region}
|
|
|
|
- </if>
|
|
|
|
- and mt.status = 'ONLINE' and mt.recommend = 1
|
|
|
|
- </where>
|
|
|
|
|
|
+ where mt.region = #{param.region} and mt.status = 'ONLINE' and mt.recommend = 1
|
|
order by distance asc limit #{size}
|
|
order by distance asc limit #{size}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -58,10 +48,7 @@
|
|
<if test="param.offset != null">
|
|
<if test="param.offset != null">
|
|
mt.id > #{param.offset}
|
|
mt.id > #{param.offset}
|
|
</if>
|
|
</if>
|
|
- <if test="region > 0">
|
|
|
|
- and mt.region = #{region}
|
|
|
|
- </if>
|
|
|
|
- and mt.status = 'ONLINE'
|
|
|
|
|
|
+ mt.region = #{param.region} and mt.status = 'ONLINE'
|
|
<if test="param.keyword != null and !param.keyword.isEmpty()">
|
|
<if test="param.keyword != null and !param.keyword.isEmpty()">
|
|
and mt.name like concat('%', #{param.keyword}, '%')
|
|
and mt.name like concat('%', #{param.keyword}, '%')
|
|
</if>
|
|
</if>
|