mitao
2024-04-30 ab4ea7b8f10c9b66aed9c2ea161a08b25c3851a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.sinata.rest.modular.member.dao;
 
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sinata.rest.modular.mall.model.MallGoods;
import com.sinata.rest.modular.member.model.MyCoupon;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
import java.math.BigDecimal;
import java.util.List;
 
/**
 * <p>
 * 优惠券 Mapper 接口
 * </p>
 *
 * @author fq
 * @since 2023-03-05
 */
public interface MyCouponMapper extends BaseMapper<MyCoupon> {
 
 
    /**
     * 获取优惠券领取信息
     * @param page 分页信息
     * @param cityCode 城市信息
     * @param userId  用户id
     * @param role 用户角色信息
     * @return
     */
    List<MyCoupon> getCouponList(@Param("page") Page<MyCoupon> page,@Param("cityCode")  String cityCode
            , @Param("userId") Integer userId, @Param("role") Integer role);
 
    List<MallGoods> getCouponGoodsList( @Param("couponId") Integer couponId);
 
 
    Boolean subCouponStock( @Param("couponId") Integer couponId);
 
 
    Boolean addCouponStock( @Param("couponId") Integer couponId);
 
    MyCoupon getCouponByUserCouponId(@Param("userCouponId") Integer userCouponId);
 
    /**
     * 订单可用优惠券
     */
    List<MyCoupon> orderCoupon(@Param("userId") Integer userId, @Param("goodsId") Integer goodsId, @Param("goodsType") Integer goodsType,@Param("price") BigDecimal price , @Param("dateTime") String dateTime);
 
    /**
     * 订单使用/退还优惠券
     * @param userId
     * @param couponId
     * @param isUse
     * @return
     */
    boolean updateUseCoupon(@Param("userId") Integer userId, @Param("couponId") Integer couponId, @Param("isUse") Integer isUse);
 
}