package com.srs.comprehensive.service.impl;

import com.srs.common.annotation.Log;
import com.srs.comprehensive.domain.AffixItem;
import com.srs.comprehensive.mapper.AffixItemMapper;
import com.srs.comprehensive.service.ISrsAffixItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class SrsAffixItemServiceImpl implements ISrsAffixItemService {
    @Resource
    private AffixItemMapper affixItemMapper;

    public AffixItem queryBy(Long id) {
        return affixItemMapper.queryBy(id);
    }

    public AffixItem save(AffixItem affixItem) {
        if (affixItem.getId() != null && affixItem.getId() != 0L) {
            this.affixItemMapper.update(affixItem);
        } else {
            this.affixItemMapper.insert(affixItem);
        }
        return affixItem;
    }

    public Integer delete(Long id) {
        return affixItemMapper.delete(id);
    }

    public List<AffixItem> queryList(AffixItem affixItem) {
        return affixItemMapper.queryList(affixItem);
    }


    public Integer updateSavePath(AffixItem affixItem) {
        return affixItemMapper.updateSavePath(affixItem);
    }
}
