TsbDeviceMapper.java 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.ruoyi.device.mapper;
  2. import com.ruoyi.device.domain.entity.TsbDevice;
  3. import com.ruoyi.device.domain.vo.TsbDeviceHomeVo;
  4. import java.util.List;
  5. /**
  6. * 调试宝设备表 tsb_device 数据访问层
  7. *
  8. * @author lwm
  9. */
  10. public interface TsbDeviceMapper
  11. {
  12. /**
  13. * 条件分页查询设备列表(仅 del_flag = 0)
  14. * 条件含:deviceId、imei(模糊)、deviceType、deviceSn、status;
  15. * 扩展请求参数:params.beginProduceDate、params.endProduceDate(yyyy-MM-dd,按 device_produce_date 日期闭区间)
  16. *
  17. * @param tsbDevice 查询条件,字段可为空;日期范围放在 BaseEntity.params 中
  18. * @return 设备列表
  19. */
  20. List<TsbDevice> selectTsbDeviceList(TsbDevice tsbDevice);
  21. /**
  22. * 首页设备卡片列表(含绑定用户、部门)
  23. */
  24. List<TsbDeviceHomeVo> selectTsbDeviceHomeList(TsbDevice tsbDevice);
  25. /**
  26. * 按 SN码 查询当前用户有操作权限的设备
  27. */
  28. TsbDevice selectAccessibleDeviceBySn(TsbDevice tsbDevice);
  29. /**
  30. * 按主键查询未删除的设备
  31. *
  32. * @param deviceId 设备主键
  33. * @return 设备实体,不存在或已逻辑删除时返回 null
  34. */
  35. TsbDevice selectTsbDeviceById(Long deviceId);
  36. /**
  37. * 按 IMEI 精确查询未删除的设备
  38. *
  39. * @param imei 设备 IMEI
  40. * @return 设备实体
  41. */
  42. TsbDevice selectTsbDeviceByImei(String imei);
  43. /**
  44. * 按设备 SN 精确查询未删除的设备
  45. *
  46. * @param deviceSn 设备 SN 码
  47. * @return 设备实体
  48. */
  49. TsbDevice selectTsbDeviceByDeviceSn(Long deviceSn);
  50. /**
  51. * IMEI 唯一性校验:在「未删除」设备中是否存在相同 IMEI
  52. *
  53. * @param imei IMEI
  54. * @return 设备信息
  55. */
  56. TsbDevice checkImeiUnique(String imei);
  57. /**
  58. * 设备 SN 唯一性校验:在「未删除」设备中是否存在相同 device_sn
  59. *
  60. * @param deviceSn 设备 SN 码
  61. * @return 设备信息
  62. */
  63. TsbDevice checkDeviceSnUnique(Long deviceSn);
  64. /**
  65. * 新增设备,主键回填至实体 deviceId
  66. *
  67. * @param tsbDevice 设备实体
  68. * @return 影响行数
  69. */
  70. int insertTsbDevice(TsbDevice tsbDevice);
  71. /**
  72. * 按主键更新设备(仅更新非空字段,且要求 del_flag = 0)
  73. *
  74. * @param tsbDevice 设备实体,须含 deviceId
  75. * @return 影响行数
  76. */
  77. int updateTsbDevice(TsbDevice tsbDevice);
  78. /**
  79. * 批量逻辑删除:del_flag 置为 2
  80. *
  81. * @param deviceIds 设备主键数组
  82. * @return 影响行数
  83. */
  84. int deleteTsbDeviceByIds(Long[] deviceIds);
  85. }