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.TBranchMemTransferMapper;
import com.ruoyi.branch.domain.TBranchMemTransfer;
import com.ruoyi.branch.service.ITBranchMemTransferService;

/**
 * 党员关系转移记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-13
 */
@Service
public class TBranchMemTransferServiceImpl implements ITBranchMemTransferService 
{
    @Autowired
    private TBranchMemTransferMapper tBranchMemTransferMapper;

    /**
     * 查询党员关系转移记录
     * 
     * @param transferId 党员关系转移记录主键
     * @return 党员关系转移记录
     */
    @Override
    public TBranchMemTransfer selectTBranchMemTransferByTransferId(Long transferId)
    {
        return tBranchMemTransferMapper.selectTBranchMemTransferByTransferId(transferId);
    }

    /**
     * 查询党员关系转移记录列表
     * 
     * @param tBranchMemTransfer 党员关系转移记录
     * @return 党员关系转移记录
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<TBranchMemTransfer> selectTBranchMemTransferList(TBranchMemTransfer tBranchMemTransfer)
    {
        return tBranchMemTransferMapper.selectTBranchMemTransferList(tBranchMemTransfer);
    }

    /**
     * 新增党员关系转移记录
     * 
     * @param tBranchMemTransfer 党员关系转移记录
     * @return 结果
     */
    @Override
    public int insertTBranchMemTransfer(TBranchMemTransfer tBranchMemTransfer)
    {
        tBranchMemTransfer.setCreateTime(DateUtils.getNowDate());
        return tBranchMemTransferMapper.insertTBranchMemTransfer(tBranchMemTransfer);
    }

    /**
     * 修改党员关系转移记录
     * 
     * @param tBranchMemTransfer 党员关系转移记录
     * @return 结果
     */
    @Override
    public int updateTBranchMemTransfer(TBranchMemTransfer tBranchMemTransfer)
    {
        tBranchMemTransfer.setUpdateTime(DateUtils.getNowDate());
        return tBranchMemTransferMapper.updateTBranchMemTransfer(tBranchMemTransfer);
    }

    /**
     * 批量删除党员关系转移记录
     * 
     * @param transferIds 需要删除的党员关系转移记录主键
     * @return 结果
     */
    @Override
    public int deleteTBranchMemTransferByTransferIds(Long[] transferIds)
    {
        return tBranchMemTransferMapper.deleteTBranchMemTransferByTransferIds(transferIds);
    }

    /**
     * 删除党员关系转移记录信息
     * 
     * @param transferId 党员关系转移记录主键
     * @return 结果
     */
    @Override
    public int deleteTBranchMemTransferByTransferId(Long transferId)
    {
        return tBranchMemTransferMapper.deleteTBranchMemTransferByTransferId(transferId);
    }
}
