package org.fanli.service.user.dao.account;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
import java.util.Map;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import com.yeshi.fanli.base.entity.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);
|
|
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
|
*/
|
BigDecimal countAllMoney(@Param("minMoney") Double minMoney);
|
|
|
/**
|
* 超过 daysNum 天未登陆的用户
|
* @param minMoney
|
* @return
|
*/
|
List<Long> longTimeNoLogin(@Param("daysNum") int daysNum, @Param("list") List<Long> list);
|
|
/**
|
* 统计流失用户数量:( num 天未使用登录并且无任何资金流动的账号数量)
|
* @param num 180
|
* @return
|
*/
|
long countLoseUser(@Param("num") int num);
|
|
|
/**
|
* 累计有购买用户数
|
* @return
|
*/
|
long countHasOrderUser();
|
|
|
/**
|
* 统计新增用户
|
* @return
|
*/
|
List<Map<String, Object>> countNewUserByDate(@Param("channel")String channel,@Param("type")Integer type, @Param("years") String years,
|
@Param("startTime")String startTime, @Param("endTime")String endTime);
|
|
|
/**
|
* 统计新增用户当日产生订单用户数量
|
* @return
|
*/
|
List<Map<String, Object>> getTodayHasOrder(@Param("channel")String channel,@Param("type")Integer type, @Param("years") String years,
|
@Param("startTime")String startTime, @Param("endTime")String endTime);
|
|
|
/**
|
* 统计新增用户一周产生订单用户数量
|
* @return
|
*/
|
Map<String, Object> getWeekHasOrder(@Param("channel")String channel, @Param("startTime")String startTime,
|
@Param("endTime")String endTime, @Param("orderNum")Integer orderNum);
|
|
|
/**
|
* 根据电话号码、邀请码获取邀请用户
|
* @param phone
|
* @param inviteCode
|
* @return
|
*/
|
UserInfo getInfoByPhoneOrInviteCode(@Param("phone")String phone, @Param("inviteCode")String inviteCode);
|
|
}
|