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


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.carteenmoney.vo.CarteenMoneyPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.carteenmoney.CarteenMoneyDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 门店流水 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface CarteenMoneyMapper extends BaseMapperX<CarteenMoneyDO> {

    default PageResult<CarteenMoneyDO> selectPage(CarteenMoneyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CarteenMoneyDO>()
                .eqIfPresent(CarteenMoneyDO::getCarteenId, reqVO.getCarteenId())
                .likeIfPresent(CarteenMoneyDO::getCarteenName, reqVO.getCarteenName())
                .eqIfPresent(CarteenMoneyDO::getSuccessMoney, reqVO.getSuccessMoney())
                .eqIfPresent(CarteenMoneyDO::getErrorMoney, reqVO.getErrorMoney())
                .eqIfPresent(CarteenMoneyDO::getEstimateMoney, reqVO.getEstimateMoney())
                .eqIfPresent(CarteenMoneyDO::getSumMoney, reqVO.getSumMoney())
                .eqIfPresent(CarteenMoneyDO::getTotalCost, reqVO.getTotalCost())
                .eqIfPresent(CarteenMoneyDO::getTotalProfit, reqVO.getTotalProfit())
                .betweenIfPresent(CarteenMoneyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CarteenMoneyDO::getId));
    }

}