package com.sundot.airport.personnel.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sundot.airport.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sundot.airport.personnel.mapper.PersonnelMonthlyAssessmentIndicatorDetailMapper;
import com.sundot.airport.personnel.domain.PersonnelMonthlyAssessmentIndicatorDetail;
import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorDetailService;

/**
 * 月度考核指标明细Service业务层处理
 *
 * @author ruoyi
 * @date 2026-05-07
 */
@Service
public class PersonnelMonthlyAssessmentIndicatorDetailServiceImpl extends ServiceImpl<PersonnelMonthlyAssessmentIndicatorDetailMapper, PersonnelMonthlyAssessmentIndicatorDetail> implements IPersonnelMonthlyAssessmentIndicatorDetailService {
    @Autowired
    private PersonnelMonthlyAssessmentIndicatorDetailMapper personnelMonthlyAssessmentIndicatorDetailMapper;

    /**
     * 查询月度考核指标明细
     *
     * @param id 月度考核指标明细主键
     * @return 月度考核指标明细
     */
    @Override
    public PersonnelMonthlyAssessmentIndicatorDetail selectPersonnelMonthlyAssessmentIndicatorDetailById(Long id) {
        return personnelMonthlyAssessmentIndicatorDetailMapper.selectPersonnelMonthlyAssessmentIndicatorDetailById(id);
    }

    /**
     * 查询月度考核指标明细列表
     *
     * @param personnelMonthlyAssessmentIndicatorDetail 月度考核指标明细
     * @return 月度考核指标明细
     */
    @Override
    public List<PersonnelMonthlyAssessmentIndicatorDetail> selectPersonnelMonthlyAssessmentIndicatorDetailList(PersonnelMonthlyAssessmentIndicatorDetail personnelMonthlyAssessmentIndicatorDetail) {
        return personnelMonthlyAssessmentIndicatorDetailMapper.selectPersonnelMonthlyAssessmentIndicatorDetailList(personnelMonthlyAssessmentIndicatorDetail);
    }

    /**
     * 新增月度考核指标明细
     *
     * @param personnelMonthlyAssessmentIndicatorDetail 月度考核指标明细
     * @return 结果
     */
    @Override
    public int insertPersonnelMonthlyAssessmentIndicatorDetail(PersonnelMonthlyAssessmentIndicatorDetail personnelMonthlyAssessmentIndicatorDetail) {
        personnelMonthlyAssessmentIndicatorDetail.setCreateTime(DateUtils.getNowDate());
        return personnelMonthlyAssessmentIndicatorDetailMapper.insertPersonnelMonthlyAssessmentIndicatorDetail(personnelMonthlyAssessmentIndicatorDetail);
    }

    /**
     * 修改月度考核指标明细
     *
     * @param personnelMonthlyAssessmentIndicatorDetail 月度考核指标明细
     * @return 结果
     */
    @Override
    public int updatePersonnelMonthlyAssessmentIndicatorDetail(PersonnelMonthlyAssessmentIndicatorDetail personnelMonthlyAssessmentIndicatorDetail) {
        personnelMonthlyAssessmentIndicatorDetail.setUpdateTime(DateUtils.getNowDate());
        return personnelMonthlyAssessmentIndicatorDetailMapper.updatePersonnelMonthlyAssessmentIndicatorDetail(personnelMonthlyAssessmentIndicatorDetail);
    }

    /**
     * 批量删除月度考核指标明细
     *
     * @param ids 需要删除的月度考核指标明细主键
     * @return 结果
     */
    @Override
    public int deletePersonnelMonthlyAssessmentIndicatorDetailByIds(Long[] ids) {
        return personnelMonthlyAssessmentIndicatorDetailMapper.deletePersonnelMonthlyAssessmentIndicatorDetailByIds(ids);
    }

    /**
     * 删除月度考核指标明细信息
     *
     * @param id 月度考核指标明细主键
     * @return 结果
     */
    @Override
    public int deletePersonnelMonthlyAssessmentIndicatorDetailById(Long id) {
        return personnelMonthlyAssessmentIndicatorDetailMapper.deletePersonnelMonthlyAssessmentIndicatorDetailById(id);
    }
}
