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


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.orderspacecapsule.vo.OrderSpaceCapsulePageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.orderspacecapsule.vo.OrderSpaceCapsuleStatisticsComVo;
import cn.iocoder.yudao.module.member.controller.admin.orderspacecapsule.vo.OrderSpaceCapsuleStatisticsVo;
import cn.iocoder.yudao.module.member.controller.admin.statisticsspacecapsuleorder.vo.SpaceCapsuleOrderNameRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.orderspacecapsule.OrderSpaceCapsuleDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * 太空舱订单 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface OrderSpaceCapsuleMapper extends BaseMapperX<OrderSpaceCapsuleDO> {

    default PageResult<OrderSpaceCapsuleDO> selectPage(OrderSpaceCapsulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderSpaceCapsuleDO>()
                .eqIfPresent(OrderSpaceCapsuleDO::getMoney, reqVO.getMoney())
                .eqIfPresent(OrderSpaceCapsuleDO::getSpaceCapsuleId, reqVO.getSpaceCapsuleId())
                .eqIfPresent(OrderSpaceCapsuleDO::getCarteenId, reqVO.getCarteenId())
                .eqIfPresent(OrderSpaceCapsuleDO::getStatus, reqVO.getStatus())
                .eqIfPresent(OrderSpaceCapsuleDO::getComboPrice, reqVO.getComboPrice())
                .eqIfPresent(OrderSpaceCapsuleDO::getComboMinutes, reqVO.getComboMinutes())
                .likeIfPresent(OrderSpaceCapsuleDO::getComboPackageName, reqVO.getComboPackageName())
                .betweenIfPresent(OrderSpaceCapsuleDO::getOrderStartTime, reqVO.getOrderStartTime())
                .betweenIfPresent(OrderSpaceCapsuleDO::getOrderEndTime, reqVO.getOrderEndTime())
                .betweenIfPresent(OrderSpaceCapsuleDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OrderSpaceCapsuleDO::getUserId, reqVO.getUserId())
                .eqIfPresent(OrderSpaceCapsuleDO::getStartMoney, reqVO.getStartMoney())
                .eqIfPresent(OrderSpaceCapsuleDO::getEndMoney, reqVO.getEndMoney())
                .likeIfPresent(OrderSpaceCapsuleDO::getPhone, reqVO.getPhone())
                .eqIfPresent(OrderSpaceCapsuleDO::getPayNum, reqVO.getPayNum())
                .eqIfPresent(OrderSpaceCapsuleDO::getBillingExist, reqVO.getBillingExist())
                .eqIfPresent(OrderSpaceCapsuleDO::getPayMethods, reqVO.getPayMethods())
                .eqIfPresent(OrderSpaceCapsuleDO::getPayMethods, reqVO.getPayMethods())
                .orderByDesc(OrderSpaceCapsuleDO::getId));
    }
    OrderSpaceCapsuleStatisticsVo compDay(@Param("status")Integer status,@Param("start") Date start,@Param("end") Date end,@Param("carteenId")Long carteenId);
    SpaceCapsuleOrderNameRespVO compDay1(@Param("status")Integer status, @Param("start") Date start, @Param("end") Date end,@Param("spId")Long spId);
    OrderSpaceCapsuleStatisticsComVo compMoney(@Param("start") Date start, @Param("end") Date end);
    Integer updateByIdBillingExist (@Param("ids") Set<Long> ids, @Param("exist")Boolean exist);
    Integer updateByIdBillingNum (@Param("ids") Set<Long> ids, @Param("num")String num);
}