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

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.activityawards.vo.ActivityAwardsPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.activityawards.ActivityAwardsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 活动奖项 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface ActivityAwardsMapper extends BaseMapperX<ActivityAwardsDO> {

    default PageResult<ActivityAwardsDO> selectPage(ActivityAwardsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityAwardsDO>()
                .eqIfPresent(ActivityAwardsDO::getActivityId, reqVO.getActivityId())
                .likeIfPresent(ActivityAwardsDO::getAwardsName, reqVO.getAwardsName())
                .eqIfPresent(ActivityAwardsDO::getAwardsNum, reqVO.getAwardsNum())
                .eqIfPresent(ActivityAwardsDO::getPrize, reqVO.getPrize())
                .eqIfPresent(ActivityAwardsDO::getSortNum, reqVO.getSortNum())
                .betweenIfPresent(ActivityAwardsDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(ActivityAwardsDO::getSortNum));
    }

}