分组中添加设备

This commit is contained in:
kerwincui
2022-06-06 15:52:32 +08:00
parent 24f2e65f2b
commit 1f7a127499
6 changed files with 79 additions and 6 deletions

View File

@@ -48,7 +48,19 @@ public class DeviceController extends BaseController
}
/**
* 查询设备简短列表
* 查询分组可添加设备
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/listByGroup")
@ApiOperation("查询分组可添加设备分页列表")
public TableDataInfo listByGroup(Device device)
{
startPage();
return getDataTable(deviceService.selectDeviceListByGroup(device));
}
/**
* 查询设备简短列表,主页列表数据
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/shortList")

View File

@@ -102,9 +102,20 @@ public class Device extends BaseEntity
/** 设备摘要 **/
private String summary;
/** 分组ID用于分组查询 **/
private Long groupId;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
public Long getGroupId() {
return groupId;
}
public void setGroupId(Long groupId) {
this.groupId = groupId;
}
public String getSummary() {
return summary;
}

View File

@@ -85,6 +85,14 @@ public interface DeviceMapper
*/
public List<Device> selectDeviceList(Device device);
/**
* 查询分组可添加设备分页列表
*
* @param device 设备
* @return 设备集合
*/
public List<Device> selectDeviceListByGroup(Device device);
/**
* 查询设备简短列表
*

View File

@@ -71,6 +71,14 @@ public interface IDeviceService
*/
public List<Device> selectDeviceList(Device device);
/**
* 查询分组可添加设备分页列表
*
* @param device 设备
* @return 设备集合
*/
public List<Device> selectDeviceListByGroup(Device device);
/**
* 查询所有设备简短列表
*

View File

@@ -230,6 +230,20 @@ public class DeviceServiceImpl implements IDeviceService {
return deviceMapper.selectDeviceList(device);
}
/**
* 查询分组可添加设备分页列表(分组用户与设备用户匹配)
*
* @param device 设备
* @return 设备
*/
@Override
public List<Device> selectDeviceListByGroup(Device device) {
if(device.getUserId()==null || device.getUserId()==0){
return new ArrayList<>();
}
return deviceMapper.selectDeviceListByGroup(device);
}
/**
* 查询所有设备简短列表
*