package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallLinkRankingSchoolMapper;
import com.ruoyi.mall.domain.MallLinkRankingSchool;
import com.ruoyi.mall.service.IMallLinkRankingSchoolService;

import javax.annotation.Resource;

/**
 * 榜单与学校关联Service业务层处理
 *
 * @author LCL
 * @date 2023-10-24
 */
@Service
public class MallLinkRankingSchoolServiceImpl implements IMallLinkRankingSchoolService
{
    @Resource
    private MallLinkRankingSchoolMapper mallLinkRankingSchoolMapper;

    /**
     * 查询榜单与学校关联
     *
     * @param linkId 榜单与学校关联主键
     * @return 榜单与学校关联
     */
    @Override
    public MallLinkRankingSchool selectMallLinkRankingSchoolByLinkId(Long linkId)
    {
        return mallLinkRankingSchoolMapper.selectMallLinkRankingSchoolByLinkId(linkId);
    }

    /**
     * 查询榜单与学校关联列表
     *
     * @param mallLinkRankingSchool 榜单与学校关联
     * @return 榜单与学校关联
     */
    @Override
    public List<MallLinkRankingSchool> selectMallLinkRankingSchoolList(MallLinkRankingSchool mallLinkRankingSchool)
    {
        return mallLinkRankingSchoolMapper.selectMallLinkRankingSchoolList(mallLinkRankingSchool);
    }

    /**
     * 新增榜单与学校关联
     *
     * @param mallLinkRankingSchool 榜单与学校关联
     * @return 结果
     */
    @Override
    public int insertMallLinkRankingSchool(MallLinkRankingSchool mallLinkRankingSchool)
    {
        mallLinkRankingSchool.setCreateAt(DateUtils.getTime());
        return mallLinkRankingSchoolMapper.insertMallLinkRankingSchool(mallLinkRankingSchool);
    }

    /**
     * 修改榜单与学校关联
     *
     * @param mallLinkRankingSchool 榜单与学校关联
     * @return 结果
     */
    @Override
    public int updateMallLinkRankingSchool(MallLinkRankingSchool mallLinkRankingSchool)
    {
        mallLinkRankingSchool.setUpdateAt(DateUtils.getTime());
        return mallLinkRankingSchoolMapper.updateMallLinkRankingSchool(mallLinkRankingSchool);
    }

    /**
     * 批量删除榜单与学校关联
     *
     * @param linkIds 需要删除的榜单与学校关联主键
     * @return 结果
     */
    @Override
    public int deleteMallLinkRankingSchoolByLinkIds(Long[] linkIds)
    {
        return mallLinkRankingSchoolMapper.deleteMallLinkRankingSchoolByLinkIds(linkIds);
    }

    /**
     * 删除榜单与学校关联信息
     *
     * @param linkId 榜单与学校关联主键
     * @return 结果
     */
    @Override
    public int deleteMallLinkRankingSchoolByLinkId(Long linkId)
    {
        return mallLinkRankingSchoolMapper.deleteMallLinkRankingSchoolByLinkId(linkId);
    }
}
