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.BuyerDeviceWorkhourMonthMapper;
import com.ruoyi.buyerapi.domain.BuyerDeviceWorkhourMonth;
import com.ruoyi.buyerapi.service.IBuyerDeviceWorkhourMonthService;

/**
 * 设备工时分摊月报Service业务层处理
 *
 * @author ruoyi
 * @date 2022-09-22
 */
@Service
public class BuyerDeviceWorkhourMonthServiceImpl implements IBuyerDeviceWorkhourMonthService
{
    @Autowired
    private BuyerDeviceWorkhourMonthMapper buyerDeviceWorkhourMonthMapper;

    /**
     * 查询设备工时分摊月报
     *
     * @param id 设备工时分摊月报主键
     * @return 设备工时分摊月报
     */
    @Override
    public BuyerDeviceWorkhourMonth selectBuyerDeviceWorkhourMonthById(String id)
    {
        return buyerDeviceWorkhourMonthMapper.selectBuyerDeviceWorkhourMonthById(id);
    }

    /**
     * 查询设备工时分摊月报列表
     *
     * @param buyerDeviceWorkhourMonth 设备工时分摊月报
     * @return 设备工时分摊月报
     */
    @Override
    public List<BuyerDeviceWorkhourMonth> selectBuyerDeviceWorkhourMonthList(BuyerDeviceWorkhourMonth buyerDeviceWorkhourMonth)
    {
        return buyerDeviceWorkhourMonthMapper.selectBuyerDeviceWorkhourMonthList(buyerDeviceWorkhourMonth);
    }

    /**
     * 新增设备工时分摊月报
     *
     * @param buyerDeviceWorkhourMonth 设备工时分摊月报
     * @return 结果
     */
    @Override
    public int insertBuyerDeviceWorkhourMonth(BuyerDeviceWorkhourMonth buyerDeviceWorkhourMonth)
    {
        buyerDeviceWorkhourMonth.setCreateTime(DateUtils.getNowDate());
        return buyerDeviceWorkhourMonthMapper.insertBuyerDeviceWorkhourMonth(buyerDeviceWorkhourMonth);
    }

    /**
     * 修改设备工时分摊月报
     *
     * @param buyerDeviceWorkhourMonth 设备工时分摊月报
     * @return 结果
     */
    @Override
    public int updateBuyerDeviceWorkhourMonth(BuyerDeviceWorkhourMonth buyerDeviceWorkhourMonth)
    {
        buyerDeviceWorkhourMonth.setUpdateTime(DateUtils.getNowDate());
        return buyerDeviceWorkhourMonthMapper.updateBuyerDeviceWorkhourMonth(buyerDeviceWorkhourMonth);
    }

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

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

    @Override
    public int deleteBuyerDeviceWorkhourMonth(BuyerDeviceWorkhourMonth buyerDeviceWorkhourMonth) {
        return buyerDeviceWorkhourMonthMapper.deleteBuyerDeviceWorkhourMonth(buyerDeviceWorkhourMonth);
    }
}
