package com.zt.plat.module.contractorder.dal.mysql.originalmaterialprocessing;

import java.util.*;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.controller.admin.originalmaterialprocessing.vo.OriginalMaterialProcessingDetailPageReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.originalmaterialprocessing.OriginalMaterialProcessingDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 来料加工订单明细 Mapper
 *
 * @author 易门采购员测试账号
 */
@Mapper
public interface OriginalMaterialProcessingDetailMapper extends BaseMapperX<OriginalMaterialProcessingDetailDO> {

    default PageResult<OriginalMaterialProcessingDetailDO> selectPage(OriginalMaterialProcessingDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OriginalMaterialProcessingDetailDO>()
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getOrderId, reqVO.getOrderId())
                .likeIfPresent(OriginalMaterialProcessingDetailDO::getReceiveFactoryName, reqVO.getReceiveFactoryName())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getReceiveFactoryNumber, reqVO.getReceiveFactoryNumber())
                .likeIfPresent(OriginalMaterialProcessingDetailDO::getReceiveWarehouseName, reqVO.getReceiveWarehouseName())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getReceiveWarehouseNumber, reqVO.getReceiveWarehouseNumber())
                .likeIfPresent(OriginalMaterialProcessingDetailDO::getSendFactoryName, reqVO.getSendFactoryName())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getSendFactoryNumber, reqVO.getSendFactoryNumber())
                .likeIfPresent(OriginalMaterialProcessingDetailDO::getSendWarehouseName, reqVO.getSendWarehouseName())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getSendWarehouseNumber, reqVO.getSendWarehouseNumber())
                .likeIfPresent(OriginalMaterialProcessingDetailDO::getMaterialName, reqVO.getMaterialName())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getMaterialNumber, reqVO.getMaterialNumber())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getUnit, reqVO.getUnit())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getForecastQuantity, reqVO.getForecastQuantity())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getInTaxUnitPrice, reqVO.getInTaxUnitPrice())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getTaxNumber, reqVO.getTaxNumber())
                .betweenIfPresent(OriginalMaterialProcessingDetailDO::getDeliveryCargoBeginDate, reqVO.getDeliveryCargoBeginDate())
                .betweenIfPresent(OriginalMaterialProcessingDetailDO::getDeliveryCargoEndDate, reqVO.getDeliveryCargoEndDate())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getIsEnable, reqVO.getIsEnable())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getShortText, reqVO.getShortText())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getTaxCategory, reqVO.getTaxCategory())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getProjectCategory, reqVO.getProjectCategory())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getShippingPlace, reqVO.getShippingPlace())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getMaterialAssignGroup, reqVO.getMaterialAssignGroup())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getGross, reqVO.getGross())
                .likeIfPresent(OriginalMaterialProcessingDetailDO::getMetalElementName, reqVO.getMetalElementName())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getMetalElementAbbreviation, reqVO.getMetalElementAbbreviation())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getRemark, reqVO.getRemark())
                .eqIfPresent(OriginalMaterialProcessingDetailDO::getPriceCondition, reqVO.getPriceCondition())
                .betweenIfPresent(OriginalMaterialProcessingDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OriginalMaterialProcessingDetailDO::getId));
    }

}