package com.ruoyi.hywz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.hywz.entity.AdsMatHyxtMoneyVoucherD;
import com.ruoyi.hywz.mapper.AdsMatHyxtMoneyVoucherDMapper;
import com.ruoyi.hywz.service.IAdsMatHyxtMoneyVoucherDService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 财务入账凭证信息 服务实现类
 * </p>
 *
 * @author mybatisplus-generator
 * @date 2024-04-19 17:21:23
 */
@Service
public class AdsMatHyxtMoneyVoucherDServiceImpl extends ServiceImpl<AdsMatHyxtMoneyVoucherDMapper,AdsMatHyxtMoneyVoucherD> implements IAdsMatHyxtMoneyVoucherDService {

    @Override
    public AdsMatHyxtMoneyVoucherD getBySingleProject(String singleProject1, String singleProject2, String voucherCode) {
        LambdaQueryWrapper<AdsMatHyxtMoneyVoucherD> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.like(AdsMatHyxtMoneyVoucherD::getSingleProject, singleProject1);
        queryWrapper.like(AdsMatHyxtMoneyVoucherD::getSingleProject, singleProject2);
        queryWrapper.like(AdsMatHyxtMoneyVoucherD::getVoucherCode, voucherCode);
        List<AdsMatHyxtMoneyVoucherD> list = baseMapper.selectList(queryWrapper);
        if (list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }

}
