package com.yingpai.stock.mapper;

import com.yingpai.stock.domain.StockPool;
import com.yingpai.stock.domain.vo.StockPoolVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.time.LocalDate;
import java.util.List;

/**
 * 股票池Mapper接口
 */
public interface StockPoolMapper extends BaseMapperPlus<StockPool, StockPoolVo> {

    /**
     * 查询指定日期的超短池数据（包含历史有效和当前有效）
     * @param addDate 加入日期
     * @param poolType 池类型：1-超短池
     * @return 股票池列表
     */
    @Select("SELECT * FROM stock_pool WHERE add_date = #{addDate} AND pool_type = #{poolType} AND status IN (1, 2)")
    List<StockPool> selectByDateAndType(@Param("addDate") LocalDate addDate, @Param("poolType") Integer poolType);
}
