package com.ruoyi.branch.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.branch.mapper.TBranchActivityBudgetMapper;
import com.ruoyi.branch.domain.TBranchActivityBudget;
import com.ruoyi.branch.service.ITBranchActivityBudgetService;

/**
 * 支部活动预算Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-20
 */
@Service
public class TBranchActivityBudgetServiceImpl implements ITBranchActivityBudgetService 
{
    @Autowired
    private TBranchActivityBudgetMapper tBranchActivityBudgetMapper;

    /**
     * 查询支部活动预算
     * 
     * @param budgetId 支部活动预算主键
     * @return 支部活动预算
     */
    @Override
    public TBranchActivityBudget selectTBranchActivityBudgetByBudgetId(Long budgetId)
    {
        return tBranchActivityBudgetMapper.selectTBranchActivityBudgetByBudgetId(budgetId);
    }

    /**
     * 查询支部活动预算列表
     * 
     * @param tBranchActivityBudget 支部活动预算
     * @return 支部活动预算
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<TBranchActivityBudget> selectTBranchActivityBudgetList(TBranchActivityBudget tBranchActivityBudget)
    {
        return tBranchActivityBudgetMapper.selectTBranchActivityBudgetList(tBranchActivityBudget);
    }

    /**
     * 新增支部活动预算
     * 
     * @param tBranchActivityBudget 支部活动预算
     * @return 结果
     */
    @Override
    public int insertTBranchActivityBudget(TBranchActivityBudget tBranchActivityBudget)
    {
        tBranchActivityBudget.setCreateTime(DateUtils.getNowDate());
        return tBranchActivityBudgetMapper.insertTBranchActivityBudget(tBranchActivityBudget);
    }

    /**
     * 修改支部活动预算
     * 
     * @param tBranchActivityBudget 支部活动预算
     * @return 结果
     */
    @Override
    public int updateTBranchActivityBudget(TBranchActivityBudget tBranchActivityBudget)
    {
        tBranchActivityBudget.setUpdateTime(DateUtils.getNowDate());
        return tBranchActivityBudgetMapper.updateTBranchActivityBudget(tBranchActivityBudget);
    }

    /**
     * 批量删除支部活动预算
     * 
     * @param budgetIds 需要删除的支部活动预算主键
     * @return 结果
     */
    @Override
    public int deleteTBranchActivityBudgetByBudgetIds(Long[] budgetIds)
    {
        return tBranchActivityBudgetMapper.deleteTBranchActivityBudgetByBudgetIds(budgetIds);
    }

    /**
     * 删除支部活动预算信息
     * 
     * @param budgetId 支部活动预算主键
     * @return 结果
     */
    @Override
    public int deleteTBranchActivityBudgetByBudgetId(Long budgetId)
    {
        return tBranchActivityBudgetMapper.deleteTBranchActivityBudgetByBudgetId(budgetId);
    }
}
