package com.zhongshu.card.server.core.dao.devices;

import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.server.core.dao.devices.extend.DeviceGroupToDeviceDaoExtend;
import com.zhongshu.card.server.core.domain.devices.DeviceGroup;
import com.zhongshu.card.server.core.domain.devices.DeviceGroupToDevice;
import com.zhongshu.card.server.core.domain.devices.DeviceInfo;

import java.util.List;

/**
 * @author TRX
 * @date 2024/3/21
 */
public interface DeviceGroupToDeviceDao extends MongoDao<DeviceGroupToDevice>, DeviceGroupToDeviceDaoExtend {

    List<DeviceGroupToDevice> findByIdIn(List<String> ids);

    List<DeviceGroupToDevice> findByDeviceGroup(DeviceGroup deviceGroup);

    DeviceGroupToDevice findTopById(String id);

    DeviceGroupToDevice findTopByDeviceGroupAndDeviceInfo(DeviceGroup deviceGroup, DeviceInfo deviceInfo);

    long countByDeviceGroup(DeviceGroup deviceGroup);

    List<DeviceGroupToDevice> findByProjectOidAndDeviceId(String projectOid, String deviceId);

    void deleteByDeviceGroup(DeviceGroup deviceGroup);
}
