package com.yida.data.device.studentCard.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.card.EduStudentCard;
import com.yida.data.device.dto.studentCard.CardPageDTO;
import com.yida.data.device.dto.studentCard.CardWithAddressDTO;
import com.yida.data.device.vo.studentCard.CardInfoVO;
import com.yida.data.device.vo.studentCard.CardPageVO;
import com.yida.data.device.vo.studentCard.CardWithAddressVO;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;

/**
 * 电子学生证-设备管理 Mapper
 *
 * @author zhanghaijun
 * @date 2021-08-04 14:44:39
 */
public interface EduStudentCardMapper extends BaseMapper<EduStudentCard> {

    IPage<CardPageVO> listCardPage(Page page, @Param("dto") CardPageDTO dto, @Param("studentIds") List<Long> studentIds);

    List<CardPageVO> listCard(@Param("dto") CardPageDTO dto, @Param("studentIds") List<Long> studentIds);

    CardInfoVO getInfo(Long cardId);

    List<CardWithAddressVO> listStudentCard(@Param("dto") CardWithAddressDTO dto,
        @Param("onlineImei") Set<String> onlineImei);

    /**
     * 根据imei批量更新定位数据
     *
     * @param cardList
     */
    void updateLocaltionBatchByImei(List<EduStudentCard> cardList);

    List<CardPageVO> listStudentCardByImeiOrName(@Param("schoolId") Long schoolId,
        @Param("keyword") String keyword);

    /**
     * 更新设备在线状态
     */
    void updateOnline(@Param("onlineList") List<Object> onlineList,
        @Param("status") Integer status);
}
