package com.ycwl.basic.mapper;

import com.ycwl.basic.model.mobile.scenic.ScenicDeviceCountVO;
import com.ycwl.basic.model.pc.device.entity.DeviceConfigEntity;
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
import com.ycwl.basic.model.pc.device.req.DeviceAddOrUpdateReq;
import com.ycwl.basic.model.pc.device.req.DeviceReqQuery;
import com.ycwl.basic.model.pc.device.resp.DeviceRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @Author：longbinbin
 * @Date：2024/11/29 14:48
 * device（设备管理）
 */
@Mapper
public interface DeviceMapper {
    List<DeviceRespVO> list(DeviceReqQuery deviceReqQuery);
    List<DeviceEntity> listAll();
    DeviceRespVO getById(Long id);
    int add(DeviceAddOrUpdateReq deviceReqQuery);
    int deleteById(Long id);
    int update(DeviceAddOrUpdateReq deviceReqQuery);
    int updateStatus(Long id);

    DeviceEntity getByDeviceId(Long deviceId);
    List<DeviceRespVO> listByScenicIdWithWVP(Long scenicId);

    ScenicDeviceCountVO deviceCountByScenicId(@Param("scenicId") Long scenicId);

    DeviceConfigEntity getConfigByDeviceId(Long deviceId);
    int addConfig(DeviceConfigEntity deviceConfigEntity);
    int updateConfig(DeviceConfigEntity deviceConfigEntity);

    DeviceEntity getByDeviceNo(String deviceNo);

    int updateEntity(DeviceEntity device);

    int addEntity(DeviceEntity device);

    int updateOnlineStatus(Long id, String ipAddr, int online, Date keepaliveAt);

    DeviceEntity getByDeviceNo2(String deviceNo);

    List<Long> listAllByScenicId(Long scenicId);

    int updateSort(Long id, Integer sort);
}
