package com.usky.eg.mapper; import com.usky.eg.domain.EgDevicePersonBind; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface EgDevicePersonBindMapper { /** * 根据多个设备ID查询绑定关系 */ List selectByDeviceIds(@Param("deviceIds") List deviceIds); /** * 统计某个设备下的绑定人数 */ Integer countByDeviceId(@Param("deviceId") Integer deviceId); /** * 根据用户ID和设备ID统计绑定关系 * 通过 sys_user_person -> sys_person -> eg_device_person_bind 进行关联 */ Integer countByUserIdAndDeviceId(@Param("userId") Long userId, @Param("deviceId") Integer deviceId); /** * 根据用户ID查询其绑定的设备ID列表 * 通过 sys_user_person -> sys_person -> eg_device_person_bind 进行关联 */ List selectDeviceIdsByUserId(@Param("userId") Long userId); /** * 根据设备ID删除绑定关系 */ void deleteByDeviceId(@Param("deviceId") Integer deviceId); /** * 新增绑定关系 */ void insert(EgDevicePersonBind bind); }