package com.yuchen.saas.park.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yuchen.saas.park.api.entity.park.ParkInvoiceInfo;
import com.yuchen.saas.park.service.mapper.ParkInvoiceMapper;
import com.yuchen.saas.park.service.service.ParkInvoiceInfoService;
import org.nest.springwrap.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @ClassName ParkInvoiceInfoServiceImpl
 * @Description 园区瑞宏发票配置操作接口实现
 * @Author 张逸飞
 * @Date 2022/6/16 15:50
 */
@Service
public class ParkInvoiceInfoServiceImpl extends BaseServiceImpl<ParkInvoiceMapper, ParkInvoiceInfo> implements ParkInvoiceInfoService {

    @Override
    public Boolean saveInvoice(ParkInvoiceInfo parkInvoiceInfo) {
        return saveOrUpdate(parkInvoiceInfo);
    }

    @Override
    public ParkInvoiceInfo getByParkId(Long parkId) {
        LambdaQueryWrapper<ParkInvoiceInfo> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(ParkInvoiceInfo::getParkId, parkId);
        return getOne(queryWrapper);
    }
}
