package cn.iocoder.yudao.module.pms.dal.mysql.iotwebtopoproject;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pms.controller.admin.iotwebtopoproject.vo.IotWebtopoProjectPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotwebtopoproject.IotWebtopoProjectDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 组态项目列 Mapper
 *
 * @author ruiqi
 */
@Mapper
public interface IotWebtopoProjectMapper extends BaseMapperX<IotWebtopoProjectDO> {

    default PageResult<IotWebtopoProjectDO> selectPage(IotWebtopoProjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotWebtopoProjectDO>()
                .eqIfPresent(IotWebtopoProjectDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(IotWebtopoProjectDO::getProjectId, reqVO.getProjectId())
                .likeIfPresent(IotWebtopoProjectDO::getProjectName, reqVO.getProjectName())
                .eqIfPresent(IotWebtopoProjectDO::getThumbnail, reqVO.getThumbnail())
                .eqIfPresent(IotWebtopoProjectDO::getDataModel, reqVO.getDataModel())
                .eqIfPresent(IotWebtopoProjectDO::getSort, reqVO.getSort())
                .eqIfPresent(IotWebtopoProjectDO::getRemark, reqVO.getRemark())
                .eqIfPresent(IotWebtopoProjectDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(IotWebtopoProjectDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotWebtopoProjectDO::getId));
    }

}