package io.renren.service.impl;

import io.renren.dao.ConsumePeopleDayMapper;
import io.renren.entity.ConsumePeopleDay;
import io.renren.service.IConsumePeopleDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * 人员餐补信息Service业务层处理
 *
 * @author dcsoft
 * @date 2024-09-20
 */
@Service
public class ConsumePeopleDayServiceImpl implements IConsumePeopleDayService
{
    @Autowired
    private ConsumePeopleDayMapper consumePeopleDayMapper;

    /**
     * 查询人员餐补信息
     *
     * @param id 人员餐补信息主键
     * @return 人员餐补信息
     */
    @Override
    public ConsumePeopleDay selectConsumePeopleDayById(Long id)
    {
        return consumePeopleDayMapper.selectConsumePeopleDayById(id);
    }

    /**
     * 查询人员餐补信息列表
     *
     * @param consumePeopleDay 人员餐补信息
     * @return 人员餐补信息
     */
    @Override
    public List<ConsumePeopleDay> selectConsumePeopleDayList(ConsumePeopleDay consumePeopleDay)
    {
        return consumePeopleDayMapper.selectConsumePeopleDayList(consumePeopleDay);
    }

    /**
     * 新增人员餐补信息
     *
     * @param consumePeopleDay 人员餐补信息
     * @return 结果
     */
    @Override
    public int insertConsumePeopleDay(ConsumePeopleDay consumePeopleDay)
    {
        consumePeopleDay.setCreateTime(new Date());
        return consumePeopleDayMapper.insertConsumePeopleDay(consumePeopleDay);
    }

    /**
     * 修改人员餐补信息
     *
     * @param consumePeopleDay 人员餐补信息
     * @return 结果
     */
    @Override
    public int updateConsumePeopleDay(ConsumePeopleDay consumePeopleDay)
    {
        consumePeopleDay.setUpdateTime(new Date());
        return consumePeopleDayMapper.updateConsumePeopleDay(consumePeopleDay);
    }

    /**
     * 批量删除人员餐补信息
     *
     * @param ids 需要删除的人员餐补信息主键
     * @return 结果
     */
    @Override
    public int deleteConsumePeopleDayByIds(Long[] ids)
    {
        return consumePeopleDayMapper.deleteConsumePeopleDayByIds(ids);
    }

    /**
     * 删除人员餐补信息信息
     *
     * @param id 人员餐补信息主键
     * @return 结果
     */
    @Override
    public int deleteConsumePeopleDayById(Long id)
    {
        return consumePeopleDayMapper.deleteConsumePeopleDayById(id);
    }
}
