package com.ruoyi.zongzhi.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.zongzhi.domain.TcDataSourceTj;
import com.ruoyi.zongzhi.mapper.TcDataSourceTjMapper;
import com.ruoyi.zongzhi.service.ITcDataSourceTjService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 数据来源统计Service业务层处理
 *
 * @author ruoyi
 * @date 2023-09-13
 */
@Service
public class TcDataSourceTjServiceImpl implements ITcDataSourceTjService {
    @Resource
    private TcDataSourceTjMapper tcDataSourceTjMapper;

    /**
     * 查询数据来源统计
     *
     * @param id 数据来源统计主键
     * @return 数据来源统计
     */
    @Override
    public TcDataSourceTj selectTcDataSourceTjById(Long id) {
        return tcDataSourceTjMapper.selectTcDataSourceTjById(id);
    }

    /**
     * 查询数据来源统计列表
     *
     * @param tcDataSourceTj 数据来源统计
     * @return 数据来源统计
     */
    @Override
    public List<TcDataSourceTj> selectTcDataSourceTjList(TcDataSourceTj tcDataSourceTj) {
        return tcDataSourceTjMapper.selectTcDataSourceTjList(tcDataSourceTj);
    }

    /**
     * 新增数据来源统计
     *
     * @param tcDataSourceTj 数据来源统计
     * @return 结果
     */
    @Override
    public int insertTcDataSourceTj(TcDataSourceTj tcDataSourceTj) {
        tcDataSourceTj.setCreateTime(DateUtils.getNowDate());
        return tcDataSourceTjMapper.insertTcDataSourceTj(tcDataSourceTj);
    }

    /**
     * 修改数据来源统计
     *
     * @param tcDataSourceTj 数据来源统计
     * @return 结果
     */
    @Override
    public int updateTcDataSourceTj(TcDataSourceTj tcDataSourceTj) {
        tcDataSourceTj.setUpdateTime(DateUtils.getNowDate());
        return tcDataSourceTjMapper.updateTcDataSourceTj(tcDataSourceTj);
    }

    /**
     * 批量删除数据来源统计
     *
     * @param ids 需要删除的数据来源统计主键
     * @return 结果
     */
    @Override
    public int deleteTcDataSourceTjByIds(Long[] ids) {
        return tcDataSourceTjMapper.deleteTcDataSourceTjByIds(ids);
    }

    /**
     * 删除数据来源统计信息
     *
     * @param id 数据来源统计主键
     * @return 结果
     */
    @Override
    public int deleteTcDataSourceTjById(Long id) {
        return tcDataSourceTjMapper.deleteTcDataSourceTjById(id);
    }
}
