package com.da.dangan.service.impl;

import java.util.List;
import com.da.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.domain.DaCatalog;
import com.da.dangan.service.IDaCatalogService;

/**
 * 档案目录Service业务层处理
 * 
 * @author hs
 * @date 2024-05-08
 */
@Service
public class DaCatalogServiceImpl implements IDaCatalogService 
{
    @Autowired
    private DaCatalogMapper daCatalogMapper;

    /**
     * 查询档案目录
     * 
     * @param id 档案目录主键
     * @return 档案目录
     */
    @Override
    public DaCatalog selectDaCatalogById(Long id)
    {
        return daCatalogMapper.selectDaCatalogById(id);
    }

    /**
     * 查询档案目录列表
     * 
     * @param daCatalog 档案目录
     * @return 档案目录
     */
    @Override
    public List<DaCatalog> selectDaCatalogList(DaCatalog daCatalog)
    {
        return daCatalogMapper.selectDaCatalogList(daCatalog);
    }

    /**
     * 新增档案目录
     * 
     * @param daCatalog 档案目录
     * @return 结果
     */
    @Override
    public int insertDaCatalog(DaCatalog daCatalog)
    {
        daCatalog.setCreateTime(DateUtils.getNowDate());
        return daCatalogMapper.insertDaCatalog(daCatalog);
    }

    /**
     * 修改档案目录
     * 
     * @param daCatalog 档案目录
     * @return 结果
     */
    @Override
    public int updateDaCatalog(DaCatalog daCatalog)
    {
        daCatalog.setUpdateTime(DateUtils.getNowDate());
        return daCatalogMapper.updateDaCatalog(daCatalog);
    }

    /**
     * 批量删除档案目录
     * 
     * @param ids 需要删除的档案目录主键
     * @return 结果
     */
    @Override
    public int deleteDaCatalogByIds(Long[] ids)
    {
        return daCatalogMapper.deleteDaCatalogByIds(ids);
    }

    /**
     * 删除档案目录信息
     * 
     * @param id 档案目录主键
     * @return 结果
     */
    @Override
    public int deleteDaCatalogById(Long id)
    {
        return daCatalogMapper.deleteDaCatalogById(id);
    }
}
