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

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

/**
 * 模具管理-领模申请 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface MoldGetMapper extends BaseMapperX<MoldGetDO> {

    default PageResult<MoldGetDO> selectPage(MoldGetPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoldGetDO>()
                .eqIfPresent(MoldGetDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(MoldGetDO::getMoldId, reqVO.getMoldId())
                .likeIfPresent(MoldGetDO::getName, reqVO.getMoldName())
                .eqIfPresent(MoldGetDO::getState, reqVO.getState())
                .eqIfPresent(MoldGetDO::getPerson, reqVO.getPerson())
                .eqIfPresent(MoldGetDO::getDeviceId, reqVO.getDeviceId())
                .likeIfPresent(MoldGetDO::getDeviceName, reqVO.getDeviceName())
                .betweenIfPresent(MoldGetDO::getGetTime, reqVO.getGetTime())
                .eqIfPresent(MoldGetDO::getPrincipal, reqVO.getPrincipal())
                .eqIfPresent(MoldGetDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(MoldGetDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoldGetDO::getId));
    }

}