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

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

    /**
     * 查询素材分组
     * 
     * @param groupId 素材分组主键
     * @return 素材分组
     */
    @Override
    public FsMaterialGroup selectFsMaterialGroupByGroupId(Long groupId)
    {
        return fsMaterialGroupMapper.selectFsMaterialGroupByGroupId(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 需要删除的素材分组主键
     * @return 结果
     */
    @Override
    public int deleteFsMaterialGroupByGroupIds(Long[] groupIds)
    {
        return fsMaterialGroupMapper.deleteFsMaterialGroupByGroupIds(groupIds);
    }

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