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

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.socialstatus.SocialStatusDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.distri.controller.admin.socialstatus.vo.*;

/**
 * 分销用户身价 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface SocialStatusMapper extends BaseMapperX<SocialStatusDO> {

    default PageResult<SocialStatusDO> selectPage(SocialStatusPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SocialStatusDO>()
                .eqIfPresent(SocialStatusDO::getLevel, reqVO.getLevel())
                .likeIfPresent(SocialStatusDO::getName, reqVO.getName())
                .betweenIfPresent(SocialStatusDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(SocialStatusDO::getPoint, reqVO.getPoint())
                .orderByDesc(SocialStatusDO::getId));
    }

}