package com.zt.plat.module.qms.office.supplier.dal.mapper;

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.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 供应商评价关系 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface SupplierEvaluationAtMapper extends BaseMapperX<SupplierEvaluationAtDO> {

    default PageResult<SupplierEvaluationAtDO> selectPage(SupplierEvaluationAtPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SupplierEvaluationAtDO>()
                .eqIfPresent(SupplierEvaluationAtDO::getSupplierEvaluationId, reqVO.getSupplierEvaluationId())
                .eqIfPresent(SupplierEvaluationAtDO::getTargetId, reqVO.getTargetId())
                .eqIfPresent(SupplierEvaluationAtDO::getTargetType, reqVO.getTargetType())
                .eqIfPresent(SupplierEvaluationAtDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(SupplierEvaluationAtDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(SupplierEvaluationAtDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SupplierEvaluationAtDO::getId));
    }

}