package com.ruoyi.buyerapi.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.buyerapi.mapper.BuyerEmpWorkhourMonthMapper;
import com.ruoyi.buyerapi.domain.BuyerEmpWorkhourMonth;
import com.ruoyi.buyerapi.service.IBuyerEmpWorkhourMonthService;

/**
 * 员工工时分摊月报Service业务层处理
 *
 * @author ruoyi
 * @date 2022-09-22
 */
@Service
public class BuyerEmpWorkhourMonthServiceImpl implements IBuyerEmpWorkhourMonthService
{
    @Autowired
    private BuyerEmpWorkhourMonthMapper buyerEmpWorkhourMonthMapper;

    /**
     * 查询员工工时分摊月报
     *
     * @param id 员工工时分摊月报主键
     * @return 员工工时分摊月报
     */
    @Override
    public BuyerEmpWorkhourMonth selectBuyerEmpWorkhourMonthById(String id)
    {
        return buyerEmpWorkhourMonthMapper.selectBuyerEmpWorkhourMonthById(id);
    }

    /**
     * 查询员工工时分摊月报列表
     *
     * @param buyerEmpWorkhourMonth 员工工时分摊月报
     * @return 员工工时分摊月报
     */
    @Override
    public List<BuyerEmpWorkhourMonth> selectBuyerEmpWorkhourMonthList(BuyerEmpWorkhourMonth buyerEmpWorkhourMonth)
    {
        return buyerEmpWorkhourMonthMapper.selectBuyerEmpWorkhourMonthList(buyerEmpWorkhourMonth);
    }

    /**
     * 新增员工工时分摊月报
     *
     * @param buyerEmpWorkhourMonth 员工工时分摊月报
     * @return 结果
     */
    @Override
    public int insertBuyerEmpWorkhourMonth(BuyerEmpWorkhourMonth buyerEmpWorkhourMonth)
    {
        buyerEmpWorkhourMonth.setCreateTime(DateUtils.getNowDate());
        return buyerEmpWorkhourMonthMapper.insertBuyerEmpWorkhourMonth(buyerEmpWorkhourMonth);
    }

    /**
     * 修改员工工时分摊月报
     *
     * @param buyerEmpWorkhourMonth 员工工时分摊月报
     * @return 结果
     */
    @Override
    public int updateBuyerEmpWorkhourMonth(BuyerEmpWorkhourMonth buyerEmpWorkhourMonth)
    {
        buyerEmpWorkhourMonth.setUpdateTime(DateUtils.getNowDate());
        return buyerEmpWorkhourMonthMapper.updateBuyerEmpWorkhourMonth(buyerEmpWorkhourMonth);
    }

    /**
     * 批量删除员工工时分摊月报
     *
     * @param ids 需要删除的员工工时分摊月报主键
     * @return 结果
     */
    @Override
    public int deleteBuyerEmpWorkhourMonthByIds(String[] ids)
    {
        return buyerEmpWorkhourMonthMapper.deleteBuyerEmpWorkhourMonthByIds(ids);
    }

    /**
     * 删除员工工时分摊月报信息
     *
     * @param id 员工工时分摊月报主键
     * @return 结果
     */
    @Override
    public int deleteBuyerEmpWorkhourMonthById(String id)
    {
        return buyerEmpWorkhourMonthMapper.deleteBuyerEmpWorkhourMonthById(id);
    }

    @Override
    public int deleteBuyerEmpWorkhourMonth(BuyerEmpWorkhourMonth buyerEmpWorkhourMonth) {
        return buyerEmpWorkhourMonthMapper.deleteBuyerEmpWorkhourMonth(buyerEmpWorkhourMonth);
    }
}
