package cn.iocoder.yudao.module.mes.dal.mysql.goview;

import java.util.*;

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.mes.dal.dataobject.goview.GoviewDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.goview.vo.*;

/**
 * 可视化大屏 Mapper
 *
 * @author 必硕科技
 */
@Mapper
public interface GoviewMapper extends BaseMapperX<GoviewDO> {

    default PageResult<GoviewDO> selectPage(GoviewPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GoviewDO>()
                .likeIfPresent(GoviewDO::getName, reqVO.getName())
                .eqIfPresent(GoviewDO::getRemark, reqVO.getRemark())
                .eqIfPresent(GoviewDO::getState, reqVO.getState())
                .eqIfPresent(GoviewDO::getIndexImage, reqVO.getIndexImage())
                .eqIfPresent(GoviewDO::getRoute, reqVO.getRoute())
                .betweenIfPresent(GoviewDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(GoviewDO::getContent, reqVO.getContent())
                .eqIfPresent(GoviewDO::getOrgId, reqVO.getOrgId())
                .likeIfPresent(GoviewDO::getOrgName, reqVO.getOrgName())
                .eqIfPresent(GoviewDO::getType, reqVO.getType())
                .eqIfPresent(GoviewDO::getDeviceIds, reqVO.getDeviceIds())
                .orderByDesc(GoviewDO::getId));
    }

}