package cn.iocoder.yudao.module.pay.dal.mysql.divideinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pay.dal.dataobject.divideinfo.DivideInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pay.controller.admin.divideinfo.vo.*;

/**
 * 分账明细 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DivideInfoMapper extends BaseMapperX<DivideInfoDO> {

    default PageResult<DivideInfoDO> selectPage(DivideInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DivideInfoDO>()
                .eqIfPresent(DivideInfoDO::getTransactionId, reqVO.getTransactionId())
                .eqIfPresent(DivideInfoDO::getOutOrderNo, reqVO.getOutOrderNo())
                .likeIfPresent(DivideInfoDO::getName, reqVO.getName())
                .eqIfPresent(DivideInfoDO::getType, reqVO.getType())
                .eqIfPresent(DivideInfoDO::getAccount, reqVO.getAccount())
                .eqIfPresent(DivideInfoDO::getAmount, reqVO.getAmount())
                .eqIfPresent(DivideInfoDO::getComputeAmount, reqVO.getComputeAmount())
                .eqIfPresent(DivideInfoDO::getDescription, reqVO.getDescription())
                .eqIfPresent(DivideInfoDO::getResult, reqVO.getResult())
                .eqIfPresent(DivideInfoDO::getFailReason, reqVO.getFailReason())
                .eqIfPresent(DivideInfoDO::getDetailId, reqVO.getDetailId())
                .betweenIfPresent(DivideInfoDO::getDCreateTime, reqVO.getDCreateTime())
                .betweenIfPresent(DivideInfoDO::getDFinishTime, reqVO.getDFinishTime())
                .betweenIfPresent(DivideInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DivideInfoDO::getId));
    }

}