package com.YuyeTech.TPlat.service;

import com.YuyeTech.TPlat.dataobject.DeviceInfo;
import com.YuyeTech.TPlat.dto.DeviceBindDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author:slambb
 * @date:2020/6/11
 */

public interface DeviceInfoService {

    List<DeviceInfo> addMultipleObjects(List<DeviceInfo> deviceInfos);

    /**
     * 根据识别信息来查找
     * @param identifier
     * @return
     */
    List<DeviceInfo> findAllByIdentifier(String identifier);


    DeviceInfo findByUUID(String uuid);

    List<DeviceBindDTO> findAllByUserId(String userId);

    List<DeviceInfo> findByUserIdOrUUID(String userId,String uuid);

    DeviceInfo findByUserIdAndUUID(String userId,String uuid);

    DeviceInfo findByUserIdAndType(String userId,Integer type);

    DeviceInfo findByUUIDAndType(String uuid,Integer type);

    DeviceInfo saveDeviceInfo(DeviceInfo deviceInfo);

    /**
     * 分页查询
     * @param pageable
     * @return
     */
    Page<DeviceInfo> findAllDeviceByPageable(Pageable pageable);

    /**
     * 根据uuid 分页查询
     * @param pageable
     * @param uuid
     * @return
     */
    Page<DeviceInfo> findAllDeviceByPageableAndUUID(Pageable pageable,String uuid);
}
