package com.fs.bdAdv.mapper;

import java.util.List;

import com.fs.bdAdv.domain.FsAdvSem;
import com.fs.bdAdv.param.FsAdvSemStatisticsByDayParam;
import com.fs.bdAdv.vo.FsAdvSemStatisticsByDayVo;
import org.apache.ibatis.annotations.Select;

/**
 * App广告投流Mapper接口
 *
 * @author fs
 * @date 2024-11-19
 */
public interface FsAdvSemMapper
{
    /**
     * 查询App广告投流
     *
     * @param id App广告投流主键
     * @return App广告投流
     */
    public FsAdvSem selectFsAdvSemById(Long id);

    /**
     * 查询App广告投流列表
     *
     * @param fsAdvSem App广告投流
     * @return App广告投流集合
     */
    public List<FsAdvSem> selectFsAdvSemList(FsAdvSem fsAdvSem);

    /**
     * 新增App广告投流
     *
     * @param fsAdvSem App广告投流
     * @return 结果
     */
    public int insertFsAdvSem(FsAdvSem fsAdvSem);

    /**
     * 修改App广告投流
     *
     * @param fsAdvSem App广告投流
     * @return 结果
     */
    public int updateFsAdvSem(FsAdvSem fsAdvSem);

    /**
     * 删除App广告投流
     *
     * @param id App广告投流主键
     * @return 结果
     */
    public int deleteFsAdvSemById(Long id);

    /**
     * 批量删除App广告投流
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFsAdvSemByIds(Long[] ids);

    @Select("select * from fs_adv_sem where cmd_type <=2 and oaid=#{oaid}  order by create_time desc limit 1")
    public FsAdvSem selectFsAdvSemByOaid(String oaid);

    @Select("select * from fs_adv_sem where  cmd_type <=2 and model=#{model} and  os_type=#{osType}  order by create_time desc limit 1")
    public FsAdvSem selectFsAdvSemByModel(String model,Integer osType);

    List<FsAdvSemStatisticsByDayVo> selectFsAdvSemStatisticsByDayVo(FsAdvSemStatisticsByDayParam param);
}
