|
@@ -2,14 +2,14 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.chelvc.cloud.vehicle.server.dao.MerchantMapper">
|
|
|
<sql id="BASIC_MERCHANT_SELECT">
|
|
|
- select mt.id, mt.user_id, mt.name, mt.logo, mt.banners, mt.liaison, mt.mobile, mt.opening, mt.address,
|
|
|
+ select mt.id, mt.user_id, mt.name, mt.logo, mt.banners, mt.liaison, mt.mobile, mt.opening, mt.address,mt.business_status,
|
|
|
mt.score, mt.sale, mt.good_review,mt.region, mt.longitude, mt.latitude, mt.recommend, mt.status, mt.creator,
|
|
|
mt.create_time,mt.updater, mt.update_time
|
|
|
from `merchant` mt
|
|
|
</sql>
|
|
|
|
|
|
<select id="listNearbyMerchants" resultType="com.chelvc.cloud.vehicle.api.dto.MerchantDTO">
|
|
|
- select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,
|
|
|
+ select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
)) distance
|
|
@@ -19,7 +19,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="listRecommendMerchants" resultType="com.chelvc.cloud.vehicle.api.dto.MerchantDTO">
|
|
|
- select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,
|
|
|
+ select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
)) distance
|
|
@@ -29,7 +29,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="listSimpleMerchants" resultType="com.chelvc.cloud.vehicle.api.dto.MerchantDTO">
|
|
|
- select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,
|
|
|
+ select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{longitude}, #{latitude})
|
|
|
)) distance
|
|
@@ -71,7 +71,7 @@
|
|
|
<select id="getMerchantById" resultType="com.chelvc.cloud.vehicle.server.entity.Merchant">
|
|
|
select mt.id, mt.user_id as userId, mt.name, mt.logo, mt.banners, mt.liaison, mt.mobile,
|
|
|
mt.opening, mt.address, mt.score, mt.sale, mt.good_review as goodReview,mt.region, mt.longitude,
|
|
|
- mt.latitude, mt.recommend, mt.status, mt.creator,
|
|
|
+ mt.latitude, mt.recommend, mt.status, mt.creator,mt.business_status,
|
|
|
mt.create_time as createTime,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
@@ -128,4 +128,9 @@
|
|
|
select m.id from merchant m left join oms_cart_item ca on m.id = ca.merchant_id
|
|
|
where ca.id is not null and ca.user_id = #{userId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <update id="updateMerchantBusinessStatus">
|
|
|
+ update merchant set business_status = #{businessStatus} ,automatic = #{automatic}
|
|
|
+ where id = #{merchantId}
|
|
|
+ </update>
|
|
|
</mapper>
|