|
|
@@ -1,13 +1,17 @@ |
|
|
|
package com.tuoheng.admin.service.camera;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.tuoheng.admin.common.ServiceExceptionEnum;
|
|
|
|
import com.tuoheng.admin.entity.domain.Camera;
|
|
|
|
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
|
|
|
|
import com.tuoheng.admin.enums.MarkTypeEnum;
|
|
|
|
import com.tuoheng.admin.mapper.CameraMapper;
|
|
|
|
import com.tuoheng.admin.service.camera.query.QueryCameraListService;
|
|
|
|
import com.tuoheng.admin.utils.GaodeUtil;
|
|
|
|
import com.tuoheng.common.common.BaseServiceImpl;
|
|
|
|
import com.tuoheng.common.common.OperationEnum;
|
|
|
|
import com.tuoheng.common.exception.ServiceException;
|
|
|
|
import com.tuoheng.common.utils.JsonResult;
|
|
|
|
import com.tuoheng.common.utils.StringUtils;
|
|
|
@@ -28,6 +32,9 @@ public class CameraServiceImpl extends BaseServiceImpl<CameraMapper, Camera> imp |
|
|
|
@Autowired
|
|
|
|
private QueryCameraListService queryCameraListService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private CameraMapper cameraMapper;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询摄像头列表
|
|
|
|
*
|
|
|
@@ -79,4 +86,20 @@ public class CameraServiceImpl extends BaseServiceImpl<CameraMapper, Camera> imp |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public JsonResult getPage(QueryCameraListRequest request) {
|
|
|
|
if (null == request.getPage() || null == request.getLimit()) {
|
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
|
|
|
|
}
|
|
|
|
// 获取分页数据
|
|
|
|
IPage<Camera> page = new Page<>(request.getPage(), request.getLimit());
|
|
|
|
IPage<Camera> pageData = cameraMapper.selectPage(page, new LambdaQueryWrapper<Camera>()
|
|
|
|
.eq(Camera::getMark, MarkTypeEnum.VALID.getCode())
|
|
|
|
.like(StringUtils.isNotEmpty(request.getCameraName()), Camera::getCameraName, request.getCameraName())
|
|
|
|
.orderByDesc(Camera::getCreateTime));
|
|
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(pageData);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|