package cn.newfeifan.mall.module.trade.dal.mysql.shopsettlement;


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.trade.dal.dataobject.shopsettlement.ShopSettlementDO;
import org.apache.ibatis.annotations.Mapper;
import cn.newfeifan.mall.module.trade.controller.app.shopsettlement.vo.*;

/**
 * 订单结算信息表，记录店铺的结算信息 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ShopSettlementMapper extends BaseMapperX<ShopSettlementDO> {

    default PageResult<ShopSettlementDO> selectPage(AppShopSettlementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopSettlementDO>()
                .eqIfPresent(ShopSettlementDO::getShopId, reqVO.getShopId())
                .eqIfPresent(ShopSettlementDO::getMerchantId, reqVO.getMerchantId())
                .eqIfPresent(ShopSettlementDO::getPlatformCollectionAmount, reqVO.getPlatformCollectionAmount())
                .eqIfPresent(ShopSettlementDO::getShopTotalHighAmount, reqVO.getShopTotalHighAmount())
                .eqIfPresent(ShopSettlementDO::getPtSettlementId, reqVO.getPtSettlementId())
                .eqIfPresent(ShopSettlementDO::getAttachment, reqVO.getAttachment())
                .betweenIfPresent(ShopSettlementDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ShopSettlementDO::getShopAmount, reqVO.getShopAmount())
                .likeIfPresent(ShopSettlementDO::getAccountName, reqVO.getAccountName())
                .eqIfPresent(ShopSettlementDO::getAccountNumber, reqVO.getAccountNumber())
                .orderByDesc(ShopSettlementDO::getId));
    }

}