package com.ruoyi.sy.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.sy.mapper.SyMajorUniversityMapper;
import com.ruoyi.sy.domain.SyMajorUniversity;
import com.ruoyi.sy.service.ISyMajorUniversityService;

/**
 * 专业开设院校Service业务层处理
 * 
 * @author mingxue
 * @date 2022-07-01
 */
@Service
public class SyMajorUniversityServiceImpl implements ISyMajorUniversityService 
{
    @Autowired
    private SyMajorUniversityMapper syMajorUniversityMapper;

    /**
     * 查询专业开设院校
     * 
     * @param id 专业开设院校ID
     * @return 专业开设院校
     */
    @Override
    public SyMajorUniversity selectSyMajorUniversityById(Long id)
    {
        return syMajorUniversityMapper.selectSyMajorUniversityById(id);
    }

    /**
     * 查询专业开设院校列表
     * 
     * @param syMajorUniversity 专业开设院校
     * @return 专业开设院校
     */
    @Override
    public List<SyMajorUniversity> selectSyMajorUniversityList(SyMajorUniversity syMajorUniversity)
    {
        return syMajorUniversityMapper.selectSyMajorUniversityList(syMajorUniversity);
    }

    /**
     * 新增专业开设院校
     * 
     * @param syMajorUniversity 专业开设院校
     * @return 结果
     */
    @Override
    public int insertSyMajorUniversity(SyMajorUniversity syMajorUniversity)
    {
        syMajorUniversity.setCreateTime(DateUtils.getNowDate());
        return syMajorUniversityMapper.insertSyMajorUniversity(syMajorUniversity);
    }

    /**
     * 修改专业开设院校
     * 
     * @param syMajorUniversity 专业开设院校
     * @return 结果
     */
    @Override
    public int updateSyMajorUniversity(SyMajorUniversity syMajorUniversity)
    {
        syMajorUniversity.setUpdateTime(DateUtils.getNowDate());
        return syMajorUniversityMapper.updateSyMajorUniversity(syMajorUniversity);
    }

    /**
     * 批量删除专业开设院校
     * 
     * @param ids 需要删除的专业开设院校ID
     * @return 结果
     */
    @Override
    public int deleteSyMajorUniversityByIds(Long[] ids)
    {
        return syMajorUniversityMapper.deleteSyMajorUniversityByIds(ids);
    }

    /**
     * 删除专业开设院校信息
     * 
     * @param id 专业开设院校ID
     * @return 结果
     */
    @Override
    public int deleteSyMajorUniversityById(Long id)
    {
        return syMajorUniversityMapper.deleteSyMajorUniversityById(id);
    }
}
