package com.ruoyi.jarvis.service.impl;

import com.ruoyi.jarvis.domain.GroupRebateExcelUpload;
import com.ruoyi.jarvis.mapper.GroupRebateExcelUploadMapper;
import com.ruoyi.jarvis.service.IGroupRebateExcelUploadService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GroupRebateExcelUploadServiceImpl implements IGroupRebateExcelUploadService {

    @Resource
    private GroupRebateExcelUploadMapper groupRebateExcelUploadMapper;

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
    public void saveRecordInNewTransaction(GroupRebateExcelUpload row) {
        groupRebateExcelUploadMapper.insertGroupRebateExcelUpload(row);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
    public void updateRecordInNewTransaction(GroupRebateExcelUpload row) {
        groupRebateExcelUploadMapper.updateGroupRebateExcelUpload(row);
    }

    @Override
    public GroupRebateExcelUpload selectGroupRebateExcelUploadById(Long id) {
        return groupRebateExcelUploadMapper.selectGroupRebateExcelUploadById(id);
    }

    @Override
    public List<GroupRebateExcelUpload> selectGroupRebateExcelUploadList(GroupRebateExcelUpload query) {
        return groupRebateExcelUploadMapper.selectGroupRebateExcelUploadList(query);
    }
}
