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.FsStoreProductRuleMapper;
import com.fs.store.domain.FsStoreProductRule;
import com.fs.store.service.IFsStoreProductRuleService;

/**
 * 商品规则值(规格)Service业务层处理
 * 
 * @author fs
 * @date 2022-03-15
 */
@Service
public class FsStoreProductRuleServiceImpl implements IFsStoreProductRuleService 
{
    @Autowired
    private FsStoreProductRuleMapper fsStoreProductRuleMapper;

    /**
     * 查询商品规则值(规格)
     * 
     * @param id 商品规则值(规格)ID
     * @return 商品规则值(规格)
     */
    @Override
    public FsStoreProductRule selectFsStoreProductRuleById(Integer id)
    {
        return fsStoreProductRuleMapper.selectFsStoreProductRuleById(id);
    }

    /**
     * 查询商品规则值(规格)列表
     * 
     * @param fsStoreProductRule 商品规则值(规格)
     * @return 商品规则值(规格)
     */
    @Override
    public List<FsStoreProductRule> selectFsStoreProductRuleList(FsStoreProductRule fsStoreProductRule)
    {
        return fsStoreProductRuleMapper.selectFsStoreProductRuleList(fsStoreProductRule);
    }

    /**
     * 新增商品规则值(规格)
     * 
     * @param fsStoreProductRule 商品规则值(规格)
     * @return 结果
     */
    @Override
    public int insertFsStoreProductRule(FsStoreProductRule fsStoreProductRule)
    {
        fsStoreProductRule.setCreateTime(DateUtils.getNowDate());
        return fsStoreProductRuleMapper.insertFsStoreProductRule(fsStoreProductRule);
    }

    /**
     * 修改商品规则值(规格)
     * 
     * @param fsStoreProductRule 商品规则值(规格)
     * @return 结果
     */
    @Override
    public int updateFsStoreProductRule(FsStoreProductRule fsStoreProductRule)
    {
        fsStoreProductRule.setUpdateTime(DateUtils.getNowDate());
        return fsStoreProductRuleMapper.updateFsStoreProductRule(fsStoreProductRule);
    }

    /**
     * 批量删除商品规则值(规格)
     * 
     * @param ids 需要删除的商品规则值(规格)ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreProductRuleByIds(Integer[] ids)
    {
        return fsStoreProductRuleMapper.deleteFsStoreProductRuleByIds(ids);
    }

    /**
     * 删除商品规则值(规格)信息
     * 
     * @param id 商品规则值(规格)ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreProductRuleById(Integer id)
    {
        return fsStoreProductRuleMapper.deleteFsStoreProductRuleById(id);
    }
}
