package com.supplier.service.impl;

import com.supplier.mapper.PrivateOrderMapper;
import com.supplier.model.Ignore;
import com.supplier.model.PrivateOrder;
import com.supplier.service.PrivateOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class PrivateOrderServiceImpl implements PrivateOrderService {

    @Autowired
    private PrivateOrderMapper privateOrderMapper;

    @Override
    public List<PrivateOrder> getPrivateOrder(PrivateOrder privateOrder) {
        return privateOrderMapper.getPrivateOrder(privateOrder);
    }

    @Override
    public int getPrivateOrderCount(PrivateOrder privateOrder) {
        return privateOrderMapper.getPrivateOrderCount(privateOrder);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addIgnore(Ignore ignore) {
        privateOrderMapper.addIgnore(ignore);
    }

    @Override
    public PrivateOrder getPrivateOrderById(String uuid) {
        return privateOrderMapper.getPrivateOrderById(uuid);
    }

    @Override
    public int getPrivateOrderType(PrivateOrder privateOrder) {
        return privateOrderMapper.getPrivateOrderType(privateOrder);
    }

    @Override
    public List<PrivateOrder> getPrivateOrderZeor(PrivateOrder privateOrder) {
        return privateOrderMapper.getPrivateOrderZeor(privateOrder);
    }
}
