package com.supplier.service.impl;

import com.supplier.mapper.TemplateMapper;
import com.supplier.model.SupplierRelease;
import com.supplier.model.SupplierReleaseDay;
import com.supplier.model.SupplierReleasePlay;
import com.supplier.service.TemplateService;
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 TemplateServiceImpl implements TemplateService {
    @Autowired
    private TemplateMapper templateMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addReleaseDay(SupplierReleaseDay supplierReleaseDay) {
        templateMapper.addReleaseDay(supplierReleaseDay);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addReleasePlay(SupplierReleasePlay supplierReleasePlay) {
        templateMapper.addReleasePlay(supplierReleasePlay);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addRelease(SupplierRelease supplierRelease) {
        templateMapper.addRelease(supplierRelease);
    }

    @Override
    public List<SupplierRelease> getSupplierRelease(SupplierRelease supplierRelease) {
        return templateMapper.getSupplierRelease(supplierRelease);
    }

    @Override
    public List<SupplierReleaseDay> getSupplierReleaseDay(String uuid) {
        return templateMapper.getSupplierReleaseDay(uuid);
    }

    @Override
    public List<SupplierReleasePlay> getSupplierReleasePlay(String uuid) {
        return templateMapper.getSupplierReleasePlay(uuid);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateSupplierRelease(SupplierRelease supplierRelease) {
        templateMapper.updateSupplierRelease(supplierRelease);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delSupplierReleaseDay(SupplierRelease supplierRelease) {
        templateMapper.delSupplierReleaseDay(supplierRelease);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delSupplierReleasePlay(SupplierRelease supplierRelease) {
        templateMapper.delSupplierReleasePlay(supplierRelease);
    }
}
