package com.weather.modules.weather.dailydata.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.weather.common.dao.BaseDao;
import com.weather.modules.weather.dailydata.entity.WeatherDailyDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 每日气象监测数据表
 *
 * @author 2333 123
 * @since 1.0.0 2026-03-05
 */
@Mapper
public interface WeatherDailyDataDao extends BaseDao<WeatherDailyDataEntity> {

    List<WeatherDailyDataEntity> selectSummarizeList(@Param(Constants.WRAPPER) LambdaQueryWrapper<WeatherDailyDataEntity> wrapper);

    /**
     * 按站点 + 月-日 + 年份范围查询汇总数据
     * @param stationIds 站点 ID 列表
     * @param month      月份 1-12
     * @param day        日 1-31
     * @param startYear  起始年份
     * @param endYear    结束年份
     */
    List<WeatherDailyDataEntity> selectSummarizeByMonthDay(@Param("stationIds") List<Long> stationIds,
                                                           @Param("month") int month,
                                                           @Param("day") int day,
                                                           @Param("startYear") int startYear,
                                                           @Param("endYear") int endYear);

    int insertBatchMultiRow(@Param("list") List<WeatherDailyDataEntity> list);
}