|
@@ -217,39 +217,55 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectShop" resultType="com.sqx.modules.goods.entity.GoodsShop">
|
|
<select id="selectShop" resultType="com.sqx.modules.goods.entity.GoodsShop">
|
|
|
- select * from (select gs.*,(st_distance (point (gs.shop_lng,gs.shop_lat),point(#{lng},#{lat}) ) *111195) AS
|
|
|
|
|
- distance
|
|
|
|
|
- from goods_shop gs
|
|
|
|
|
- left join shop_type st on gs.shop_type_id = st.id
|
|
|
|
|
- where gs.status = 1 and gs.city = #{city} and gs.putaway_flag = 0 and gs.is_supplier=1 and (gs.is_conceal =0 or gs.is_conceal is NULL)
|
|
|
|
|
- <if test="impotr!=null and impotr!=''">
|
|
|
|
|
- AND (gs.shop_name LIKE concat('%',#{impotr},'%') or
|
|
|
|
|
- st.shop_type_name like concat('%',#{impotr},'%') or
|
|
|
|
|
- gs.shop_lable LIKE concat('%',#{impotr},'%') or
|
|
|
|
|
- gs.shop_id in (
|
|
|
|
|
- select shop_id from goods where goods_name like concat('%',#{impotr},'%')
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
- </if>
|
|
|
|
|
-
|
|
|
|
|
- <if test="activityId!=null">
|
|
|
|
|
- and gs.activity_id = #{activityId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="shopTypeId!=null">
|
|
|
|
|
- and FIND_IN_SET(#{shopTypeId},gs.shop_type_id)
|
|
|
|
|
- </if>
|
|
|
|
|
- order by gs.is_recommend desc
|
|
|
|
|
- <if test="screen==1">
|
|
|
|
|
- ,gs.sort,gs.shop_score desc, distance asc
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="screen==3">
|
|
|
|
|
- ,distance asc
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="screen==4">
|
|
|
|
|
- ,gs.shop_sales desc
|
|
|
|
|
- </if>
|
|
|
|
|
- ) a
|
|
|
|
|
- where distribution_distance >= distance
|
|
|
|
|
|
|
+ select
|
|
|
|
|
+ *
|
|
|
|
|
+ from
|
|
|
|
|
+ (
|
|
|
|
|
+ select
|
|
|
|
|
+ gs.*,
|
|
|
|
|
+ (st_distance (point (gs.shop_lng,gs.shop_lat),point(#{lng}, #{lat}) ) * 111195) AS distance
|
|
|
|
|
+ from
|
|
|
|
|
+ goods_shop gs
|
|
|
|
|
+ left join shop_type st on gs.shop_type_id = st.id
|
|
|
|
|
+ where
|
|
|
|
|
+ gs.status = 1
|
|
|
|
|
+ and gs.city = #{city}
|
|
|
|
|
+ and gs.putaway_flag = 0
|
|
|
|
|
+ and gs.is_supplier=1
|
|
|
|
|
+ and (gs.is_conceal =0 or gs.is_conceal is NULL)
|
|
|
|
|
+ <if test="impotr!=null and impotr!=''">
|
|
|
|
|
+ AND (
|
|
|
|
|
+ gs.shop_name LIKE concat('%',#{impotr},'%')
|
|
|
|
|
+ or st.shop_type_name like concat('%',#{impotr},'%')
|
|
|
|
|
+ or gs.shop_lable LIKE concat('%',#{impotr},'%')
|
|
|
|
|
+ or gs.shop_id in (
|
|
|
|
|
+ select shop_id from goods where goods_name like concat('%',#{impotr},'%')
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="activityId!=null">
|
|
|
|
|
+ and gs.activity_id = #{activityId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="shopTypeId!=null">
|
|
|
|
|
+ and FIND_IN_SET(#{shopTypeId},gs.shop_type_id)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ order by
|
|
|
|
|
+ gs.is_recommend desc
|
|
|
|
|
+ <if test="screen == 1">
|
|
|
|
|
+ ,gs.sort,gs.shop_score desc, distance asc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="screen == 2">
|
|
|
|
|
+ ,gs.shop_score desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="screen == 3">
|
|
|
|
|
+ ,gs.shop_sales desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="screen == 4">
|
|
|
|
|
+ ,gs.create_time desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ) a
|
|
|
|
|
+ where
|
|
|
|
|
+ distribution_distance >= distance
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectEvaluate" resultType="com.sqx.modules.order.entity.Evaluate">
|
|
<select id="selectEvaluate" resultType="com.sqx.modules.order.entity.Evaluate">
|