package com.hzs.bonus.detail.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.detail.CuRegionAssessDetail;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 新零售会员区域考核明细表 Mapper 接口
 * </p>
 *
 * @author hzs
 * @since 2025-01-13
 */
public interface CuRegionAssessDetailMapper extends BaseMapper<CuRegionAssessDetail> {

    /*
     * @description: 考核开始日期
     * @author: sui q
     * @date: 2025/1/13 17:13
     * @param: null null
     **/
    void deleteAssessRegionDetailByDate(@Param("assessStartDate") Date assessStartDate, @Param("assessPeriod") Integer assessPeriod);

    /*
     * @description: 删除重复的数据
     * @author: sui q
     * @date: 2025/1/15 16:11
     * @param: null null
     **/
    void updateAssessRegionDetailByDate(@Param("assessStartDate") Date assessStartDate, @Param("assessEndDate") Date assessEndDate);

    List<Long> batchQueryCuRegionAssessDetailSeq(Integer rowNum);

    /*
     * @description: 批量插入区域考核数据
     * @author: sui q
     * @date: 2025/1/14 14:31
     * @param: null null
     **/
    void batchInsertCuRegionAssessDetail(@Param("cuRegionAssessDetailList") List<?> cuRegionAssessDetailList);

    /*
     * @description: 根据上月数据更新考核明细数据
     * @author: sui q
     * @date: 2025/1/14 16:44
     * @param: null null
     **/
    void mergeCuRegionAssessDetailTeamPv(@Param("rangeTableName") String rangeTableName, @Param("assessDate") Date assessDate);

    /*
     * @description: 根据上月数据更新考核明细数据
     * @author: sui q
     * @date: 2025/1/14 16:44
     * @param: null null
     **/
    void mergeCuRegionAssessDetailSmallAreaPv(@Param("rangeTableName") String rangeTableName, @Param("assessDate") Date assessDate);

    /*
     * @description: 初始化考核，先置为考核失败
     * @author: sui q
     * @date: 2025/1/14 17:30
     * @param: null null
     **/
    void updateCuRegionAssessDetailInit(@Param("assessDate") Date assessDate);

    /*
     * @description: 根据月后业绩考核，汇总满足30w，小区10w
     * @author: sui q
     * @date: 2025/1/14 17:36
     * @param: null null
     **/
    void updateCuRegionAssessDetailByPv(@Param("assessDate") Date assessDate);

    /*
     * @description: 根据月后业绩考核，汇总满足30w，小区10w
     * @author: sui q
     * @date: 2025/1/14 17:36
     * @param: null null
     **/
    void updateCuRegionAssessDetailByHand(@Param("assessDate") Date assessDate);
}
