package com.zbf.system.service.impl;

import java.util.List;
import com.zbf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.zbf.system.mapper.TBaseFinancialClassMapper;
import com.zbf.system.domain.TBaseFinancialClass;
import com.zbf.system.service.ITBaseFinancialClassService;

/**
 * 财务分类Service业务层处理
 *
 * @author sunits
 * @date 2024-06-28
 */
@Service
public class TBaseFinancialClassServiceImpl extends ServiceImpl<TBaseFinancialClassMapper, TBaseFinancialClass> implements ITBaseFinancialClassService //修改
{
    @Autowired
    private TBaseFinancialClassMapper tBaseFinancialClassMapper;

    /**
     * 查询财务分类
     *
     * @param id 财务分类主键
     * @return 财务分类
     */
    @Override
    public TBaseFinancialClass selectTBaseFinancialClassById(Long id)
    {
        return tBaseFinancialClassMapper.selectTBaseFinancialClassById(id);
    }

    /**
     * 查询财务分类列表
     *
     * @param tBaseFinancialClass 财务分类
     * @return 财务分类
     */
    @Override
    public List<TBaseFinancialClass> selectTBaseFinancialClassList(TBaseFinancialClass tBaseFinancialClass)
    {
        return tBaseFinancialClassMapper.selectTBaseFinancialClassList(tBaseFinancialClass);
    }

    /**
     * 新增财务分类
     *
     * @param tBaseFinancialClass 财务分类
     * @return 结果
     */
    @Override
    public int insertTBaseFinancialClass(TBaseFinancialClass tBaseFinancialClass)
    {
        tBaseFinancialClass.setCreateTime(DateUtils.getNowDate());
        return tBaseFinancialClassMapper.insertTBaseFinancialClass(tBaseFinancialClass);
    }

    /**
     * 修改财务分类
     *
     * @param tBaseFinancialClass 财务分类
     * @return 结果
     */
    @Override
    public int updateTBaseFinancialClass(TBaseFinancialClass tBaseFinancialClass)
    {
                tBaseFinancialClass.setUpdateTime(DateUtils.getNowDate());
        return tBaseFinancialClassMapper.updateTBaseFinancialClass(tBaseFinancialClass);
    }

    /**
     * 批量删除财务分类
     *
     * @param ids 需要删除的财务分类主键
     * @return 结果
     */
    @Override
    public int deleteTBaseFinancialClassByIds(Long[] ids)
    {
        return tBaseFinancialClassMapper.deleteTBaseFinancialClassByIds(ids);
    }

    /**
     * 删除财务分类信息
     *
     * @param id 财务分类主键
     * @return 结果
     */
    @Override
    public int deleteTBaseFinancialClassById(Long id)
    {
        return tBaseFinancialClassMapper.deleteTBaseFinancialClassById(id);
    }


    /**
     * 批量禁用
     *
     * @param id 财务分类主键
     * @return 结果
     */
    @Override
    public int disabledTBaseFinancialClassByIds(Long[] ids) {
        return tBaseFinancialClassMapper.disabledTBaseFinancialClassByIds(ids);
    }

    /**
     * 批量启用
     *
     * @param id 财务分类主键
     * @return 结果
     */
    @Override
    public int enableTBaseFinancialClassByIds(Long[] ids) {
        return tBaseFinancialClassMapper.enableTBaseFinancialClassByIds(ids);
    }

    /**
     * 修改状态
     *
     * @param tBaseFinancialClass 工序管理主键
     * @return 结果
     */
    @Override
    public int updateStatus(TBaseFinancialClass tBaseFinancialClass) {
        return tBaseFinancialClassMapper.updateTBaseFinancialClass(tBaseFinancialClass);
    }

}
