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.MallLinkCareerMajorMapper;
import com.ruoyi.mall.domain.MallLinkCareerMajor;
import com.ruoyi.mall.service.IMallLinkCareerMajorService;

import javax.annotation.Resource;

/**
 * 职业与专业关联Service业务层处理
 *
 * @author LCL
 * @date 2023-10-19
 */
@Service
public class MallLinkCareerMajorServiceImpl implements IMallLinkCareerMajorService
{
    @Resource
    private MallLinkCareerMajorMapper mallLinkCareerMajorMapper;

    /**
     * 查询职业与专业关联
     *
     * @param linkId 职业与专业关联主键
     * @return 职业与专业关联
     */
    @Override
    public MallLinkCareerMajor selectMallLinkCareerMajorByLinkId(Long linkId)
    {
        return mallLinkCareerMajorMapper.selectMallLinkCareerMajorByLinkId(linkId);
    }

    /**
     * 查询职业与专业关联列表
     *
     * @param mallLinkCareerMajor 职业与专业关联
     * @return 职业与专业关联
     */
    @Override
    public List<MallLinkCareerMajor> selectMallLinkCareerMajorList(MallLinkCareerMajor mallLinkCareerMajor)
    {
        return mallLinkCareerMajorMapper.selectMallLinkCareerMajorList(mallLinkCareerMajor);
    }

    /**
     * 新增职业与专业关联
     *
     * @param mallLinkCareerMajor 职业与专业关联
     * @return 结果
     */
    @Override
    public int insertMallLinkCareerMajor(MallLinkCareerMajor mallLinkCareerMajor)
    {
        mallLinkCareerMajor.setCreateAt(DateUtils.getTime());
        return mallLinkCareerMajorMapper.insertMallLinkCareerMajor(mallLinkCareerMajor);
    }

    /**
     * 修改职业与专业关联
     *
     * @param mallLinkCareerMajor 职业与专业关联
     * @return 结果
     */
    @Override
    public int updateMallLinkCareerMajor(MallLinkCareerMajor mallLinkCareerMajor)
    {
        mallLinkCareerMajor.setUpdateAt(DateUtils.getTime());
        return mallLinkCareerMajorMapper.updateMallLinkCareerMajor(mallLinkCareerMajor);
    }

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

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