优惠券 记录

This commit is contained in:
2025-02-26 10:02:08 +08:00
parent ab6bce2de6
commit e0fa223a7c
10 changed files with 159 additions and 0 deletions

View File

@@ -4,4 +4,34 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.account.mapper.ShopActivateCouponRecordMapper">
<select id="queryReceive" resultType="com.czg.account.vo.CouponReceiveVo">
SELECT
record.id,
vip.id as userId ,
vip.`name`,
vip.telephone as phone,
record.create_time as receiveTime,
record.update_time as useTime,
record.source as source
FROM
tb_shop_activate_coupon_record record
LEFT JOIN tb_shop_user vip
ON record.shop_user_id = vip.id AND vip.shop_id = #{param.shopId}
WHERE
record.coupon_id = #{param.couponId}
and record.shop_id = #{param.shopId}
<if test="param.value != null and param.value != '' ">
and (vip.name like concat('%', #{param.value}, '%') or vip.telephone like concat('%', #{param.value}, '%'))
</if>
<if test="param.status != null">
and record.status = #{param.status}
</if>
<if test="param.startTime != null ">
and record.create_time &gt; #{param.startTime}
</if>
<if test="param.endTime != null ">
and record.create_time &lt; #{param.endTime}
</if>
order by record.create_time desc
</select>
</mapper>