package com.huimv.produce.warning.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huimv.produce.warning.entity.BaseWarningInfo;
import com.huimv.produce.warning.entity.BaseWarningInfoDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author astupidcoder
 * @since 2021-12-02
 */
@Repository
public interface BaseWarningInfoMapper extends BaseMapper<BaseWarningInfo> {

    List<BaseWarningInfoDto> listBaseWarn(@Param("farmId") String farmId,
                                          @Param("startDate") String startDate,
                                          @Param("endDate") String endDate);

    List<BaseWarningInfoDto> listDayBaseWarn(@Param("farmId") String farmId);

    List<BaseWarningInfoDto> listWeekBaseWarn(@Param("farmId") String farmId);

    List<BaseWarningInfoDto> listMonthBaseWarn(@Param("farmId") String farmId);

    Page listData(Page<BaseWarningInfoDto> page, @Param(Constants.WRAPPER)QueryWrapper<BaseWarningInfo> wrapper);
}
