package com.yc.ship.module.ota.dal.mysql.distributorcategory;


import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.ota.controller.admin.distributorcategory.vo.DistributorCategoryPageReqVO;
import com.yc.ship.module.ota.dal.dataobject.distributorcategory.DistributorCategoryDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 供应商分类 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DistributorCategoryMapper extends BaseMapperX<DistributorCategoryDO> {

    default PageResult<DistributorCategoryDO> selectPage(DistributorCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DistributorCategoryDO>()
                .eqIfPresent(DistributorCategoryDO::getCateCode, reqVO.getCateCode())
                .likeIfPresent(DistributorCategoryDO::getCateName, reqVO.getCateName())
                .eqIfPresent(DistributorCategoryDO::getSortNum, reqVO.getSortNum())
                .eqIfPresent(DistributorCategoryDO::getUseStatus, reqVO.getUseStatus())
                .betweenIfPresent(DistributorCategoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DistributorCategoryDO::getId));
    }

}