yujian
2019-11-06 54e6398cabe1b32b1dbc9857c6a99d8f15b549f7
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package com.yeshi.fanli.dao.mybatis.user;
 
import java.util.List;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.vo.user.UserSystemCouponVO;
 
public interface UserSystemCouponMapper extends BaseMapper<UserSystemCoupon> {
    
    List<UserSystemCoupon> getUserCouponList(@Param("start") long start, @Param("count") int count, 
            @Param("uid") Long uid);
    
    
    List<UserSystemCouponVO> getCouponListOld(@Param("start") long start, @Param("count") int count, 
            @Param("uid") Long uid);
    
    long countCouponOld(@Param("uid") Long uid);
    
    
    List<UserSystemCouponVO> getUserCouponVOList(@Param("start") long start, @Param("count") int count, 
            @Param("uid") Long uid);
    
    long countUserCouponList(@Param("uid") Long uid);
    
    /**
     *   根据券id查询可使用券
     * @param uid
     * @param typeList
     * @return
     */
    List<UserSystemCouponVO> getEnableListByCouponId(@Param("uid") Long uid, @Param("activated") Integer activated,
            @Param("list") List<Long> listCouponId);
 
    /**
     * 根据来源查询订单
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
    
    /**
     * 根据来源查询订单
     * @param uid
     * @param source
     * @return
     */
    int countTodatyUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
    
    /**
     * 获取已经过期但状态未改变的券
     * @param uid
     * @return
     */
    List<UserSystemCoupon> getCounponNowInvalid(@Param("count")int count);
    
    /**
     * 获取已经过期但状态未改变的券
     * @param uid
     * @return
     */
    List<UserSystemCoupon> getCounponNowInvalidByUid(@Param("uid")Long uid);
    
    /**
     * 根据状态查询券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getCouponByState(@Param("uid") Long uid, @Param("state") String state);
    
    /**
     * 查询没有激活的券 
     * @param couponId
     */
    List<UserSystemCoupon> getCouponByTypeAndNotActivated(@Param("uid") Long uid, @Param("couponId") Long couponId);
    
    /**
     *  查询兑换的券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getIncludeExchange(@Param("uid") Long uid, @Param("num") int num, @Param("type") String type);
    
    
    /**
     *  查询排出兑换的券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCouponVO> getIncludeNotExchange(@Param("uid") Long uid,@Param("num") int num, @Param("type") String type);
    
    
    /**
     * 查询正在使用中 超过时间仍未匹配到订单记录
     * @param uid
     * @param seconds
     * @return
     */
    List<UserSystemCoupon> getCouponByUsingTimeOut(@Param("uid") Long uid,@Param("list") List<Long> list, @Param("number") Long number);
 
 
    /**
     * 统计有效券
     * @param uid
     * @param listCouponId
     * @return
     */
    long countUsableByUid(@Param("uid") Long uid, @Param("list") List<Long> listCouponId);
 
 
    /**
     *  查询免券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getFreeCouponByType(@Param("uid") Long uid, @Param("type") String type);
    
    
    /**
     *  查询需要激活的免券
     * @param uid
     * @param source
     * @return
     */
    UserSystemCoupon getNeedActivateCouponByType(@Param("uid") Long uid, @Param("type") String type);
    
}