package com.ruoyi.mall.service.impl;

import java.math.BigDecimal;
import java.util.AbstractMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallCareerMajorMapper;
import com.ruoyi.mall.domain.MallCareerMajor;
import com.ruoyi.mall.service.IMallCareerMajorService;

import javax.annotation.Resource;

/**
 * 职业专业关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-25
 */
@Service
public class MallCareerMajorServiceImpl implements IMallCareerMajorService 
{
    @Resource
    private MallCareerMajorMapper mallCareerMajorMapper;


    @Override
    public List<MallCareerMajor> selectListByMajor(Long majorId, Long orderType) {
        List<MallCareerMajor> mallCareerMajors = mallCareerMajorMapper.selectMallCareerMajorByMajorId(majorId, orderType);
        return mallCareerMajors;
    }

    /**
     * 查询职业专业关联
     * 
     * @param linkId 职业专业关联主键
     * @return 职业专业关联
     */
    @Override
    public MallCareerMajor selectMallCareerMajorByLinkId(Long linkId)
    {
        return mallCareerMajorMapper.selectMallCareerMajorByLinkId(linkId);
    }

    /**
     * 查询职业专业关联列表
     * 
     * @param mallCareerMajor 职业专业关联
     * @return 职业专业关联
     */
    @Override
    public List<MallCareerMajor> selectMallCareerMajorList(MallCareerMajor mallCareerMajor)
    {
        return mallCareerMajorMapper.selectMallCareerMajorList(mallCareerMajor);
    }

    /**
     * 新增职业专业关联
     * 
     * @param mallCareerMajor 职业专业关联
     * @return 结果
     */
    @Override
    public int insertMallCareerMajor(MallCareerMajor mallCareerMajor)
    {
        mallCareerMajor.setCreateAt(DateUtils.getTime());
        return mallCareerMajorMapper.insertMallCareerMajor(mallCareerMajor);
    }

    /**
     * 修改职业专业关联
     * 
     * @param mallCareerMajor 职业专业关联
     * @return 结果
     */
    @Override
    public int updateMallCareerMajor(MallCareerMajor mallCareerMajor)
    {
        mallCareerMajor.setUpdateAt(DateUtils.getTime());
        return mallCareerMajorMapper.updateMallCareerMajor(mallCareerMajor);
    }

    /**
     * 批量删除职业专业关联
     * 
     * @param linkIds 需要删除的职业专业关联主键
     * @return 结果
     */
    @Override
    public int deleteMallCareerMajorByLinkIds(Long[] linkIds)
    {
        return mallCareerMajorMapper.deleteMallCareerMajorByLinkIds(linkIds);
    }

    /**
     * 删除职业专业关联信息
     * 
     * @param linkId 职业专业关联主键
     * @return 结果
     */
    @Override
    public int deleteMallCareerMajorByLinkId(Long linkId)
    {
        return mallCareerMajorMapper.deleteMallCareerMajorByLinkId(linkId);
    }
}
