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

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.itemrequisition.ItemRequisitionDetailDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.paigongrecord.PaigongRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.paigongrecord.vo.*;

/**
 * 计划派工记录 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface PaigongRecordMapper extends BaseMapperX<PaigongRecordDO> {

    default PageResult<PaigongRecordDO> selectPage(PaigongRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PaigongRecordDO>()
                .eqIfPresent(PaigongRecordDO::getPlanId, reqVO.getPlanId())
                .eqIfPresent(PaigongRecordDO::getPipeline, reqVO.getPipeline())
                .eqIfPresent(PaigongRecordDO::getPaigongNum, reqVO.getPaigongNum())
                .eqIfPresent(PaigongRecordDO::getIsPreProduction, reqVO.getIsPreProduction())
                .betweenIfPresent(PaigongRecordDO::getPaigongTime, reqVO.getPaigongTime())
                .betweenIfPresent(PaigongRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PaigongRecordDO::getId));
    }

    default List<PaigongRecordDO> selectListByPlanId(Long planId) {
        return selectList(PaigongRecordDO::getPlanId, planId);
    }


}