package com.ruoyi.frequency.workspanorama.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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.frequency.workspanorama.mapper.WorksPanoramaMapper;
import com.ruoyi.frequency.workspanorama.entity.WorksPanorama;
import com.ruoyi.frequency.workspanorama.service.WorksPanoramaService;

/**
 * 作品和全景图关联Service业务层处理
 *
 * @author zj
 * @date 2023-09-22
 */
@Service
public class WorksPanoramaServiceImpl extends ServiceImpl<WorksPanoramaMapper, WorksPanorama>  implements WorksPanoramaService
{
    @Autowired
    private WorksPanoramaMapper worksPanoramaMapper;

    /**
     * 查询作品和全景图关联
     *
     * @param id 作品和全景图关联主键
     * @return 作品和全景图关联
     */
    @Override
    public WorksPanorama selectWorksPanoramaById(Long id)
    {
        return worksPanoramaMapper.selectWorksPanoramaById(id);
    }

    /**
     * 查询作品和全景图关联列表
     *
     * @param worksPanorama 作品和全景图关联
     * @return 作品和全景图关联
     */
    @Override
    public List<WorksPanorama> selectWorksPanoramaList(WorksPanorama worksPanorama)
    {
        return worksPanoramaMapper.selectWorksPanoramaList(worksPanorama);
    }

    /**
     * 新增作品和全景图关联
     *
     * @param worksPanorama 作品和全景图关联
     * @return 结果
     */
    @Override
    public int insertWorksPanorama(WorksPanorama worksPanorama)
    {
        return worksPanoramaMapper.insertWorksPanorama(worksPanorama);
    }

    /**
     * 修改作品和全景图关联
     *
     * @param worksPanorama 作品和全景图关联
     * @return 结果
     */
    @Override
    public int updateWorksPanorama(WorksPanorama worksPanorama)
    {
        worksPanorama.setUpdateTime(DateUtils.getNowDate());
        return worksPanoramaMapper.updateWorksPanorama(worksPanorama);
    }

    /**
     * 批量删除作品和全景图关联
     *
     * @param ids 需要删除的作品和全景图关联主键
     * @return 结果
     */
    @Override
    public int deleteWorksPanoramaByIds(Long[] ids)
    {
        return worksPanoramaMapper.deleteWorksPanoramaByIds(ids);
    }

    /**
     * 删除作品和全景图关联信息
     *
     * @param id 作品和全景图关联主键
     * @return 结果
     */
    @Override
    public int deleteWorksPanoramaById(Long id)
    {
        return worksPanoramaMapper.deleteWorksPanoramaById(id);
    }
}
