Jay
2024-11-25 ee9f604388a3e77d3f4654e326f3976552e7f532
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.iailab.module.data.video.dao;
 
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.video.controller.admin.camera.vo.CameraPageReqVO;
import com.iailab.module.data.video.dto.CameraDTO;
import com.iailab.module.data.video.entity.CameraEntity;
import org.apache.ibatis.annotations.Mapper;
 
import java.util.List;
 
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年02月27日
 */
@TenantDS
@Mapper
public interface CameraDao extends BaseMapperX<CameraEntity> {
 
    default PageResult<CameraEntity> selectPage(CameraPageReqVO pageReqVO) {
        return selectPage(pageReqVO, new LambdaQueryWrapperX<CameraEntity>()
                .eqIfPresent(CameraEntity::getNvrId, pageReqVO.getNvrId())
                .eqIfPresent(CameraEntity::getBrand, pageReqVO.getBrand())
                .eqIfPresent(CameraEntity::getType, pageReqVO.getType())
                .likeIfPresent(CameraEntity::getCode, pageReqVO.getCode())
                .likeIfPresent(CameraEntity::getIp, pageReqVO.getIp())
                .likeIfPresent(CameraEntity::getDevice, pageReqVO.getDevice())
                .likeIfPresent(CameraEntity::getLocation, pageReqVO.getLocation())
                .orderByDesc(CameraEntity::getId));
    }
 
    List<CameraDTO> apiCameraList();
 
}