优惠券相关+后台

This commit is contained in:
2025-07-25 11:17:43 +08:00
parent 587c9de5b2
commit 1a1eb79914
12 changed files with 167 additions and 35 deletions

View File

@@ -19,4 +19,51 @@
where cr.member_id = #{memberId} and cr.face_id = #{faceId} and c.type = #{type}
limit 1
</select>
<select id="selectByPageQuery"
resultType="com.ycwl.basic.model.pc.couponRecord.resp.CouponRecordPageResp">
select
cr.id,
cr.coupon_id as couponId,
c.name as couponName,
c.type as couponType,
CASE c.type
WHEN 0 THEN '普通优惠券'
WHEN 1 THEN '第一次推送'
WHEN 2 THEN '第二次推送'
WHEN 3 THEN '第三次推送'
ELSE '未知类型'
END as couponTypeName,
cr.member_id as memberId,
cr.face_id as faceId,
c.scenic_id as scenicId,
s.name as scenicName,
cr.status,
CASE cr.status
WHEN 0 THEN '未使用'
WHEN 1 THEN '已使用'
ELSE '未知状态'
END as statusName,
cr.create_time as createTime,
cr.used_time as usedTime,
cr.used_order_id as usedOrderId
from coupon_record cr
inner join coupon c on cr.coupon_id = c.id
inner join scenic s on c.scenic_id = s.id
<where>
<if test="scenicId != null">
and c.scenic_id = #{scenicId}
</if>
<if test="couponName != null and couponName != ''">
and c.name like concat('%', #{couponName}, '%')
</if>
<if test="couponType != null">
and c.type = #{couponType}
</if>
<if test="status != null">
and cr.status = #{status}
</if>
</where>
order by cr.create_time desc
</select>
</mapper>