From 206f601b1f2a2e3cb0bf4f5dead01bec9077d8e9 Mon Sep 17 00:00:00 2001
From: 彭雪彬 <1724387007@qq.com>
Date: Thu, 04 Sep 2025 15:28:52 +0800
Subject: [PATCH] Merge branch 'xin' into pxb
---
oying-system/src/main/resources/mapper/pc/store/StoreMapper.xml | 68 +++++++++++++++++++++++++++++++---
1 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/oying-system/src/main/resources/mapper/pc/store/StoreMapper.xml b/oying-system/src/main/resources/mapper/pc/store/StoreMapper.xml
index 564abeb..8182980 100644
--- a/oying-system/src/main/resources/mapper/pc/store/StoreMapper.xml
+++ b/oying-system/src/main/resources/mapper/pc/store/StoreMapper.xml
@@ -13,12 +13,17 @@
<result property="storeName" column="store_name"/>
<result property="businessScope" column="business_scope"/>
<result property="status" column="status"/>
+ <result property="businessStatus" column="business_status"/>
+ <result property="auditStatus" column="audit_status"/>
<result property="logoImageId" column="logo_image_id"/>
+ <result property="logoImageUrl" column="logo_image_url"/>
<result property="coverImageId" column="cover_image_id"/>
+ <result property="coverImageUrl" column="cover_image_url"/>
<result property="description" column="description"/>
<result property="tags" column="tags"/>
<result property="deliveryFee" column="delivery_fee"/>
<result property="deliveryMinimum" column="delivery_minimum"/>
+ <result property="packagingFee" column="packaging_fee"/>
<result property="contactPhone" column="contact_phone"/>
<result property="openTime" column="open_time"/>
<result property="closeTime" column="close_time"/>
@@ -28,23 +33,26 @@
<result property="geoHash" column="geo_hash"/>
<result property="coordinateSystem" column="coordinate_system"/>
<result property="radius" column="radius"/>
+ <result property="returns" column="returns" />
+ <result property="selfPickup" column="self_pickup"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
+ <result property="version" column="version"/>
</resultMap>
<sql id="store_column_list">
- store_id, merchant_id, platform_category_id, store_type, store_code, store_name, business_scope, status, logo_image_id,
- cover_image_id, description, tags, delivery_fee, delivery_minimum, contact_phone, open_time, close_time,
- address, longitude, latitude, geo_hash, geo_point, coordinate_system, radius, create_by, create_time, update_by, update_time
+ store_id, merchant_id, platform_category_id, store_type, store_code, store_name, business_scope, status, business_status, audit_status, logo_image_id, logo_image_url,
+ cover_image_id, cover_image_url, description, tags, delivery_fee, delivery_minimum, packaging_fee, contact_phone, open_time, close_time,
+ address, longitude, latitude, geo_hash, geo_point, coordinate_system, radius, returns, self_pickup, create_by, create_time, update_by, update_time, version
</sql>
<sql id="selectStoreVo">
select
- store_id, merchant_id, platform_category_id, store_type, store_code, store_name, business_scope, status, logo_image_id,
- cover_image_id, description, tags, delivery_fee, delivery_minimum, contact_phone, open_time, close_time,
- address, longitude, latitude, geo_hash, geo_point, coordinate_system, radius, create_by, create_time, update_by, update_time from pc_store
+ store_id, merchant_id, platform_category_id, store_type, store_code, store_name, business_scope, status, business_status, audit_status, logo_image_id, logo_image_url,
+ cover_image_id, cover_image_url, description, tags, delivery_fee, delivery_minimum, packaging_fee, contact_phone, open_time, close_time,
+ address, longitude, latitude, geo_hash, geo_point, coordinate_system, radius, returns, self_pickup, create_by, create_time, update_by, update_time, version from pc_store
</sql>
<select id="selectStoreList" resultMap="StoreResult">
@@ -105,4 +113,52 @@
</where>
</select>
+ <select id="queryStoreIds" resultType="java.lang.Long">
+ SELECT s.store_id AS storeId
+ FROM pc_store s
+ <where>
+ <!-- 位置条件 -->
+ <if test="criteria.longitude != null and criteria.latitude != null and criteria.radius != null">
+ AND ST_Distance_Sphere(POINT(#{criteria.longitude}, #{criteria.latitude}), POINT(s.longitude,
+ s.latitude)) <= #{criteria.radius}
+ AND ST_Distance_Sphere(POINT(#{criteria.longitude}, #{criteria.latitude}), POINT(s.longitude,
+ s.latitude)) <= s.radius
+ </if>
+
+ <!-- 店铺名称模糊查询 AND s.name LIKE CONCAT('%', #{criteria.blurry}, '%') -->
+ <if test="criteria.blurry != null and criteria.blurry != ''">
+ AND s.store_name like concat('%', #{criteria.blurry}, '%')
+ </if>
+
+ <!-- 营业状态 -->
+ <if test="criteria.businessStatus != null">
+ AND s.business_status = #{criteria.businessStatus}
+ </if>
+
+ <!-- 类目ID -->
+ <if test="criteria.platformCategoryId != null">
+ AND s.platform_category_id = #{criteria.platformCategoryId}
+ </if>
+ </where>
+ <if test="criteria.limit != null">
+ limit #{criteria.limit}
+ </if>
+ </select>
+
+ <select id="queryByIds" resultMap="StoreResult">
+ SELECT
+ <include refid="store_column_list"/>
+ FROM pc_store
+ WHERE store_id IN
+ <foreach collection="ids" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </select>
+
+ <select id="queryUserStores" parameterType="java.lang.Long" resultMap="StoreResult">
+ SELECT s.*
+ FROM sys_user_store u INNER JOIN pc_store s ON u.store_id = s.store_id
+ WHERE u.user_id = #{userId}
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3