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

import com.jpsoft.shinestar.modules.base.entity.CompanyDeviceRelation;
import com.jpsoft.shinestar.modules.base.entity.DeviceInfo;
import com.jpsoft.shinestar.modules.common.dto.Sort;
import org.springframework.stereotype.Repository;

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

@Repository
public interface CompanyDeviceRelationDAO {
	int insert(CompanyDeviceRelation entity);
	int update(CompanyDeviceRelation entity);
	int exist(String id);
	CompanyDeviceRelation get(String id);
	int delete(String id);
	List<CompanyDeviceRelation> list();
	List<CompanyDeviceRelation> search(Map<String, Object> searchParams, List<Sort> sortList);
    List<DeviceInfo> findDeviceByCompanyId(String companyId);
	CompanyDeviceRelation findByCompanyIdAndDeviceId(String companyId, String deviceId);
	List<CompanyDeviceRelation> findByCompanyId(String companyId);
	List<CompanyDeviceRelation> findByDeviceId(String deviceId);
	int deleteByCompanyId(String companyId);
	int deleteByDeviceId(String deviceId);
    int deleteByCompanyIdAndDeviceId(String companyId, String deviceId);
}