package com.ruoyi.system.service.impl;

import java.time.LocalDate;
import java.util.List;

import com.ruoyi.system.domain.dto.DailyScenicDto;
import com.ruoyi.system.domain.dto.DailySourceDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DailySourceMapper;
import com.ruoyi.system.domain.DailySource;
import com.ruoyi.system.service.IDailySourceService;

/**
 * 资源位每天统计Service业务层处理
 * 
 * @author haotian
 * @date 2024-12-09
 */
@Service
public class DailySourceServiceImpl implements IDailySourceService 
{
    @Autowired
    private DailySourceMapper dailySourceMapper;

    /**
     * 查询资源位每天统计
     * 
     * @param dailySourceId 资源位每天统计主键
     * @return 资源位每天统计
     */
    @Override
    public DailySource selectDailySourceByDailySourceId(Long dailySourceId)
    {
        return dailySourceMapper.selectDailySourceByDailySourceId(dailySourceId);
    }

    /**
     * 查询资源位每天统计列表
     * 
     * @param dailySource 资源位每天统计
     * @return 资源位每天统计
     */
    @Override
    public List<DailySource> selectDailySourceList(DailySource dailySource)
    {
        return dailySourceMapper.selectDailySourceList(dailySource);
    }

    /**
     * 新增资源位每天统计
     * 
     * @param dailySource 资源位每天统计
     * @return 结果
     */
    @Override
    public int insertDailySource(DailySource dailySource)
    {
        return dailySourceMapper.insertDailySource(dailySource);
    }

    /**
     * 修改资源位每天统计
     * 
     * @param dailySource 资源位每天统计
     * @return 结果
     */
    @Override
    public int updateDailySource(DailySource dailySource)
    {
        return dailySourceMapper.updateDailySource(dailySource);
    }

    /**
     * 批量删除资源位每天统计
     * 
     * @param dailySourceIds 需要删除的资源位每天统计主键
     * @return 结果
     */
    @Override
    public int deleteDailySourceByDailySourceIds(Long[] dailySourceIds)
    {
        return dailySourceMapper.deleteDailySourceByDailySourceIds(dailySourceIds);
    }

    /**
     * 删除资源位每天统计信息
     * 
     * @param dailySourceId 资源位每天统计主键
     * @return 结果
     */
    @Override
    public int deleteDailySourceByDailySourceId(Long dailySourceId)
    {
        return dailySourceMapper.deleteDailySourceByDailySourceId(dailySourceId);
    }

    /*
     * 资源位每天统计
     * */
    @Override
    public DailySourceDto getStDailySource(LocalDate date){
        return dailySourceMapper.getStDailySource(date);
    }

    /*
     * 各个景区的资源位每天统计
     * */
    @Override
    public DailyScenicDto getDailyScenicDto(LocalDate date, Long scenicId){
        return dailySourceMapper.getDailyScenicDto(date,scenicId);
    }

    /*
     * 根据资源位id和日期查询资源位每天统计
     * */
    @Override
    public DailySource getDailySourceBySourceIdAndDate(Long sourceId, LocalDate date){
        return dailySourceMapper.getDailySourceBySourceIdAndDate(sourceId,date);
    }
}
