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);
|
|
}
|