package com.yunfeiyun.agmp.fms.service.impl;

import com.yunfeiyun.agmp.fms.domain.TssSourceperiod;
import com.yunfeiyun.agmp.fms.mapper.TssSourceperiodMapper;
import com.yunfeiyun.agmp.fms.service.ITssSourceperiodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 溯源周期Service业务层处理
 * 
 * @author 杨晓辉
 * @date 2023-06-25
 */
@Service
public class TssSourceperiodServiceImpl implements ITssSourceperiodService
{
    @Autowired
    private TssSourceperiodMapper tssSourceperiodMapper;

    /**
     * 查询溯源周期
     * 
     * @param sourceperiodId 溯源周期主键
     * @return 溯源周期
     */
    @Override
    public TssSourceperiod selectTssSourceperiodBySourceperiodId(String sourceperiodId)
    {
        return tssSourceperiodMapper.selectTssSourceperiodBySourceperiodId(sourceperiodId);
    }

    /**
     * 查询溯源周期列表
     * 
     * @param tssSourceperiod 溯源周期
     * @return 溯源周期
     */
    @Override
    public List<TssSourceperiod> selectTssSourceperiodList(TssSourceperiod tssSourceperiod)
    {
        return tssSourceperiodMapper.selectTssSourceperiodList(tssSourceperiod);
    }

    /**
     * 新增溯源周期
     * 
     * @param tssSourceperiod 溯源周期
     * @return 结果
     */
    @Override
    public int insertTssSourceperiod(TssSourceperiod tssSourceperiod)
    {
        return tssSourceperiodMapper.insertTssSourceperiod(tssSourceperiod);
    }

    /**
     * 修改溯源周期
     * 
     * @param tssSourceperiod 溯源周期
     * @return 结果
     */
    @Override
    public int updateTssSourceperiod(TssSourceperiod tssSourceperiod)
    {
        return tssSourceperiodMapper.updateTssSourceperiod(tssSourceperiod);
    }

    /**
     * 批量删除溯源周期
     * 
     * @param sourceperiodIds 需要删除的溯源周期主键
     * @return 结果
     */
    @Override
    public int deleteTssSourceperiodBySourceperiodIds(String[] sourceperiodIds)
    {
        return tssSourceperiodMapper.deleteTssSourceperiodBySourceperiodIds(sourceperiodIds);
    }

    /**
     * 删除溯源周期信息
     * 
     * @param sourceperiodId 溯源周期主键
     * @return 结果
     */
    @Override
    public int deleteTssSourceperiodBySourceperiodId(String sourceperiodId)
    {
        return tssSourceperiodMapper.deleteTssSourceperiodBySourceperiodId(sourceperiodId);
    }
}
