feat:V2.4

This commit is contained in:
苏竹红
2025-01-10 19:02:16 +08:00
parent 81b135bba6
commit 5d2afdf9c5
36 changed files with 702 additions and 322 deletions

View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
<result column="status" jdbcType="TINYINT" property="status" />
@@ -14,7 +15,7 @@
</resultMap>
<sql id="allColumn">
id, line_id, point_id, development_manager, status, reason, deleted, create_time, update_time
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
</sql>
<update id="updateShopPointRecommendStatus">
@@ -48,6 +49,20 @@
group by line_id
</select>
<select id="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
select
shop_id as shopId,
count(1) as recommendShopNum
from
xfsg_point_recommend
where
deleted = 0 and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
group by shop_id
</select>
<select id="getRecommendPointList" resultMap="BaseResultMap">
select
id,
@@ -62,10 +77,25 @@
line_id = #{lineId} and deleted = 0
</select>
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
select
id,
point_id,
line_id,
development_manager,
status,
reason
from
xfsg_point_recommend
where
shop_id = #{shopId} and deleted = 0
</select>
<insert id="batchInsert">
<foreach collection="recommendList" item="item" index="index" separator=";">
insert into xfsg_point_recommend (line_id, point_id, development_manager, status)
values (#{item.lineId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
</foreach>
</insert>
@@ -76,7 +106,7 @@
deleted = if(status = 1, 1, deleted),
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
where
line_id = #{lineId}
shop_id = #{shopId}
</update>
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
@@ -96,12 +126,12 @@
xfsg_point_recommend pr
inner join xfsg_point_info p on p.id = pr.point_id
where
p.deleted = 0 and pr.line_id = #{request.lineId} and pr.deleted = 0
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
<if test="request.status != null and request.status == 1">
and pr.status = 1 and p.select_status = 0
</if>
<if test="request.status != null and request.status == 2">
and pr.status = 2 and p.select_status = 1 and p.line_id = #{request.lineId}
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
</if>
<if test="request.status != null and request.status == 3">
and pr.status in (5, 6)
@@ -112,7 +142,7 @@
update
xfsg_point_recommend
set
status = if(line_id = #{lineId}, 2, 3)
status = if(shop_id = #{shopId}, 2, 3)
where point_id = #{pointId} and deleted = 0 and status = 1
</update>
@@ -122,7 +152,7 @@
set
status = 5,
reason = #{reason}
where point_id = #{pointId} and line_id = #{lineId} and deleted = 0 and status = 1
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
</update>
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
@@ -133,4 +163,34 @@
where
point_id = #{pointId} and deleted = 0
</select>
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_point_recommend
<where>
and (shop_id = 0 or shop_id is null)
<if test="lineId!=null">
and line_id = #{lineId}
</if>
</where>
</select>
<update id="batchUpdateShopId">
update xfsg_point_recommend
set
shop_id = case id
<foreach collection="recommendList" item="item" index="index" >
when #{item.id} then #{item.shopId}
</foreach>
end
where
id in
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
#{entity.id}
</foreach>
</update>
</mapper>