package com.zt.plat.module.qms.business.config.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.business.config.controller.vo.*;
import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardForecastProjectPageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardForecastProjectDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 物料检测标准来样品位配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface MaterialAssayStandardForecastProjectMapper extends BaseMapperX<MaterialAssayStandardForecastProjectDO> {

    default PageResult<MaterialAssayStandardForecastProjectDO> selectPage(MaterialAssayStandardForecastProjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaterialAssayStandardForecastProjectDO>()
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getMaterialAssayStandardId, reqVO.getMaterialAssayStandardId())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDictionaryProjectCode, reqVO.getDictionaryProjectCode())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getUnitId, reqVO.getUnitId())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getUnit, reqVO.getUnit())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDataType, reqVO.getDataType())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDecimalPosition, reqVO.getDecimalPosition())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getIsDefault, reqVO.getIsDefault())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(MaterialAssayStandardForecastProjectDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(MaterialAssayStandardForecastProjectDO::getRemark, reqVO.getRemark())
                .orderByDesc(MaterialAssayStandardForecastProjectDO::getId));
    }

}