package com.xxl.job.executor.report.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xxl.job.executor.report.entity.KuaishouReportDailyGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface KuaishouReportDailyGroupMapper extends BaseMapper<KuaishouReportDailyGroup> {
    void loadGroupDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);

    @Update("update ctop_kuaishou_report_daily_group " +
            "set channel_code = substring_index(unit_name, '-', 1) " +
            "where stat_date =#{date}")
    void formatChannelCode(@Param("date") String date);

    int insertSelective(KuaishouReportDailyGroup record);

    void replaceBatch(@Param(value = "records") List<KuaishouReportDailyGroup> groups);
}
