package cn.iocoder.yudao.module.member.dal.mysql.user;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberPointsPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberPointsDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 会员用户积分 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface MemberPointsMapper extends BaseMapperX<MemberPointsDO> {

    default PageResult<MemberPointsDO> selectPage(MemberPointsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointsDO>()
                .eqIfPresent(MemberPointsDO::getMemberUserId, reqVO.getMemberUserId())
                .eqIfPresent(MemberPointsDO::getOrgType,reqVO.getOrgType())
                .eqIfPresent(MemberPointsDO::getTenantId,reqVO.getTenantId())
                .likeIfPresent(MemberPointsDO::getMemberUserName, reqVO.getMemberUserName())
                .eqIfPresent(MemberPointsDO::getOrgType, reqVO.getOrgType())
                .orderByDesc(MemberPointsDO::getCreatedTime));
    }

}