package com.zt.plat.module.erp.dal.mysql.erp;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpPurchaseOrganizationPageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpPurchaseOrganizationDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * ERP采购组织 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ErpPurchaseOrganizationMapper extends BaseMapperX<ErpPurchaseOrganizationDO> {

    default PageResult<ErpPurchaseOrganizationDO> selectPage(ErpPurchaseOrganizationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ErpPurchaseOrganizationDO>()
                .likeIfPresent(ErpPurchaseOrganizationDO::getNumber, reqVO.getNumber())
                .likeIfPresent(ErpPurchaseOrganizationDO::getName, reqVO.getName())
                .likeIfPresent(ErpPurchaseOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
                .orderByDesc(ErpPurchaseOrganizationDO::getId));
    }

}