package com.cf.imes.module.system.dal.mysql.machine;

import java.util.*;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.module.system.controller.admin.machine.vo.MachinePageReqVO;
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 机台 Mapper
 *
 * @author 晨丰科技
 */
@Mapper
public interface MachineMapper extends BaseMapperX<MachineDO> {

    default PageResult<MachineDO> selectPage(MachinePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MachineDO>()
                .likeIfPresent(MachineDO::getName, reqVO.getName())
                .eqIfPresent(MachineDO::getMachineType, reqVO.getMachineType())
                .betweenIfPresent(MachineDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MachineDO::getCreateTime));
    }

}