package cn.iocoder.yudao.module.safe.dal.mysql.camera;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.safe.dal.dataobject.camera.SafeCameraDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.safe.controller.admin.camera.vo.*;

/**
 * 安防前端设备 Mapper
 *
 * @author caoyang
 */
@Mapper
public interface SafeCameraMapper extends BaseMapperX<SafeCameraDO> {

    default PageResult<SafeCameraDO> selectPage(AppSafeCameraPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SafeCameraDO>()
                .likeIfPresent(SafeCameraDO::getName, reqVO.getName())
                .eqIfPresent(SafeCameraDO::getCode, reqVO.getCode())
                .eqIfPresent(SafeCameraDO::getType, reqVO.getType())
                .eqIfPresent(SafeCameraDO::getServerId, reqVO.getServerId())
                .likeIfPresent(SafeCameraDO::getDes, reqVO.getDes())
                .orderByDesc(SafeCameraDO::getId));
    }

}
