admin
2020-04-15 2cde53516c1689efab451aef72c1db5e13b825a3
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
package com.yeshi.fanli.dao.mybatis.order;
 
import java.math.BigDecimal;
import java.util.List;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
 
public interface InviteOrderSubsidyMapper extends BaseMapper<InviteOrderSubsidy> {
 
    /**
     * 查询用户补贴
     * 
     * @param uid
     * @param orderNo
     * @param Type
     * @return
     */
    InviteOrderSubsidy getByOrderNoAndType(@Param("uid") Long uid, @Param("orderNo") String orderNo,
            @Param("type") Integer type);
 
    /**
     * 查询加锁
     * 
     * @param uid
     * @param orderNo
     * @param type
     * @return
     */
    InviteOrderSubsidy getByOrderNoAndTypeForUpdate(@Param("uid") Long uid, @Param("orderNo") String orderNo,
            @Param("type") Integer type);
 
    /**
     * 根据订单号与来源类型查询
     * 
     * @param orderNo
     * @param type
     * @return
     */
    long countByOrderNoAndType(@Param("orderNo") String orderNo, @Param("type") Integer type);
 
    /**
     * 根据订单号与来源类型查询
     * 
     * @param orderNo
     * @param type
     * @return
     */
    List<InviteOrderSubsidy> listByOrderNoAndType(@Param("orderNo") String orderNo, @Param("type") Integer type);
 
    List<InviteOrderSubsidy> listByOrderNoAndTypeAndUid(@Param("orderNo") String orderNo, @Param("type") Integer type,
            Long uid);
 
    InviteOrderSubsidy selectByPrimaryKeyForUpdate(Long id);
 
    /**
     * 统计用户已到账金额
     * @param uid
     * @return
     */
    BigDecimal sumRecievedMoneyByUid(@Param("uid") long uid, @Param("level") Integer level);
 
    /**
     * 统计用户有效金额
     * @param uid
     * @param day 1今日 2昨日 3本月  4上月
     * @return
     */
    BigDecimal sumValidMoneyByUidAndDate(@Param("uid") long uid, @Param("day") Integer day,
            @Param("level") Integer level);
 
    /**
     * 统计用户有效金额
     * @param uid
     * @param day 1今日 2昨日 3本月  4上月
     * @return
     */
    BigDecimal sumMoneyByUidAndDateAndState(@Param("uid") long uid, @Param("day") Integer day,
            @Param("level") Integer level, @Param("state") Integer state);
 
}