package com.bailuntec.mapper;

import com.bailuntec.domain.dto.SalesVolumeAvgDTO;
import com.bailuntec.domain.dto.SalesVolumeDTO;
import com.bailuntec.domain.dto.SalesVolumeWeekDTO;
import com.bailuntec.domain.entity.DcAutoSales;
import com.bailuntec.domain.entity.DcAutoTurnover;
import com.bailuntec.domain.example.DcAutoSalesExample;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface DcAutoSalesMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    long countByExample(DcAutoSalesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int deleteByExample(DcAutoSalesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int insert(DcAutoSales record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int insertSelective(DcAutoSales record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    DcAutoSales selectOneByExample(DcAutoSalesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    List<DcAutoSales> selectByExample(DcAutoSalesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    DcAutoSales selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") DcAutoSales record, @Param("example") DcAutoSalesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") DcAutoSales record, @Param("example") DcAutoSalesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(DcAutoSales record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(DcAutoSales record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    int upsert(DcAutoSales record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table dc_auto_sales
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    int upsertSelective(DcAutoSales record);

    Map<String, BigDecimal> getSalesAvg(@Param("queryTime") String queryTime, @Param("bailunSku") String bailunSku, @Param("warehouseCode") String warehouseCode);

    SalesVolumeDTO getSalesVolumeDTONoCompare(@Param("queryTime") String queryTime, @Param("bailunSku") String bailunSku, @Param("warehouseCode") String warehouseCode);

    SalesVolumeWeekDTO getSalesVolumeWeekDTO(@Param("bailunSku") String bailunSku, @Param("warehouseCode") String warehouseCode);

    SalesVolumeDTO getSalesVolumeDTO(@Param("queryTime") String queryTime, @Param("bailunSku") String bailunSku, @Param("warehouseCode") String warehouseCode, @Param("compareSales") int compareSales);

    SalesVolumeAvgDTO getPlatformHistorySales( @Param("bailunSku") String bailunSku,@Param("warehouseCode") String warehouseCode,@Param("platform") String platform);
}