package com.fs.hisStore.service.impl;

import com.fs.common.core.domain.BaseEntity;
import com.fs.common.utils.DateUtils;
import com.fs.hisStore.domain.FsStoreRecommendScrm;
import com.fs.hisStore.mapper.FsStoreRecommendScrmMapper;
import com.fs.hisStore.service.IFsStoreRecommendScrmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 店铺推荐Service业务层处理
 *
 * @author fs
 * @date 2023-06-15
 */
@Service
public class IFsStoreRecommendScrmServiceImpl implements IFsStoreRecommendScrmService {

    @Autowired
    private FsStoreRecommendScrmMapper fsStoreRecommendScrmMapper;

    /**
     * 查询店铺推荐
     *
     * @param id 店铺推荐主键
     * @return 店铺推荐
     */
    @Override
    public FsStoreRecommendScrm selectFsStoreRecommendScrmById(Long id) {
        return fsStoreRecommendScrmMapper.selectFsStoreRecommendScrmById(id);
    }

    /**
     * 查询店铺推荐列表
     *
     * @param fsStoreRecommendScrm 店铺推荐
     * @return 店铺推荐
     */
    @Override
    public List<FsStoreRecommendScrm> selectFsStoreRecommendScrmList(FsStoreRecommendScrm fsStoreRecommendScrm) {
        return fsStoreRecommendScrmMapper.selectFsStoreRecommendScrmList(fsStoreRecommendScrm);
    }

    /**
     * 查询有效的推荐店铺列表
     *
     * @param fsStoreRecommendScrm 店铺推荐
     * @return 店铺推荐集合
     */
    @Override
    public List<FsStoreRecommendScrm> selectValidRecommendList(FsStoreRecommendScrm fsStoreRecommendScrm) {
        return fsStoreRecommendScrmMapper.selectValidRecommendList(fsStoreRecommendScrm);
    }

    /**
     * 新增店铺推荐
     *
     * @param fsStoreRecommendScrm 店铺推荐
     * @return 结果
     */
    @Override
    public int insertFsStoreRecommendScrm(FsStoreRecommendScrm fsStoreRecommendScrm) {
        fsStoreRecommendScrm.setCreateTime(DateUtils.getNowDate());
        return fsStoreRecommendScrmMapper.insertFsStoreRecommendScrm(fsStoreRecommendScrm);
    }

    /**
     * 修改店铺推荐
     *
     * @param fsStoreRecommendScrm 店铺推荐
     * @return 结果
     */
    @Override
    public int updateFsStoreRecommendScrm(FsStoreRecommendScrm fsStoreRecommendScrm) {
        fsStoreRecommendScrm.setUpdateTime(DateUtils.getNowDate());
        return fsStoreRecommendScrmMapper.updateFsStoreRecommendScrm(fsStoreRecommendScrm);
    }

    /**
     * 批量删除店铺推荐
     *
     * @param ids 需要删除的店铺推荐主键
     * @return 结果
     */
    @Override
    public int deleteFsStoreRecommendScrmByIds(Long[] ids) {
        return fsStoreRecommendScrmMapper.deleteFsStoreRecommendScrmByIds(ids);
    }

    /**
     * 删除店铺推荐信息
     *
     * @param id 店铺推荐主键
     * @return 结果
     */
    @Override
    public int deleteFsStoreRecommendScrmById(Long id) {
        return fsStoreRecommendScrmMapper.deleteFsStoreRecommendScrmById(id);
    }
}
