package com.crm.activity.dao.mapper;

import com.crm.rely.backend.model.entity.activity.ActivityRaceRankingListEntity;
import com.crm.rely.backend.model.pojo.table.ActivityRaceRankingTable;
import com.crm.rely.backend.model.pojo.view.ActivityRaceRankingView;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author y
 * @create 2022/7/21
 */
@Component
public interface ActivityRaceRankingMapper {

    Integer countList(ActivityRaceRankingListEntity entity);

    List<ActivityRaceRankingView> getList(ActivityRaceRankingListEntity entity);

    ActivityRaceRankingView getViewById(Long id);

    ActivityRaceRankingTable getById(Long id);

    List<ActivityRaceRankingTable> getAllByRaceTypeAndSerial(@Param("raceType") Integer raceType, @Param("serial") Integer serial);

    void batchUpdateRank(List<ActivityRaceRankingTable> tables);

    void updateById(ActivityRaceRankingTable table);

    ActivityRaceRankingView getViewByCustomIdAndRuleId(@Param("customId") Long customId,@Param("ruleId") Long ruleId);

    void batchUpdateProfit(List<ActivityRaceRankingTable> tables);

    List<ActivityRaceRankingTable> getAllByRuleId(Long ruleId);

}
