package cn.newfeifan.mall.module.distri.dal.mysql.source;

import java.util.*;

import cn.newfeifan.mall.framework.common.pojo.PageResult;
import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
import cn.newfeifan.mall.module.distri.dal.dataobject.source.SourceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.distri.controller.admin.source.vo.*;

/**
 * 分销来源 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface SourceMapper extends BaseMapperX<SourceDO> {

    default PageResult<SourceDO> selectPage(SourcePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SourceDO>()
                .likeIfPresent(SourceDO::getName, reqVO.getName())
                .betweenIfPresent(SourceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SourceDO::getId));
    }

}