UserDeviceRelationMapper.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.zy.bms.mapper;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.zy.bms.model.UserDeviceRelation;
  4. import com.zy.bms.common.vo.DeviceRelationVo;
  5. import org.apache.ibatis.annotations.Mapper;
  6. import org.apache.ibatis.annotations.Param;
  7. import org.springframework.stereotype.Repository;
  8. import java.util.List;
  9. /**
  10. * 用户设备绑定关系表
  11. *
  12. * @author chenyi
  13. * Create on 2020/4/10
  14. */
  15. @Mapper
  16. @Repository
  17. public interface UserDeviceRelationMapper extends BaseMapper<UserDeviceRelation> {
  18. /**
  19. * 查询用户绑定的设备集合
  20. *
  21. * @param userId 用户ID
  22. */
  23. List<DeviceRelationVo> getListByUserId(@Param("userId") String userId);
  24. /**
  25. * 查询设备是否有绑定用户
  26. *
  27. * @param deviceNum 设备号
  28. */
  29. int checkDeviceIsBind(@Param("deviceNum") String deviceNum);
  30. /**
  31. * 查询设备是否属于某用户
  32. *
  33. * @param userId 用户ID
  34. * @param deviceNum 设备号
  35. */
  36. int checkDeviceIsBelongByNum(@Param("userId") String userId, @Param("deviceNum") String deviceNum);
  37. /**
  38. * 查询设备是否属于某用户
  39. *
  40. * @param userId 用户ID
  41. * @param deviceId 设备ID
  42. */
  43. int checkDeviceIsBelongByDeviceId(@Param("userId") String userId, @Param("deviceId") String deviceId);
  44. }