From 3856546cb4a0fddaa788a5835ec409aedee4ed9c Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Fri, 2 Feb 2024 11:47:08 +0800 Subject: [PATCH] DDDDD---SP --- .../DevopsDeviceInfoController.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java index ab936d8..6962638 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java @@ -23,7 +23,9 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; /** * 智能设备信息表(DevopsDeviceInfo)Controller @@ -112,9 +114,29 @@ public class DevopsDeviceInfoController extends BaseController { List list = devopsDeviceInfoService.list(new QueryWrapper<>(devopsDeviceInfo)); return getDataTable(list); } - // LambdaQueryWrapper devopsDeviceInfoQueryWrapper = new LambdaQueryWrapper<>(devopsDeviceInfo); -// devopsDeviceInfoQueryWrapper.in(DevopsDeviceInfo::getGbsChannelNo,strings); -// List list = devopsDeviceInfoService.list(devopsDeviceInfoQueryWrapper); + + @GetMapping("/typeOne") + @ApiOperation("查询智能一级") + public TableDataInfo OnelevelList( + @RequestParam Integer isDoorwayVideo, + @RequestParam String deviceType // 使用逗号分隔的字符串 + ) { + startPage(); + + // 将逗号分隔的字符串转为整数列表 + List deviceTypeList = Arrays.stream(deviceType.split(",")) + .map(Integer::parseInt) + .collect(Collectors.toList()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("is_doorway_video", isDoorwayVideo) + .in("device_type", deviceTypeList); + + List list = devopsDeviceInfoService.list(queryWrapper); + return getDataTable(list); + } + + @PostMapping @ApiOperation("新增智能设备信息表") @Log(title = "智能设备信息表", businessType = BusinessType.INSERT)