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


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

/**
 * 每日用户获得合赢奖记录 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface DailyAwardRecordsMapper extends BaseMapperX<DailyAwardRecordsDO> {

    default PageResult<DailyAwardRecordsDO> selectPage(DailyAwardRecordsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DailyAwardRecordsDO>()
                .eqIfPresent(DailyAwardRecordsDO::getUserId, reqVO.getUserId())
                .eqIfPresent(DailyAwardRecordsDO::getAmount, reqVO.getAmount())
                .eqIfPresent(DailyAwardRecordsDO::getSettled, reqVO.getSettled())
                .orderByDesc(DailyAwardRecordsDO::getId));
    }

}