package com.ruoyi.zongzhi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zongzhi.mapper.TcWorkDongtaiMapper;
import com.ruoyi.zongzhi.domain.TcWorkDongtai;
import com.ruoyi.zongzhi.service.ITcWorkDongtaiService;

/**
 * 工作动态Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class TcWorkDongtaiServiceImpl implements ITcWorkDongtaiService 
{
    @Autowired
    private TcWorkDongtaiMapper tcWorkDongtaiMapper;

    /**
     * 查询工作动态
     * 
     * @param id 工作动态主键
     * @return 工作动态
     */
    @Override
    public TcWorkDongtai selectTcWorkDongtaiById(Long id)
    {
        return tcWorkDongtaiMapper.selectTcWorkDongtaiById(id);
    }

    /**
     * 查询工作动态列表
     * 
     * @param tcWorkDongtai 工作动态
     * @return 工作动态
     */
    @Override
    public List<TcWorkDongtai> selectTcWorkDongtaiList(TcWorkDongtai tcWorkDongtai)
    {
        return tcWorkDongtaiMapper.selectTcWorkDongtaiList(tcWorkDongtai);
    }

    /**
     * 新增工作动态
     * 
     * @param tcWorkDongtai 工作动态
     * @return 结果
     */
    @Override
    public int insertTcWorkDongtai(TcWorkDongtai tcWorkDongtai)
    {
        tcWorkDongtai.setCreateTime(DateUtils.getNowDate());
        return tcWorkDongtaiMapper.insertTcWorkDongtai(tcWorkDongtai);
    }

    /**
     * 修改工作动态
     * 
     * @param tcWorkDongtai 工作动态
     * @return 结果
     */
    @Override
    public int updateTcWorkDongtai(TcWorkDongtai tcWorkDongtai)
    {
        tcWorkDongtai.setUpdateTime(DateUtils.getNowDate());
        return tcWorkDongtaiMapper.updateTcWorkDongtai(tcWorkDongtai);
    }

    /**
     * 批量删除工作动态
     * 
     * @param ids 需要删除的工作动态主键
     * @return 结果
     */
    @Override
    public int deleteTcWorkDongtaiByIds(Long[] ids)
    {
        return tcWorkDongtaiMapper.deleteTcWorkDongtaiByIds(ids);
    }

    /**
     * 删除工作动态信息
     * 
     * @param id 工作动态主键
     * @return 结果
     */
    @Override
    public int deleteTcWorkDongtaiById(Long id)
    {
        return tcWorkDongtaiMapper.deleteTcWorkDongtaiById(id);
    }
}
