package com.jpsoft.shinestar.modules.base.dao;

import com.jpsoft.shinestar.modules.base.entity.DeviceInfo;
import com.jpsoft.shinestar.modules.common.dto.Sort;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface DeviceInfoDAO {
	int insert(DeviceInfo entity);
	int update(DeviceInfo entity);
	int exist(String id);
	DeviceInfo get(String id);
	DeviceInfo getByDeviceNo(String deviceNo);
	int delete(String id);
	List<DeviceInfo> list();
	List<DeviceInfo> findByDeviceIdList(List<String> deviceIdList);
	List<DeviceInfo> findByScene(String scene);
	List<DeviceInfo> findByCompanyId(String companyId);
	List<DeviceInfo> findByCompanyIdRelation(String companyId);

	List<DeviceInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
	DeviceInfo findByDeviceNo(String deviceNo);
	List<DeviceInfo> listOnline();
	List<DeviceInfo> findByDeviceAddressAndSchoolId(@Param("deviceAddressList") List<String> deviceAddressList, @Param("schoolId") String schoolId);
	Integer countOnlineByDeviceNoList(@Param("deviceNoList") List<String> deviceNoList);
}