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

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

/**
 * 平台利润 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface PtProfitMapper extends BaseMapperX<PtProfitDO> {

    default PageResult<PtProfitDO> selectPage(PtProfitPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PtProfitDO>()
                .eqIfPresent(PtProfitDO::getPtAdd, reqVO.getPtAdd())
                .eqIfPresent(PtProfitDO::getPtGrossAdd, reqVO.getPtGrossAdd())
                .eqIfPresent(PtProfitDO::getPtTotalAdd, reqVO.getPtTotalAdd())
                .betweenIfPresent(PtProfitDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PtProfitDO::getId));
    }

}