package cn.iocoder.yudao.module.smartfactory.dal.mysql.screenfactoryextra;

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.smartfactory.controller.admin.screenfactoryextra.vo.ScreenFactoryExtraPageReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.screenfactoryextra.ScreenFactoryExtraDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 工厂大屏额外字段 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface ScreenFactoryExtraMapper extends BaseMapperX<ScreenFactoryExtraDO> {

    default PageResult<ScreenFactoryExtraDO> selectPage(ScreenFactoryExtraPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ScreenFactoryExtraDO>()
                .eqIfPresent(ScreenFactoryExtraDO::getFactoryId, reqVO.getFactoryId())
                .eqIfPresent(ScreenFactoryExtraDO::getDateNum, reqVO.getDateNum())
                .eqIfPresent(ScreenFactoryExtraDO::getTruckOnNum, reqVO.getTruckOnNum())
                .eqIfPresent(ScreenFactoryExtraDO::getTruckOffNum, reqVO.getTruckOffNum())
                .eqIfPresent(ScreenFactoryExtraDO::getTruckTotalNum, reqVO.getTruckTotalNum())
                .eqIfPresent(ScreenFactoryExtraDO::getYlNum, reqVO.getYlNum())
                .eqIfPresent(ScreenFactoryExtraDO::getDbxNum, reqVO.getDbxNum())
                .eqIfPresent(ScreenFactoryExtraDO::getTpNum, reqVO.getTpNum())
                .eqIfPresent(ScreenFactoryExtraDO::getBdNum, reqVO.getBdNum())
                .eqIfPresent(ScreenFactoryExtraDO::getWorkerNum, reqVO.getWorkerNum())
                .eqIfPresent(ScreenFactoryExtraDO::getVehicleNum, reqVO.getVehicleNum())
                .betweenIfPresent(ScreenFactoryExtraDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ScreenFactoryExtraDO::getId));
    }

}