package com.heyu.api.data.dao.vv;
/**
 * <p>
 * 推广者获得奖品名细 服务类
 * </p>
 *
 * @author quyixiao
 * @since 2025-11-21
 */

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.entity.vv.VvBuyerEntity;
import com.heyu.api.data.entity.vv.VvPromoterTradeOrderAwardEntity;
import com.lz.mybatis.plugin.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface VvPromoterTradeOrderAwardDao extends BaseMapper<VvPromoterTradeOrderAwardEntity> {


    VvPromoterTradeOrderAwardEntity selectVvPromoterTradeOrderAwardById(@Param("id") Long id);


    Long insertVvPromoterTradeOrderAward(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);


    Long insertOrUpdateVvPromoterTradeOrderAward(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);


    int updateVvPromoterTradeOrderAwardById(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);


    int updateCoverVvPromoterTradeOrderAwardById(VvPromoterTradeOrderAwardEntity vvPromoterTradeOrderAward);


    int deleteVvPromoterTradeOrderAwardById(@Param("id") Long id);

    List<VvPromoterTradeOrderAwardEntity> selectAdminByCondition(IPage page,
                                                                 @IF Long tradeOrderId,
                                                                 @IF String status,
                                                                 @IF String promoterId,
                                                                 @IF Long promoterBuyerId,
                                                                 @IF String promoterBuyerName,
                                                                 @IF String promoterBuyerWeixin,
                                                                 @IF String promoterBuyerPhone,
                                                                 @IF Long wasBuyerId,
                                                                 @IF String wasBuyerName,
                                                                 @IF String wasBuyerWeixin,
                                                                 @IF String wasBuyerPhone,
                                                                 @IF @GE @Column(VvBuyerEntity.create_timestamp) Long minCreateTimestamp,
                                                                 @IF @LE @Column(VvBuyerEntity.create_timestamp) Long maxCreateTimestamp,
                                                                 @IF @Column(VvBuyerEntity.create_timestamp) String createTimestampSort
    );


    List<VvPromoterTradeOrderAwardEntity> selectVvPromoterTradeOrderAwardByPromoterId(Long promoterId);


    List<VvPromoterTradeOrderAwardEntity> selectVvPromoterTradeOrderAwardByPromoterId(@IN List<Long> promoterId);


    @OrderBy(VvPromoterTradeOrderAwardEntity.id_)
    List<VvPromoterTradeOrderAwardEntity> selectAppByCondition(IPage page,
                                                               Long wasBuyerId,
                                                               @IF String status,
                                                               @IF @GE @Column(VvBuyerEntity.create_timestamp) Long minCreateTimestamp,
                                                               @IF @LE @Column(VvBuyerEntity.create_timestamp) Long maxCreateTimestamp,
                                                               @IF @Column(VvBuyerEntity.create_timestamp) String createTimestampSort
    );

}


