package com.ruoyi.invest.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.invest.domain.TProjectChannel;
import com.ruoyi.invest.mapper.TProjectChannelMapper;
import com.ruoyi.invest.service.ITProjectChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 渠道信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-22
 */
@Service
public class TProjectChannelServiceImpl implements ITProjectChannelService
{
    @Autowired
    private TProjectChannelMapper tProjectChannelMapper;

    /**
     * 查询渠道信息
     * 
     * @param id 渠道信息主键
     * @return 渠道信息
     */
    @Override
    public TProjectChannel selectTProjectChannelById(String id)
    {
        return tProjectChannelMapper.selectTProjectChannelById(id);
    }

    /**
     * 查询渠道信息列表
     * 
     * @param tProjectChannel 渠道信息
     * @return 渠道信息
     */
    @Override
    public List<TProjectChannel> selectTProjectChannelList(TProjectChannel tProjectChannel)
    {
        return tProjectChannelMapper.selectTProjectChannelList(tProjectChannel);
    }

    /**
     * 新增渠道信息
     * 
     * @param tProjectChannel 渠道信息
     * @return 结果
     */
    @Override
    public int insertTProjectChannel(TProjectChannel tProjectChannel)
    {
        tProjectChannel.setCreateTime(DateUtils.getNowDate());
        tProjectChannel.setId(IdUtils.fastSimpleUUID());
        return tProjectChannelMapper.insertTProjectChannel(tProjectChannel);
    }

    /**
     * 修改渠道信息
     * 
     * @param tProjectChannel 渠道信息
     * @return 结果
     */
    @Override
    public int updateTProjectChannel(TProjectChannel tProjectChannel)
    {
        tProjectChannel.setUpdateTime(DateUtils.getNowDate());
        return tProjectChannelMapper.updateTProjectChannel(tProjectChannel);
    }

    /**
     * 批量删除渠道信息
     * 
     * @param ids 需要删除的渠道信息主键
     * @return 结果
     */
    @Override
    public int deleteTProjectChannelByIds(String[] ids)
    {
        return tProjectChannelMapper.deleteTProjectChannelByIds(ids);
    }

    /**
     * 删除渠道信息信息
     * 
     * @param id 渠道信息主键
     * @return 结果
     */
    @Override
    public int deleteTProjectChannelById(String id)
    {
        return tProjectChannelMapper.deleteTProjectChannelById(id);
    }

    /**
     * 批量删除渠道信息(修改del_flag状态)
     *
     * @param ids
     * @return
     */
    @Override
    public int updateTProjectChannelByIds(String[] ids) {
        return tProjectChannelMapper.updateTProjectChannelByIds(ids);
    }

    /**
     * 根据年查询渠道编号
     * @param year
     * @return
     */
    @Override
    public int selectTProjectChannelCode(String year) {
        return tProjectChannelMapper.selectTProjectChannelCode(year);
    }
}
