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

import java.util.*;

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

/**
 * 平台每日结算信息表，记录店铺的结算信息 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface PtSettlementMapper extends BaseMapperX<PtSettlementDO> {

    default PageResult<PtSettlementDO> selectPage(PtSettlementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PtSettlementDO>()
                .eqIfPresent(PtSettlementDO::getPlatformCollectionAmount, reqVO.getPlatformCollectionAmount())
                .eqIfPresent(PtSettlementDO::getShopAmount, reqVO.getShopAmount())
                .eqIfPresent(PtSettlementDO::getPlatformTransferConfirm, reqVO.getPlatformTransferConfirm())
                .eqIfPresent(PtSettlementDO::getShopTotalHighAmount, reqVO.getShopTotalHighAmount())
                .betweenIfPresent(PtSettlementDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PtSettlementDO::getId));
    }

}