package org.dromara.app.service;

import jakarta.validation.constraints.NotEmpty;
import org.dromara.app.domain.bo.AppSchedulingDeviceBo;
import org.dromara.app.domain.vo.AppSchedulingDeviceVo;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;

import java.util.Collection;
import java.util.List;
import java.util.Set;

public interface IAppSchedulingDeviceService {

    AppSchedulingDeviceVo queryById(Long schedulingId);

    TableDataInfo<AppSchedulingDeviceVo> queryPageList(AppSchedulingDeviceBo bo, PageQuery pageQuery);

    List<AppSchedulingDeviceVo> queryList(AppSchedulingDeviceBo bo);

    Boolean insertByBo(AppSchedulingDeviceBo bo);

    Boolean updateByBo(AppSchedulingDeviceBo bo);

    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    List<AppSchedulingDeviceVo> findByDeviceNo(String deviceNo);

    /**
     * 批量查询已绑定排程的设备编号。
     *
     * @param deviceNos 待检查的设备编号
     * @return 已绑定排程的设备编号
     */
    Set<String> findBoundDeviceNos(Collection<String> deviceNos);

    Boolean deleteWithValidByScheduleIdAndDeviceNo(@NotEmpty(message = "主键不能为空") Long scheduleId, String deviceNo);

    AppSchedulingDeviceVo queryByScheduleIdAndDeviceNo(Long scheduleId, String deviceNo);
}
