package com.fs.store.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.store.mapper.FsStoreCanvasMapper;
import com.fs.store.domain.FsStoreCanvas;
import com.fs.store.service.IFsStoreCanvasService;

/**
 * 画布信息Service业务层处理
 * 
 * @author fs
 * @date 2022-08-29
 */
@Service
public class FsStoreCanvasServiceImpl implements IFsStoreCanvasService 
{
    @Autowired
    private FsStoreCanvasMapper fsStoreCanvasMapper;

    /**
     * 查询画布信息
     * 
     * @param canvasId 画布信息ID
     * @return 画布信息
     */
    @Override
    public FsStoreCanvas selectFsStoreCanvasById(Long canvasId)
    {
        return fsStoreCanvasMapper.selectFsStoreCanvasById(canvasId);
    }

    /**
     * 查询画布信息列表
     * 
     * @param fsStoreCanvas 画布信息
     * @return 画布信息
     */
    @Override
    public List<FsStoreCanvas> selectFsStoreCanvasList(FsStoreCanvas fsStoreCanvas)
    {
        return fsStoreCanvasMapper.selectFsStoreCanvasList(fsStoreCanvas);
    }

    /**
     * 新增画布信息
     * 
     * @param fsStoreCanvas 画布信息
     * @return 结果
     */
    @Override
    public int insertFsStoreCanvas(FsStoreCanvas fsStoreCanvas)
    {
        fsStoreCanvas.setCreateTime(DateUtils.getNowDate());
        return fsStoreCanvasMapper.insertFsStoreCanvas(fsStoreCanvas);
    }

    /**
     * 修改画布信息
     * 
     * @param fsStoreCanvas 画布信息
     * @return 结果
     */
    @Override
    public int updateFsStoreCanvas(FsStoreCanvas fsStoreCanvas)
    {
        fsStoreCanvas.setUpdateTime(DateUtils.getNowDate());
        return fsStoreCanvasMapper.updateFsStoreCanvas(fsStoreCanvas);
    }

    /**
     * 批量删除画布信息
     * 
     * @param canvasIds 需要删除的画布信息ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreCanvasByIds(Long[] canvasIds)
    {
        return fsStoreCanvasMapper.deleteFsStoreCanvasByIds(canvasIds);
    }

    /**
     * 删除画布信息信息
     * 
     * @param canvasId 画布信息ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreCanvasById(Long canvasId)
    {
        return fsStoreCanvasMapper.deleteFsStoreCanvasById(canvasId);
    }

    @Override
    public FsStoreCanvas selectFsStoreCanvasByTerminal(Integer terminal) {
        return fsStoreCanvasMapper.selectFsStoreCanvasByTerminal(terminal);
    }
}
