yujian
2020-03-24 fd1dce3121a7773419263c495f92e160cc1e7124
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package com.yeshi.fanli.dao.mybatis.redpack;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.vo.redpack.RedPackMonthVO;
 
public interface RedPackDetailMapper extends BaseMapper<RedPackDetail> {
 
    
    /**
     * 查询明细
     * @param identifyCode
     * @return
     */
    RedPackDetail getByIdentifyCode(@Param("identifyCode")String identifyCode);
    
    
    /**
     * 根据日期类型统计获得金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    BigDecimal countAddMoneyByDate(@Param("uid")long uid, @Param("dateType")int dateType);
    
    /**
     * 根据日期类型统计消耗金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    BigDecimal countUseMoneyByDate(@Param("uid")long uid, @Param("dateType")int dateType);
    
    /**
     * 按最大的创建时间和用户ID检索列表
     * 
     * @param uid
     * @param date
     * @return
     */
    List<RedPackDetail> selectByMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date, @Param("count") int count);
    
    
    /**
     * 通过用户ID和返回的最大时间的详情ID来获取下一页的数据
     * 
     * @param uid
     * @param id
     * @param count
     * @return
     */
    List<RedPackDetail> selectByUidWithIndexId(@Param("uid") Long uid, @Param("id") Long id, @Param("count") int count);
    
    
    /**
     * 统计某个月份的收入与支出
     * 
     * @param uid
     * @param dateFormat
     * @return
     */
    List<RedPackMonthVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat);
    
    
    /**
     * 获取用户总共有多少记录数据
     * 
     * @param uid
     * @return
     */
    Long selectCountByUid(@Param("uid") Long uid);
    
    /**
     * 按用户ID和最大时间检索月份的数量
     * 
     * @param uid
     * @param maxDate
     * @return
     */
    int selectMonthCountByUid(@Param("uid") Long uid, @Param("date") Date maxDate);
    
    
    /**
     * 按最大的创建时间和用户ID检索数量
     * 
     * @param uid
     * @param date
     * @return
     */
    Long selectCountByUidAndMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date);
    
    
    
    /**
     * 根据日期类型统计获得金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    BigDecimal countWinMoneyByDate(@Param("uid")long uid, @Param("dateType")int dateType);
    
    /**
     * 根据日期类型统计消耗金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    BigDecimal countReduceMoneyByDate(@Param("uid")long uid, @Param("dateType")int dateType);
    
    
    
    /**
     * 列表查询
     * 
     * @param key
     * @param state
     * @param start
     * @param count
     * @return
     */
    List<RedPackDetail> query(@Param("start") long start,@Param("count") int count,@Param("key") String key, @Param("uid") Long uid,
            @Param("type") Integer type);
 
    /**
     * 计数
     * 
     * @param key
     * @param state
     * @return
     */
    long count(@Param("key") String key, @Param("uid") Long uid, @Param("type") Integer type);
    
    
    /**
     *  统计每日新增红包
     * @param preDay
     * @return
     */
    Long countNumByDay(@Param("preDay") String preDay);
    
    /**
     *  统计每日新增红包
     * @param preDay
     * @return
     */
    BigDecimal countMoneyByDay(@Param("preDay") String preDay);
    
}