|
@@ -60,11 +60,12 @@ public class CameraServiceImpl extends ServiceImpl<CameraMapper, Camera> impleme
|
|
|
Integer brandId = cameraListVo.getBrandId();
|
|
|
Integer sort = cameraListVo.getSort();
|
|
|
Integer farmId = cameraListVo.getFarmId();
|
|
|
+ Integer isOnline = cameraListVo.getIsOnline();
|
|
|
|
|
|
QueryWrapper<Camera> wrapper = new QueryWrapper<>();
|
|
|
if (StringUtils.isNotBlank(strchStr)) {
|
|
|
- wrapper.like("camera_name", strchStr)
|
|
|
- .or().like("camera_ip", strchStr);
|
|
|
+ wrapper.and(i -> i.like("camera_name", strchStr)
|
|
|
+ .or().like("camera_ip", strchStr));
|
|
|
}
|
|
|
|
|
|
if (farmId != null) {
|
|
@@ -79,7 +80,9 @@ public class CameraServiceImpl extends ServiceImpl<CameraMapper, Camera> impleme
|
|
|
wrapper.eq("brand_id", brandId);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ if (isOnline != null) {
|
|
|
+ wrapper.eq("is_online", isOnline);
|
|
|
+ }
|
|
|
|
|
|
if (sort == null) {
|
|
|
wrapper.orderByDesc("id");
|
|
@@ -88,10 +91,7 @@ public class CameraServiceImpl extends ServiceImpl<CameraMapper, Camera> impleme
|
|
|
} else {
|
|
|
wrapper.orderByAsc("sort");
|
|
|
}
|
|
|
-
|
|
|
wrapper.orderByDesc("id");
|
|
|
-
|
|
|
-
|
|
|
return new Result(ResultCode.SUCCESS, page(new Page<>(current, size), wrapper));
|
|
|
}
|
|
|
|