package com.cico.nest.lcdp.boot.core.qxsd.infrastructure.gatewayimpl.database;

import java.util.*;

import com.cico.nest.lcdp.boot.core.qxsd.adapter.web.vo.tunnelPassage.TunnelPassagePageReqVO;
import com.cico.nest.lcdp.boot.core.qxsd.infrastructure.gatewayimpl.database.dataobject.TunnelPassageDO;
import com.cico.nest.lcdp.framework.common.pojo.PageResult;
import com.cico.nest.lcdp.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cico.nest.lcdp.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 隧道横通道 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface TunnelPassageMapper extends BaseMapperX<TunnelPassageDO> {

    default PageResult<TunnelPassageDO> selectPage(TunnelPassagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TunnelPassageDO>()
                .eqIfPresent(TunnelPassageDO::getTunnelId, reqVO.getTunnelId())
                .eqIfPresent(TunnelPassageDO::getType, reqVO.getType())
                .likeIfPresent(TunnelPassageDO::getName, reqVO.getName())
                .eqIfPresent(TunnelPassageDO::getRightHole, reqVO.getRightHole())
                .eqIfPresent(TunnelPassageDO::getLeftHole, reqVO.getLeftHole())
                .eqIfPresent(TunnelPassageDO::getWidth, reqVO.getWidth())
                .eqIfPresent(TunnelPassageDO::getHeight, reqVO.getHeight())
                .betweenIfPresent(TunnelPassageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TunnelPassageDO::getId));
    }

}
