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.FsStoreProductCategoryMapper;
import com.fs.store.domain.FsStoreProductCategory;
import com.fs.store.service.IFsStoreProductCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author fs
 * @date 2022-03-15
 */
@Service
public class FsStoreProductCategoryServiceImpl implements IFsStoreProductCategoryService 
{
    @Autowired
    private FsStoreProductCategoryMapper fsStoreProductCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param cateId 商品分类ID
     * @return 商品分类
     */
    @Override
    public FsStoreProductCategory selectFsStoreProductCategoryById(Long cateId)
    {
        return fsStoreProductCategoryMapper.selectFsStoreProductCategoryById(cateId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param fsStoreProductCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<FsStoreProductCategory> selectFsStoreProductCategoryList(FsStoreProductCategory fsStoreProductCategory)
    {
        return fsStoreProductCategoryMapper.selectFsStoreProductCategoryList(fsStoreProductCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param fsStoreProductCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertFsStoreProductCategory(FsStoreProductCategory fsStoreProductCategory)
    {
        fsStoreProductCategory.setCreateTime(DateUtils.getNowDate());
        return fsStoreProductCategoryMapper.insertFsStoreProductCategory(fsStoreProductCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param fsStoreProductCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateFsStoreProductCategory(FsStoreProductCategory fsStoreProductCategory)
    {
        fsStoreProductCategory.setUpdateTime(DateUtils.getNowDate());
        return fsStoreProductCategoryMapper.updateFsStoreProductCategory(fsStoreProductCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param cateIds 需要删除的商品分类ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreProductCategoryByIds(Long[] cateIds)
    {
        return fsStoreProductCategoryMapper.deleteFsStoreProductCategoryByIds(cateIds);
    }

    /**
     * 删除商品分类信息
     * 
     * @param cateId 商品分类ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreProductCategoryById(Long cateId)
    {
        return fsStoreProductCategoryMapper.deleteFsStoreProductCategoryById(cateId);
    }

    @Override
    public List<FsStoreProductCategory> selectFsStoreProductCategoryListQuery(FsStoreProductCategory param) {
        return fsStoreProductCategoryMapper.selectFsStoreProductCategoryListQuery(param);
    }
}
