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.ErpSalesOrganizationPageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpSalesOrganizationDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * ERP销售组织 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ErpSalesOrganizationMapper extends BaseMapperX<ErpSalesOrganizationDO> {

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

}