package com.ruoyi.kaohe.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kaohe.mapper.KhTypeMapper;
import com.ruoyi.kaohe.domain.KhType;
import com.ruoyi.kaohe.service.IKhTypeService;

/**
 * 考核类型Service业务层处理
 * 
 * @author hs
 * @date 2025-06-17
 */
@Service
public class KhTypeServiceImpl implements IKhTypeService 
{
    @Autowired
    private KhTypeMapper khTypeMapper;

    /**
     * 查询考核类型
     * 
     * @param id 考核类型主键
     * @return 考核类型
     */
    @Override
    public KhType selectKhTypeById(Long id)
    {
        return khTypeMapper.selectKhTypeById(id);
    }

    /**
     * 查询考核类型列表
     * 
     * @param khType 考核类型
     * @return 考核类型
     */
    @Override
    public List<KhType> selectKhTypeList(KhType khType)
    {
        return khTypeMapper.selectKhTypeList(khType);
    }

    /**
     * 新增考核类型
     * 
     * @param khType 考核类型
     * @return 结果
     */
    @Override
    public int insertKhType(KhType khType)
    {
        khType.setCreateTime(DateUtils.getNowDate());
        return khTypeMapper.insertKhType(khType);
    }

    /**
     * 修改考核类型
     * 
     * @param khType 考核类型
     * @return 结果
     */
    @Override
    public int updateKhType(KhType khType)
    {
        khType.setUpdateTime(DateUtils.getNowDate());
        return khTypeMapper.updateKhType(khType);
    }

    /**
     * 批量删除考核类型
     * 
     * @param ids 需要删除的考核类型主键
     * @return 结果
     */
    @Override
    public int deleteKhTypeByIds(Long[] ids)
    {
        return khTypeMapper.deleteKhTypeByIds(ids);
    }

    /**
     * 删除考核类型信息
     * 
     * @param id 考核类型主键
     * @return 结果
     */
    @Override
    public int deleteKhTypeById(Long id)
    {
        return khTypeMapper.deleteKhTypeById(id);
    }
}
