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

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

/**
 * 模具维保 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface MoldRecordMapper extends BaseMapperX<MoldRecordDO> {

    default PageResult<MoldRecordDO> selectPage(MoldRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoldRecordDO>()
                .eqIfPresent(MoldRecordDO::getFlowCode, reqVO.getFlowCode())
                .eqIfPresent(MoldRecordDO::getBrandId, reqVO.getBrandId())
                .eqIfPresent(MoldRecordDO::getMoldId, reqVO.getMoldId())
                .eqIfPresent(MoldRecordDO::getOldMoldId, reqVO.getOldMoldId())
                .eqIfPresent(MoldRecordDO::getMachineId, reqVO.getMachineId())
                .eqIfPresent(MoldRecordDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MoldRecordDO::getRecordType, reqVO.getRecordType())
                .eqIfPresent(MoldRecordDO::getRecordStatus, reqVO.getRecordStatus())
                .eqIfPresent(MoldRecordDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(MoldRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoldRecordDO::getId));
    }

}