package com.ruoyi.system.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.system.mapper.DailyWorkMapper;
import com.ruoyi.system.domain.DailyWork;
import com.ruoyi.system.service.IDailyWorkService;

/**
 * 作品每日统计Service业务层处理
 * 
 * @author haotian
 * @date 2024-11-08
 */
@Service
public class DailyWorkServiceImpl implements IDailyWorkService 
{
    @Autowired
    private DailyWorkMapper dailyWorkMapper;

    /**
     * 查询作品每日统计
     * 
     * @param dailyWorkId 作品每日统计主键
     * @return 作品每日统计
     */
    @Override
    public DailyWork selectDailyWorkByDailyWorkId(Long dailyWorkId)
    {
        return dailyWorkMapper.selectDailyWorkByDailyWorkId(dailyWorkId);
    }

    /**
     * 查询作品每日统计列表
     * 
     * @param dailyWork 作品每日统计
     * @return 作品每日统计
     */
    @Override
    public List<DailyWork> selectDailyWorkList(DailyWork dailyWork)
    {
        return dailyWorkMapper.selectDailyWorkList(dailyWork);
    }

    /**
     * 新增作品每日统计
     * 
     * @param dailyWork 作品每日统计
     * @return 结果
     */
    @Override
    public int insertDailyWork(DailyWork dailyWork)
    {
        dailyWork.setCreateTime(DateUtils.getNowDate());
        return dailyWorkMapper.insertDailyWork(dailyWork);
    }

    /**
     * 修改作品每日统计
     * 
     * @param dailyWork 作品每日统计
     * @return 结果
     */
    @Override
    public int updateDailyWork(DailyWork dailyWork)
    {
        dailyWork.setUpdateTime(DateUtils.getNowDate());
        return dailyWorkMapper.updateDailyWork(dailyWork);
    }

    /**
     * 批量删除作品每日统计
     * 
     * @param dailyWorkIds 需要删除的作品每日统计主键
     * @return 结果
     */
    @Override
    public int deleteDailyWorkByDailyWorkIds(Long[] dailyWorkIds)
    {
        return dailyWorkMapper.deleteDailyWorkByDailyWorkIds(dailyWorkIds);
    }

    /**
     * 删除作品每日统计信息
     * 
     * @param dailyWorkId 作品每日统计主键
     * @return 结果
     */
    @Override
    public int deleteDailyWorkByDailyWorkId(Long dailyWorkId)
    {
        return dailyWorkMapper.deleteDailyWorkByDailyWorkId(dailyWorkId);
    }
}
