package cn.iocoder.yudao.module.bpm.dal.mysql.oa;

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.bpm.controller.admin.oa.vo.supplier.BpmOASupplierPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * OA供应商审核 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface BpmOASupplierMapper extends BaseMapperX<BpmOASupplierDO> {

    default PageResult<BpmOASupplierDO> selectPage(BpmOASupplierPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BpmOASupplierDO>()
                .eqIfPresent(BpmOASupplierDO::getUserId, reqVO.getUserId())
                .eqIfPresent(BpmOASupplierDO::getSupplierId, reqVO.getSupplierId())
                .likeIfPresent(BpmOASupplierDO::getSupplierName, reqVO.getSupplierName())
                .eqIfPresent(BpmOASupplierDO::getPhone, reqVO.getPhone())
                .eqIfPresent(BpmOASupplierDO::getContactPerson, reqVO.getContactPerson())
                .eqIfPresent(BpmOASupplierDO::getCompanyAddress, reqVO.getCompanyAddress())
                .eqIfPresent(BpmOASupplierDO::getBusinessLicenseNo, reqVO.getBusinessLicenseNo())
                .betweenIfPresent(BpmOASupplierDO::getSettlementDate, reqVO.getSettlementDate())
                .eqIfPresent(BpmOASupplierDO::getSettlementMethod, reqVO.getSettlementMethod())
                .eqIfPresent(BpmOASupplierDO::getCompanyAccount, reqVO.getCompanyAccount())
                .eqIfPresent(BpmOASupplierDO::getBankAccountOpeningBank, reqVO.getBankAccountOpeningBank())
                .eqIfPresent(BpmOASupplierDO::getFileItems, reqVO.getFileItems())
                .eqIfPresent(BpmOASupplierDO::getResult, reqVO.getResult())
                .eqIfPresent(BpmOASupplierDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .betweenIfPresent(BpmOASupplierDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BpmOASupplierDO::getId));
    }

}
