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

import com.github.pagehelper.Page;
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 java.util.List;
import java.util.Map;

public interface CompanyDeviceRelationService {
	CompanyDeviceRelation get(String id);
	boolean exist(String id);
	int insert(CompanyDeviceRelation model);
	int update(CompanyDeviceRelation model);
	int delete(String id);
	List<CompanyDeviceRelation> list();
	Page<CompanyDeviceRelation> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, 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);
}