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

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

/**
 * 模具上下模 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface MoldOperateMapper extends BaseMapperX<MoldOperateDO> {

    default PageResult<MoldOperateDO> selectPage(MoldOperatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoldOperateDO>()
                .eqIfPresent(MoldOperateDO::getOperateType, reqVO.getOperateType())
                .eqIfPresent(MoldOperateDO::getMoldId, reqVO.getMoldId())
                .eqIfPresent(MoldOperateDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(MoldOperateDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(MoldOperateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoldOperateDO::getId));
    }

}