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


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.controller.app.sharelinkregister.vo.AppShareLinkRegisterPageReqVO;
import cn.newfeifan.mall.module.distri.dal.dataobject.sharelinkregister.ShareLinkRegisterDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 通过分享链接，新注册用户 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ShareLinkRegisterMapper extends BaseMapperX<ShareLinkRegisterDO> {

    default PageResult<ShareLinkRegisterDO> selectPage(AppShareLinkRegisterPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShareLinkRegisterDO>()
                .eqIfPresent(ShareLinkRegisterDO::getDistriShareLinkId, reqVO.getDistriShareLinkId())
                .eqIfPresent(ShareLinkRegisterDO::getRegisterUserId, reqVO.getRegisterUserId())
                .betweenIfPresent(ShareLinkRegisterDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShareLinkRegisterDO::getId));
    }

}