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

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

/**
 * 用户充值消费分订单 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface UserTopUpConsumptionPointsOrderMapper extends BaseMapperX<UserTopUpConsumptionPointsOrderDO> {

    default PageResult<UserTopUpConsumptionPointsOrderDO> selectPage(UserTopUpConsumptionPointsOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserTopUpConsumptionPointsOrderDO>()
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getNo, reqVO.getNo())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getTerminal, reqVO.getTerminal())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getUserIp, reqVO.getUserIp())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getSubject, reqVO.getSubject())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getTopUpConsumptionPoints, reqVO.getTopUpConsumptionPoints())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getPracticalConsumptionPoints, reqVO.getPracticalConsumptionPoints())
                .likeIfPresent(UserTopUpConsumptionPointsOrderDO::getUserName, reqVO.getUserName())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getPayOrderId, reqVO.getPayOrderId())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getPayStatus, reqVO.getPayStatus())
                .betweenIfPresent(UserTopUpConsumptionPointsOrderDO::getPayTime, reqVO.getPayTime())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getPayChannelCode, reqVO.getPayChannelCode())
                .betweenIfPresent(UserTopUpConsumptionPointsOrderDO::getFinishTime, reqVO.getFinishTime())
                .betweenIfPresent(UserTopUpConsumptionPointsOrderDO::getCancelTime, reqVO.getCancelTime())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getPayPrice, reqVO.getPayPrice())
                .eqIfPresent(UserTopUpConsumptionPointsOrderDO::getPercentTemplate, reqVO.getPercentTemplate())
                .betweenIfPresent(UserTopUpConsumptionPointsOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserTopUpConsumptionPointsOrderDO::getId));
    }

}