package com.easyproject.system.service.guide.impl;

import java.util.List;

import com.easyproject.common.utils.DateUtils;
import com.easyproject.service.domain.guide.ServiceGuideCategory;
import com.easyproject.service.mapper.guide.ServiceGuideCategoryMapper;
import com.easyproject.system.service.guide.IServiceGuideCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 指南分类Service业务层处理
 *
 * @author easyproject
 * @date 2025-03-21
 */
@Service
public class ServiceGuideCategoryServiceImpl implements IServiceGuideCategoryService {
    @Autowired
    private ServiceGuideCategoryMapper serviceGuideCategoryMapper;

    /**
     * 查询指南分类
     *
     * @param id 指南分类主键
     * @return 指南分类
     */
    @Override
    public ServiceGuideCategory selectServiceGuideCategoryById(Long id) {
        return serviceGuideCategoryMapper.selectServiceGuideCategoryById(id);
    }

    /**
     * 查询指南分类列表
     *
     * @param serviceGuideCategory 指南分类
     * @return 指南分类
     */
    @Override
    public List<ServiceGuideCategory> selectServiceGuideCategoryList(ServiceGuideCategory serviceGuideCategory) {
        return serviceGuideCategoryMapper.selectServiceGuideCategoryList(serviceGuideCategory);
    }

    /**
     * 新增指南分类
     *
     * @param serviceGuideCategory 指南分类
     * @return 结果
     */
    @Override
    public int insertServiceGuideCategory(ServiceGuideCategory serviceGuideCategory) {
        serviceGuideCategory.setCreateTime(DateUtils.getNowDate());
        return serviceGuideCategoryMapper.insertServiceGuideCategory(serviceGuideCategory);
    }

    /**
     * 修改指南分类
     *
     * @param serviceGuideCategory 指南分类
     * @return 结果
     */
    @Override
    public int updateServiceGuideCategory(ServiceGuideCategory serviceGuideCategory) {
        serviceGuideCategory.setUpdateTime(DateUtils.getNowDate());
        return serviceGuideCategoryMapper.updateServiceGuideCategory(serviceGuideCategory);
    }

    /**
     * 批量删除指南分类
     *
     * @param ids 需要删除的指南分类主键
     * @return 结果
     */
    @Override
    public int deleteServiceGuideCategoryByIds(Long[] ids) {
        return serviceGuideCategoryMapper.deleteServiceGuideCategoryByIds(ids);
    }
}
