package com.da.dangan.service.impl;

import com.da.common.utils.DateUtils;
import com.da.dangan.domain.AreaSort;
import com.da.dangan.mapper.AreaSortMapper;
import com.da.dangan.service.IAreaSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 档案行政分类Service业务层处理
 * 
 * @author hs
 * @date 2024-05-11
 */
@Service
public class AreaSortServiceImpl implements IAreaSortService 
{
    @Autowired
    private AreaSortMapper areaSortMapper;

    /**
     * 查询档案行政分类
     * 
     * @param id 档案行政分类主键
     * @return 档案行政分类
     */
    @Override
    public AreaSort selectAreaSortById(Long id)
    {
        return areaSortMapper.selectAreaSortById(id);
    }

    /**
     * 查询档案行政分类列表
     * 
     * @param areaSort 档案行政分类
     * @return 档案行政分类
     */
    @Override
    public List<AreaSort> selectAreaSortList(AreaSort areaSort)
    {
        return areaSortMapper.selectAreaSortList(areaSort);
    }

    /**
     * 新增档案行政分类
     * 
     * @param areaSort 档案行政分类
     * @return 结果
     */
    @Override
    public int insertAreaSort(AreaSort areaSort)
    {
        areaSort.setCreateTime(DateUtils.getNowDate());
        return areaSortMapper.insertAreaSort(areaSort);
    }

    /**
     * 修改档案行政分类
     * 
     * @param areaSort 档案行政分类
     * @return 结果
     */
    @Override
    public int updateAreaSort(AreaSort areaSort)
    {
        areaSort.setUpdateTime(DateUtils.getNowDate());
        return areaSortMapper.updateAreaSort(areaSort);
    }

    /**
     * 批量删除档案行政分类
     * 
     * @param ids 需要删除的档案行政分类主键
     * @return 结果
     */
    @Override
    public int deleteAreaSortByIds(Long[] ids)
    {
        return areaSortMapper.deleteAreaSortByIds(ids);
    }

    /**
     * 删除档案行政分类信息
     * 
     * @param id 档案行政分类主键
     * @return 结果
     */
    @Override
    public int deleteAreaSortById(Long id)
    {
        return areaSortMapper.deleteAreaSortById(id);
    }
}
