package com.yanzhu.manage.service.impl;

import java.util.List;

import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.manage.domain.AttendanceUbiData;
import com.yanzhu.manage.mapper.AttendanceUbiDataMapper;
import com.yanzhu.manage.service.IAttendanceUbiDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 考勤管理Service业务层处理
 * 
 * @author yanzhu
 * @date 2024-10-12
 */
@Service
public class AttendanceUbiDataServiceImpl implements IAttendanceUbiDataService
{
    @Autowired
    private AttendanceUbiDataMapper attendanceUbiDataMapper;

    /**
     * 查询考勤管理
     * 
     * @param id 考勤管理主键
     * @return 考勤管理
     */
    @Override
    public AttendanceUbiData selectAttendanceUbiDataById(Long id)
    {
        return attendanceUbiDataMapper.selectAttendanceUbiDataById(id);
    }

    /**
     * 查询考勤管理列表
     * 
     * @param attendanceUbiData 考勤管理
     * @return 考勤管理
     */
    @Override
    public List<AttendanceUbiData> selectAttendanceUbiDataList(AttendanceUbiData attendanceUbiData)
    {
        return attendanceUbiDataMapper.selectAttendanceUbiDataList(attendanceUbiData);
    }

    @Override
    public List<AttendanceUbiData> queryAttendaceInfo(AttendanceUbiData where) {
        return attendanceUbiDataMapper.queryAttendaceInfo(where);
    }

    /**
     * 新增考勤管理
     * 
     * @param attendanceUbiData 考勤管理
     * @return 结果
     */
    @Override
    public int insertAttendanceUbiData(AttendanceUbiData attendanceUbiData)
    {
        attendanceUbiData.setCreateBy(SecurityContextHolder.getUserName());
        attendanceUbiData.setCreateTime(DateUtils.getNowDate());
        return attendanceUbiDataMapper.insertAttendanceUbiData(attendanceUbiData);
    }

    /**
     * 修改考勤管理
     * 
     * @param attendanceUbiData 考勤管理
     * @return 结果
     */
    @Override
    public int updateAttendanceUbiData(AttendanceUbiData attendanceUbiData)
    {
        attendanceUbiData.setUpdateBy(SecurityContextHolder.getUserName());
        attendanceUbiData.setUpdateTime(DateUtils.getNowDate());
        return attendanceUbiDataMapper.updateAttendanceUbiData(attendanceUbiData);
    }

    /**
     * 批量删除考勤管理
     * 
     * @param ids 需要删除的考勤管理主键
     * @return 结果
     */
    @Override
    public int deleteAttendanceUbiDataByIds(Long[] ids)
    {
        return attendanceUbiDataMapper.deleteAttendanceUbiDataByIds(ids);
    }

    /**
     * 删除考勤管理信息
     * 
     * @param id 考勤管理主键
     * @return 结果
     */
    @Override
    public int deleteAttendanceUbiDataById(Long id)
    {
        return attendanceUbiDataMapper.deleteAttendanceUbiDataById(id);
    }
}
