package com.yeshi.fanli.dao.mybatis.hongbao;
|
|
import java.math.BigDecimal;
|
import java.util.Date;
|
import java.util.List;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import com.yeshi.fanli.entity.bus.user.HongBao;
|
|
public interface HongBaoMapper {
|
|
int deleteByPrimaryKey(Long id);
|
|
int insert(HongBao record);
|
|
int insertSelective(HongBao record);
|
|
HongBao selectByPrimaryKey(Long id);
|
|
HongBao selectByPrimaryKeyForUpdate(Long id);
|
|
List<HongBao> selectByOrderId(String orderId);
|
|
/**
|
* 获取由该订单号所产生的红包(排除子红包)
|
*
|
* @param orderId
|
* @return
|
*/
|
List<HongBao> selectByOrderIdWithoutChild(String orderId);
|
|
List<HongBao> findChildHongBaoList(Long id);
|
|
List<HongBao> selectByOid(Long oid);
|
|
List<HongBao> selectByOrderIdSortWithAucationIdAndPayMoney(String orderId);
|
|
Long selectCanBalanceHongBaoCountByType(@Param("type") int type);
|
|
List<HongBao> selectCanBalanceHongBaoByType(@Param("type") int type, @Param("count") int count);
|
|
List<HongBao> selectCanBalanceHongBaoByTypeAndUid(@Param("type") int type, @Param("uid") long uid,
|
@Param("count") int count);
|
|
// 获取能够返利的子红包的主红包列表
|
List<HongBao> selectCanBalanceHongBaoByChildHongBao(int count);
|
|
// 获取邀请赚可返利的用户列表
|
List<Long> selectUidCanBalanceHongBaoByChildHongBao();
|
|
List<HongBao> selectCanBalanceHongBaoByChildHongBaoAndUid(Long uid);
|
|
/**
|
* 通过主红包ID获取子红包列表
|
*
|
* @param pid
|
* @return
|
*/
|
List<HongBao> selectChildHongBaoByPid(Long pid);
|
|
int updateByPrimaryKeySelective(HongBao record);
|
|
int updateByPrimaryKey(HongBao record);
|
|
/**
|
* 获取产生多个红包的订单号
|
*
|
* @return
|
*/
|
List<String> selectMultiHongBaoOrder();
|
|
List<HongBao> selectByUid(Long uid);
|
|
/**
|
* 根据用户ID和类型查找红包
|
*
|
* @param uid
|
* @param type
|
* @return
|
*/
|
List<HongBao> selectByUidAndType(@Param("uid") Long uid, @Param("type") int type);
|
|
// 累计提成订单数量(包含无效订单)
|
int getTotalTiChengCount(Long uid);
|
|
// 累计提成
|
BigDecimal getTotalTiChengMoney(Long uid);
|
|
// 未到账提成
|
BigDecimal getUnGetTiChengMoney(Long uid);
|
|
/**
|
* 获取用户在时间段内的所有订单数量
|
*
|
* @param uid
|
* @param createtime
|
* @return
|
*/
|
Long getCountOrder(@Param("uid") Long uid, @Param("createtime") Long createtime);
|
|
/**
|
* 获取用户在时间段内维权订单数量
|
*
|
* @param uid
|
* @param createtime
|
* @return
|
*/
|
Long getCountCancelOrder(@Param("uid") Long uid, @Param("createtime") Long createtime);
|
|
/**
|
* 查询用户所有收入记录
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
List<HongBao> selectOrderByUid(@Param("start") int start, @Param("count") int count, @Param("uid") Long uid,
|
@Param("startTime") String startTime, @Param("endTime") String endTime);
|
|
int countOrderByUid(@Param("uid") Long uid, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
|
/**
|
* 统计收益
|
*
|
* @param uid
|
* @param startTime
|
* @param endTime
|
* @return
|
*/
|
double countProfitByUid(@Param("uid") Long uid, @Param("startTime") String startTime,
|
@Param("endTime") String endTime);
|
|
/**
|
* 统计记录总数
|
*
|
* @param uid
|
* @return
|
*/
|
int getCountByUid(@Param("uid") Long uid);
|
|
/**
|
* 统计已经到账的订单数量
|
*
|
* @param uid
|
* @param state
|
* @return
|
*/
|
int getCountByUidAndState(@Param("uid") Long uid, @Param("state") int state);
|
|
/**
|
* 统计记录 失效订单数
|
*
|
* @param uid
|
* @return
|
*/
|
int getCountCancelByUid(@Param("uid") Long uid);
|
|
/**
|
* 统计记录订单总数
|
*
|
* @param uid
|
* @return
|
*/
|
Long getCountByUidOrder(@Param("uid") Long uid);
|
|
/**
|
* 统计已领取金额 账户历史总收益
|
*
|
* @param uid
|
* @return
|
*/
|
double countReceiveMoneysByUid(@Param("uid") Long uid);
|
|
/**
|
* 统计未领取金额 待入账收益
|
*
|
* @param uid
|
* @return
|
*/
|
double countForecastMoneysByUid(@Param("uid") Long uid);
|
|
/**
|
* 查询用户所有收入记录
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
List<HongBao> queryOrderByHB(@Param("start") int start, @Param("count") int count, @Param("key") String key,
|
@Param("interval") Integer interval, @Param("startTime") String startTime, @Param("endTime") String endTime,
|
@Param("orderType") Integer orderType);
|
|
int countQueryOrderByHB(@Param("uid") Long uid, @Param("startTime") String startTime,
|
@Param("endTime") String endTime);
|
|
/**
|
* 根据金额、订单号查询
|
*
|
* @param oid
|
* @param payMoney
|
* @return
|
*/
|
List<HongBao> queryByOrderIDAndPayMoney(@Param("oid") Long oid, @Param("payMoney") BigDecimal payMoney);
|
|
/**
|
* 根据用户、订单号查询
|
*
|
* @param oid
|
* @param uid
|
* @return
|
*/
|
List<HongBao> queryByOrderIDAndUid(@Param("oid") Long oid, @Param("uid") Long uid);
|
|
/**
|
* 统计当前用户 的自购订单数量
|
*
|
* @param uid
|
* @param isToday
|
* 统计当天 1 统计今日条件生效
|
* @param isMonth
|
* 统计当月 1 统计当月条件生效 注意:不可与当日同时生效
|
* @return
|
*/
|
long countByUidSelf(@Param("uid") Long uid, @Param("isToday") Integer isToday, @Param("isMonth") Integer isMonth);
|
|
/**
|
* 最近一次下单时间
|
*
|
* @param uid
|
* @return
|
*/
|
Long getLastOrderTime(Long uid);
|
|
/**
|
* 通过ID或者PID查询红包
|
*
|
* @param id
|
* @return
|
*/
|
List<HongBao> selectByIdOrPid(Long id);
|
|
/**
|
* 查询前3天返利金额总额最高值
|
*
|
* @return
|
*/
|
Double getMaxMoney(@Param("typeArray") Integer typeArray[]);
|
|
List<HongBao> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count,
|
@Param("date") String date);
|
|
/**
|
* 统计用户红包数量
|
* @param uid
|
* @param type
|
* @param state
|
* @param minTime
|
* @param maxTime
|
* @return
|
*/
|
long selectCountByTypeAndStateAndCreateTime(@Param("uid") Long uid, @Param("type") List<Integer> type,
|
@Param("state") List<Integer> state, @Param("minTime") Date minTime, @Param("maxTime") Date maxTime);
|
|
}
|