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.TBranchDemeanorMapper;
import com.ruoyi.branch.domain.TBranchDemeanor;
import com.ruoyi.branch.service.ITBranchDemeanorService;

/**
 * 支部园地风采Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-27
 */
@Service
public class TBranchDemeanorServiceImpl implements ITBranchDemeanorService 
{
    @Autowired
    private TBranchDemeanorMapper tBranchDemeanorMapper;

    /**
     * 查询支部园地风采
     * 
     * @param demeanorId 支部园地风采主键
     * @return 支部园地风采
     */
    @Override
    public TBranchDemeanor selectTBranchDemeanorByDemeanorId(Long demeanorId)
    {
        return tBranchDemeanorMapper.selectTBranchDemeanorByDemeanorId(demeanorId);
    }

    /**
     * 查询支部园地风采列表
     * 
     * @param tBranchDemeanor 支部园地风采
     * @return 支部园地风采
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<TBranchDemeanor> selectTBranchDemeanorList(TBranchDemeanor tBranchDemeanor)
    {
        return tBranchDemeanorMapper.selectTBranchDemeanorList(tBranchDemeanor);
    }

    /**
     * 新增支部园地风采
     * 
     * @param tBranchDemeanor 支部园地风采
     * @return 结果
     */
    @Override
    public int insertTBranchDemeanor(TBranchDemeanor tBranchDemeanor)
    {
        tBranchDemeanor.setCreateTime(DateUtils.getNowDate());
        return tBranchDemeanorMapper.insertTBranchDemeanor(tBranchDemeanor);
    }

    /**
     * 修改支部园地风采
     * 
     * @param tBranchDemeanor 支部园地风采
     * @return 结果
     */
    @Override
    public int updateTBranchDemeanor(TBranchDemeanor tBranchDemeanor)
    {
        tBranchDemeanor.setUpdateTime(DateUtils.getNowDate());
        return tBranchDemeanorMapper.updateTBranchDemeanor(tBranchDemeanor);
    }

    /**
     * 批量删除支部园地风采
     * 
     * @param demeanorIds 需要删除的支部园地风采主键
     * @return 结果
     */
    @Override
    public int deleteTBranchDemeanorByDemeanorIds(Long[] demeanorIds)
    {
        return tBranchDemeanorMapper.deleteTBranchDemeanorByDemeanorIds(demeanorIds);
    }

    /**
     * 删除支部园地风采信息
     * 
     * @param demeanorId 支部园地风采主键
     * @return 结果
     */
    @Override
    public int deleteTBranchDemeanorByDemeanorId(Long demeanorId)
    {
        return tBranchDemeanorMapper.deleteTBranchDemeanorByDemeanorId(demeanorId);
    }
}
