订单列表 分页

优惠券
This commit is contained in:
2025-02-27 15:56:50 +08:00
parent 3be9ca1710
commit 7dc3183289
14 changed files with 194 additions and 39 deletions

View File

@@ -34,4 +34,49 @@
</if>
order by record.create_time desc
</select>
<select id="findByUser" resultType="com.czg.account.entity.ShopActivateCouponRecord">
select tb_shop_activate_coupon_record.*,tb_shop_info.shop_name
from tb_shop_activate_coupon_record
left join tb_shop_info on tb_shop_activate_coupon_record.shop_id = tb_shop_info.id
where tb_shop_activate_coupon_record.shop_user_id in
<foreach collection="shopUserIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
<if test="status != null">
and tb_shop_activate_coupon_record.status = #{status}
</if>
order by tb_shop_activate_coupon_record.status , tb_shop_activate_coupon_record.create_time desc
</select>
<select id="queryByVipIdAndShopId" resultType="com.czg.account.vo.UserCouponVo">
SELECT
inRecord.id as id,
inRecord.shop_id as shopId,
shop.shop_name as shopName,
inRecord.full_amount as fullAmount,
inRecord.discount_amount as discountAmount,
inRecord.coupon_id as couponId,
pro.id as proId,
inRecord.name as name,
inRecord.type,
inRecord.over_num as num,
inRecord.use_end_time as endTime
FROM
tb_activate_in_record inRecord
LEFT JOIN tb_shop_info shop ON inRecord.shop_id = shop.id
LEFT JOIN tb_product pro ON inRecord.pro_id = pro.id and pro.shop_id = #{shopId}
WHERE
inRecord.shop_user_id in
<foreach item="item" index="index" collection="vipUserIds" open="(" separator="," close=")">
#{item}
</foreach>
<if test="shopId != null and shopId != ''">
and inRecord.shop_id = #{shopId}
</if>
and inRecord.over_num != 0
and inRecord.use_start_time &lt; now()
and inRecord.use_end_time &gt; now()
order by inRecord.use_end_time
</select>
</mapper>