package com.m2pool.pool.mapper;

import com.m2pool.common.datasource.annotation.UserDB;
import com.m2pool.pool.dto.NoticeListDto;
import com.m2pool.pool.dto.NoticeMinerCoinListDto;
import com.m2pool.pool.dto.OfflineUserMinerDto;
import com.m2pool.pool.dto.UserAccountDto;
import com.m2pool.pool.vo.NoticeAddVo;
import com.m2pool.pool.vo.NoticeDelVo;
import com.m2pool.pool.vo.NoticePageVo;
import com.m2pool.pool.vo.NoticeUpdateVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description 邮箱通知相关sql
 * @Date 2022/8/30 17:47
 * @Author 杜懿
 */
@UserDB
public interface NoticeMapper {

    //查询当前账号绑定通知邮箱
    public List<NoticeListDto> getNoticeEmailListByMaId(@Param("vo") NoticePageVo vo,@Param("user") String user);

    //检查当前记录id和当前挖矿账号以及当前用户账号是否对应
    public boolean checkIdAndMa(@Param("id") long id,@Param("user") String user);

    public boolean checkEmailIfExist(@Param("maId") long maId,@Param("email") String email);

    public long getMaIdByIdAndUser(@Param("id") long id, @Param("user") String user);

    //查询当前账号绑定通知邮箱个数
    public int getNoticeEmailCountByMaId(@Param("maId") long maId);

    //新增通知邮箱
    public boolean addNoticeEmail(@Param("vo") NoticeAddVo vo);

    //修改通知邮箱备注
    public boolean updateInfo(@Param("vo") NoticeUpdateVo vo);

    //删除通知邮箱
    public boolean deleteNoticeInfoById(@Param("vo") NoticeDelVo vo,@Param("maId") Long maId);

    public List<NoticeMinerCoinListDto> getNoticeEmailListByMinerAndCoin(@Param("list") List<OfflineUserMinerDto> list, @Param("coin") String coin);

}
