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.FsMaterialGroupMapper;
import com.fs.store.domain.FsMaterialGroup;
import com.fs.store.service.IFsMaterialGroupService;

/**
 * 素材分组Service业务层处理
 * 
 * @author fs
 * @date 2022-03-15
 */
@Service
public class FsMaterialGroupServiceImpl implements IFsMaterialGroupService 
{
    @Autowired
    private FsMaterialGroupMapper fsMaterialGroupMapper;

    /**
     * 查询素材分组
     * 
     * @param groupId 素材分组ID
     * @return 素材分组
     */
    @Override
    public FsMaterialGroup selectFsMaterialGroupById(Long groupId)
    {
        return fsMaterialGroupMapper.selectFsMaterialGroupById(groupId);
    }

    /**
     * 查询素材分组列表
     * 
     * @param fsMaterialGroup 素材分组
     * @return 素材分组
     */
    @Override
    public List<FsMaterialGroup> selectFsMaterialGroupList(FsMaterialGroup fsMaterialGroup)
    {
        return fsMaterialGroupMapper.selectFsMaterialGroupList(fsMaterialGroup);
    }

    /**
     * 新增素材分组
     * 
     * @param fsMaterialGroup 素材分组
     * @return 结果
     */
    @Override
    public int insertFsMaterialGroup(FsMaterialGroup fsMaterialGroup)
    {
        fsMaterialGroup.setCreateTime(DateUtils.getNowDate());
        return fsMaterialGroupMapper.insertFsMaterialGroup(fsMaterialGroup);
    }

    /**
     * 修改素材分组
     * 
     * @param fsMaterialGroup 素材分组
     * @return 结果
     */
    @Override
    public int updateFsMaterialGroup(FsMaterialGroup fsMaterialGroup)
    {
        fsMaterialGroup.setUpdateTime(DateUtils.getNowDate());
        return fsMaterialGroupMapper.updateFsMaterialGroup(fsMaterialGroup);
    }

    /**
     * 批量删除素材分组
     * 
     * @param groupIds 需要删除的素材分组ID
     * @return 结果
     */
    @Override
    public int deleteFsMaterialGroupByIds(Long[] groupIds)
    {
        return fsMaterialGroupMapper.deleteFsMaterialGroupByIds(groupIds);
    }

    /**
     * 删除素材分组信息
     * 
     * @param groupId 素材分组ID
     * @return 结果
     */
    @Override
    public int deleteFsMaterialGroupById(Long groupId)
    {
        return fsMaterialGroupMapper.deleteFsMaterialGroupById(groupId);
    }
}
