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

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

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

@Repository
public interface PersonDeviceRelationDAO {
	int insert(PersonDeviceRelation entity);
	int update(PersonDeviceRelation entity);
	int exist(String id);
	PersonDeviceRelation get(String id);
	int delete(String id);
	List<PersonDeviceRelation> list();
	List<PersonDeviceRelation> findByPersonId(Long personId);
    List<PersonDeviceRelation> findByDeviceId(String deviceId);
	List<Long> findByDerviceName(String derviceName);
    PersonDeviceRelation findByDeviceIdAndPersonId(String deviceId, Long personId);
	List<PersonDeviceRelation> search(Map<String, Object> searchParams, List<Sort> sortList);
    List<DeviceInfo> findDeviceByPersonId(Long personId);

    List<PersonDeviceRelation> findByIsBoundAndUpdateTime(Date updateTime, Integer limit);

	void updateIsBound(PersonDeviceRelation personDeviceRelation);

//    List<PersonDeviceRelation>  findByPersonId(@Param("personId")Long personId);


}