admin
2018-12-24 46de50dee30e6f7b7b61d64b7704f4abc131a505
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
package com.yeshi.fanli.dao.mybatis;
 
import java.math.BigDecimal;
import java.util.List;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.entity.bus.user.UserInfo;
 
public interface UserInfoMapper {
 
    int deleteByPrimaryKey(Long id);
 
    int insert(UserInfo record);
 
    int insertSelective(UserInfo record);
 
    UserInfo selectByPrimaryKey(Long id);
    
    UserInfo selectByPKey(Long id);
 
    UserInfo selectByPrimaryKeyForUpdate(Long id);
 
    int updateByPrimaryKeySelective(UserInfo record);
 
    int updateByPrimaryKey(UserInfo record);
 
    // 减掉用户红包金额
    int subHongBaoByUid(@Param("uid") long uid, @Param("money") BigDecimal money);
 
    // 增加用户红包金额
    int addHongBaoByUid(@Param("uid") long uid, @Param("money") BigDecimal money);
 
    void cleanPassword(long id);
 
    BigDecimal getNewPeopleHB(Long id);
 
    BigDecimal getMyHB(Long id);
 
    // 根据AppId与微信unionID获取用户
    UserInfo getUserInfoByAppIdAndWXUnionId(@Param("appId") String appId, @Param("unionId") String unionId);
 
    // 根据AppId与淘宝OpenId获取用户
    UserInfo getUserInfoByAppIdAndTaoBaoOpenId(@Param("appId") String appId, @Param("openId") String openId);
 
    // 根据AppId与电话号码获取用户
    UserInfo getUserInfoByAppIdAndPhone(@Param("appId") String appId, @Param("phone") String phone);
 
    Long getMaxUid();
 
    /**
     * 融合账号
     * 
     * @param mainUid-主账号
     * @param lessUid-副账号
     */
    void connectUser(@Param("mainUid")Long mainUid,@Param("lessUid") Long lessUid);
    
    
    /**
     * 
     * @param start
     * @param count
     * @param key  查询条件
     * @param userType  用户类型
     * @param days      天数
     * @param startTime  注册时间 -小
     * @param endTime    注册时间 -大
     * @param orderMode  排序方式
     * @return
     */
    List<UserInfo> query(@Param("start") long start, @Param("count") int count, @Param("key") String key,
            @Param("userType")Integer userType,    @Param("days")Integer days,
            @Param("startTime") String startTime, @Param("endTime") String endTime, 
            @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode);
    
    long queryCount(@Param("key") String key, @Param("userType")Integer userType,    @Param("days")Integer days,
            @Param("startTime") String startTime, @Param("endTime") String endTime);
    
    /**
     * 统计当前查询结果总金额
     * @param title
     * @param userType
     * @param days
     * @param startTime
     * @param endTime
     * @return
     */
    double querySumMoney(@Param("key") String key, @Param("userType")Integer userType,    @Param("days")Integer days,
            @Param("startTime") String startTime, @Param("endTime") String endTime);
    
    /**
     * 统计用户数量
     * @param isToday  统计今日
     * @param isMonth  统计当月  二则不可同时存在
     * @return
     */
    long countNewUser(@Param("isToday") Integer isToday, @Param("isMonth") Integer isMonth);
    
    /**
     * 根据等级统计用户数量
     * @param rank
     * @return
     */
    long countRank(@Param("rank") Integer rank);
    
    /**
     * 统计所有用户总金额  或  可提现金额
     * @param minMoney
     * @return
     */
    double countAllMoney(@Param("minMoney") Double minMoney);
    
    
    /**
     * 超过 daysNum  天未登陆的用户
     * @param minMoney
     * @return
     */
    List<Long> longTimeNoLogin(@Param("daysNum") int daysNum, @Param("list") List<Long> list);
    
}