package com.xinelu.manage.service.normdepartmentcompare.impl;

import com.xinelu.manage.domain.normdepartmentcompare.NormDepartmentCompare;
import com.xinelu.manage.mapper.normdepartmentcompare.NormDepartmentCompareMapper;
import com.xinelu.manage.service.normdepartmentcompare.INormDepartmentCompareService;
import org.springframework.stereotype.Service;

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


/**
 * 标准科室对照信息Service业务层处理
 *
 * @author xinelu
 * @date 2024-02-28
 */
@Service
public class NormDepartmentCompareServiceImpl implements INormDepartmentCompareService {
    @Resource
    private NormDepartmentCompareMapper normDepartmentCompareMapper;

    /**
     * 查询标准科室对照信息
     *
     * @param id 标准科室对照信息主键
     * @return 标准科室对照信息
     */
    @Override
    public NormDepartmentCompare selectNormDepartmentCompareById(Long id) {
        return normDepartmentCompareMapper.selectNormDepartmentCompareById(id);
    }

    /**
     * 查询标准科室对照信息列表
     *
     * @param normDepartmentCompare 标准科室对照信息
     * @return 标准科室对照信息
     */
    @Override
    public List<NormDepartmentCompare> selectNormDepartmentCompareList(NormDepartmentCompare normDepartmentCompare) {
        return normDepartmentCompareMapper.selectNormDepartmentCompareList(normDepartmentCompare);
    }

    /**
     * 新增标准科室对照信息
     *
     * @param normDepartmentCompare 标准科室对照信息
     * @return 结果
     */
    @Override
    public int insertNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) {
        normDepartmentCompare.setCreateTime(LocalDateTime.now());
        return normDepartmentCompareMapper.insertNormDepartmentCompare(normDepartmentCompare);
    }

    /**
     * 修改标准科室对照信息
     *
     * @param normDepartmentCompare 标准科室对照信息
     * @return 结果
     */
    @Override
    public int updateNormDepartmentCompare(NormDepartmentCompare normDepartmentCompare) {
        normDepartmentCompare.setUpdateTime(LocalDateTime.now());
        return normDepartmentCompareMapper.updateNormDepartmentCompare(normDepartmentCompare);
    }

    /**
     * 批量删除标准科室对照信息
     *
     * @param ids 需要删除的标准科室对照信息主键
     * @return 结果
     */
    @Override
    public int deleteNormDepartmentCompareByIds(Long[] ids) {
        return normDepartmentCompareMapper.deleteNormDepartmentCompareByIds(ids);
    }

    /**
     * 删除标准科室对照信息信息
     *
     * @param id 标准科室对照信息主键
     * @return 结果
     */
    @Override
    public int deleteNormDepartmentCompareById(Long id) {
        return normDepartmentCompareMapper.deleteNormDepartmentCompareById(id);
    }
}
