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.TBranchPublicizeMapper;
import com.ruoyi.branch.domain.TBranchPublicize;
import com.ruoyi.branch.service.ITBranchPublicizeService;

/**
 * 支部园地宣传Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-27
 */
@Service
public class TBranchPublicizeServiceImpl implements ITBranchPublicizeService 
{
    @Autowired
    private TBranchPublicizeMapper tBranchPublicizeMapper;

    /**
     * 查询支部园地宣传
     * 
     * @param publicizeId 支部园地宣传主键
     * @return 支部园地宣传
     */
    @Override
    public TBranchPublicize selectTBranchPublicizeByPublicizeId(Long publicizeId)
    {
        return tBranchPublicizeMapper.selectTBranchPublicizeByPublicizeId(publicizeId);
    }

    /**
     * 查询支部园地宣传列表
     * 
     * @param tBranchPublicize 支部园地宣传
     * @return 支部园地宣传
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<TBranchPublicize> selectTBranchPublicizeList(TBranchPublicize tBranchPublicize)
    {
        return tBranchPublicizeMapper.selectTBranchPublicizeList(tBranchPublicize);
    }

    /**
     * 新增支部园地宣传
     * 
     * @param tBranchPublicize 支部园地宣传
     * @return 结果
     */
    @Override
    public int insertTBranchPublicize(TBranchPublicize tBranchPublicize)
    {
        tBranchPublicize.setCreateTime(DateUtils.getNowDate());
        return tBranchPublicizeMapper.insertTBranchPublicize(tBranchPublicize);
    }

    /**
     * 修改支部园地宣传
     * 
     * @param tBranchPublicize 支部园地宣传
     * @return 结果
     */
    @Override
    public int updateTBranchPublicize(TBranchPublicize tBranchPublicize)
    {
        tBranchPublicize.setUpdateTime(DateUtils.getNowDate());
        return tBranchPublicizeMapper.updateTBranchPublicize(tBranchPublicize);
    }

    /**
     * 批量删除支部园地宣传
     * 
     * @param publicizeIds 需要删除的支部园地宣传主键
     * @return 结果
     */
    @Override
    public int deleteTBranchPublicizeByPublicizeIds(Long[] publicizeIds)
    {
        return tBranchPublicizeMapper.deleteTBranchPublicizeByPublicizeIds(publicizeIds);
    }

    /**
     * 删除支部园地宣传信息
     * 
     * @param publicizeId 支部园地宣传主键
     * @return 结果
     */
    @Override
    public int deleteTBranchPublicizeByPublicizeId(Long publicizeId)
    {
        return tBranchPublicizeMapper.deleteTBranchPublicizeByPublicizeId(publicizeId);
    }
}
