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.TBranchActivityMapper;
import com.ruoyi.branch.domain.TBranchActivity;
import com.ruoyi.branch.service.ITBranchActivityService;

/**
 * 支部特色活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-18
 */
@Service
public class TBranchActivityServiceImpl implements ITBranchActivityService 
{
    @Autowired
    private TBranchActivityMapper tBranchActivityMapper;

    /**
     * 查询支部特色活动
     * 
     * @param activityId 支部特色活动主键
     * @return 支部特色活动
     */
    @Override
    public TBranchActivity selectTBranchActivityByActivityId(Long activityId)
    {
        return tBranchActivityMapper.selectTBranchActivityByActivityId(activityId);
    }

    /**
     * 查询支部特色活动列表
     * 
     * @param tBranchActivity 支部特色活动
     * @return 支部特色活动
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<TBranchActivity> selectTBranchActivityList(TBranchActivity tBranchActivity)
    {
        return tBranchActivityMapper.selectTBranchActivityList(tBranchActivity);
    }

    /**
     * 新增支部特色活动
     * 
     * @param tBranchActivity 支部特色活动
     * @return 结果
     */
    @Override
    public int insertTBranchActivity(TBranchActivity tBranchActivity)
    {
        tBranchActivity.setCreateTime(DateUtils.getNowDate());
        return tBranchActivityMapper.insertTBranchActivity(tBranchActivity);
    }

    /**
     * 修改支部特色活动
     * 
     * @param tBranchActivity 支部特色活动
     * @return 结果
     */
    @Override
    public int updateTBranchActivity(TBranchActivity tBranchActivity)
    {
        tBranchActivity.setUpdateTime(DateUtils.getNowDate());
        return tBranchActivityMapper.updateTBranchActivity(tBranchActivity);
    }

    /**
     * 批量删除支部特色活动
     * 
     * @param activityIds 需要删除的支部特色活动主键
     * @return 结果
     */
    @Override
    public int deleteTBranchActivityByActivityIds(Long[] activityIds)
    {
        return tBranchActivityMapper.deleteTBranchActivityByActivityIds(activityIds);
    }

    /**
     * 删除支部特色活动信息
     * 
     * @param activityId 支部特色活动主键
     * @return 结果
     */
    @Override
    public int deleteTBranchActivityByActivityId(Long activityId)
    {
        return tBranchActivityMapper.deleteTBranchActivityByActivityId(activityId);
    }
}
