package cn.iocoder.yudao.module.bpm.dal.mysql.oa;

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.bpm.controller.admin.oa.vo.procurepay.BpmOAProcurePayPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcurePayDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 采购支付 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface BpmOAProcurePayMapper extends BaseMapperX<BpmOAProcurePayDO> {

    default PageResult<BpmOAProcurePayDO> selectPage(BpmOAProcurePayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BpmOAProcurePayDO>()
                .eqIfPresent(BpmOAProcurePayDO::getUserId, reqVO.getUserId())
                .eqIfPresent(BpmOAProcurePayDO::getReason, reqVO.getReason())
                .betweenIfPresent(BpmOAProcurePayDO::getPayTime, reqVO.getPayTime())
                .eqIfPresent(BpmOAProcurePayDO::getTotalMoney, reqVO.getTotalMoney())
                .eqIfPresent(BpmOAProcurePayDO::getTotalMoneyChinese, reqVO.getTotalMoneyChinese())
                .eqIfPresent(BpmOAProcurePayDO::getFileItems, reqVO.getFileItems())
                .eqIfPresent(BpmOAProcurePayDO::getResult, reqVO.getResult())
                .eqIfPresent(BpmOAProcurePayDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .betweenIfPresent(BpmOAProcurePayDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BpmOAProcurePayDO::getId));
    }

}