package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.mall.domain.Vo.SchoolSuggestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallSchoolSuggestMapper;
import com.ruoyi.mall.domain.MallSchoolSuggest;
import com.ruoyi.mall.service.IMallSchoolSuggestService;

import javax.annotation.Resource;

/**
 * 推荐度Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-28
 */
@Service
public class MallSchoolSuggestServiceImpl implements IMallSchoolSuggestService
{
    @Resource
    private MallSchoolSuggestMapper mallSchoolSuggestMapper;

    /**
     * 查询推荐度
     *
     * @param suggestId 推荐度主键
     * @return 推荐度
     */
    @Override
    public MallSchoolSuggest selectMallSchoolSuggestBySuggestId(Long suggestId)
    {
        return mallSchoolSuggestMapper.selectMallSchoolSuggestBySuggestId(suggestId);
    }

    /**
     * 查询推荐度列表
     *
     * @param mallSchoolSuggest 推荐度
     * @return 推荐度
     */
    @Override
    public List<MallSchoolSuggest> selectMallSchoolSuggestList(MallSchoolSuggest mallSchoolSuggest)
    {
        return mallSchoolSuggestMapper.selectMallSchoolSuggestList(mallSchoolSuggest);
    }

    /**
     * 新增推荐度
     *
     * @param mallSchoolSuggest 推荐度
     * @return 结果
     */
    @Override
    public int insertMallSchoolSuggest(MallSchoolSuggest mallSchoolSuggest)
    {
        mallSchoolSuggest.setCreateAt(DateUtils.getTime());
        mallSchoolSuggest.setDelFlag("0");
        return mallSchoolSuggestMapper.insertMallSchoolSuggest(mallSchoolSuggest);
    }

    /**
     * 修改推荐度
     *
     * @param mallSchoolSuggest 推荐度
     * @return 结果
     */
    @Override
    public int updateMallSchoolSuggest(MallSchoolSuggest mallSchoolSuggest)
    {
        return mallSchoolSuggestMapper.updateMallSchoolSuggest(mallSchoolSuggest);
    }

    /**
     * 批量删除推荐度
     *
     * @param suggestIds 需要删除的推荐度主键
     * @return 结果
     */
    @Override
    public int deleteMallSchoolSuggestBySuggestIds(Long[] suggestIds)
    {
        return mallSchoolSuggestMapper.deleteMallSchoolSuggestBySuggestIds(suggestIds);
    }

    /**
     * 删除推荐度信息
     *
     * @param suggestId 推荐度主键
     * @return 结果
     */
    @Override
    public int deleteMallSchoolSuggestBySuggestId(Long suggestId)
    {
        return mallSchoolSuggestMapper.deleteMallSchoolSuggestBySuggestId(suggestId);
    }

    /**
     * 推荐度列表
     * @return 结果
     */
    @Override
    public List<SchoolSuggestVO> selectSuggestList() {
        return  mallSchoolSuggestMapper.selectSuggestList();
    }
}
