package com.admin.major.service.impl;

import java.util.List;
import com.admin.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.admin.major.mapper.ScheduleArrangeMapper;
import com.admin.major.domain.ScheduleArrange;
import com.admin.major.service.IScheduleArrangeService;

/**
 * 日程安排Service业务层处理
 * 
 * @author zewei
 * @date 2022-03-20
 */
@Service
public class ScheduleArrangeServiceImpl implements IScheduleArrangeService 
{
    @Autowired
    private ScheduleArrangeMapper scheduleArrangeMapper;

    /**
     * 查询日程安排
     * 
     * @param orginId 日程安排主键
     * @return 日程安排
     */
    @Override
    public ScheduleArrange selectScheduleArrangeByOrginId(String orginId)
    {
        return scheduleArrangeMapper.selectScheduleArrangeByOrginId(orginId);
    }

    /**
     * 查询日程安排列表
     * 
     * @param scheduleArrange 日程安排
     * @return 日程安排
     */
    @Override
    public List<ScheduleArrange> selectScheduleArrangeList(ScheduleArrange scheduleArrange)
    {
        return scheduleArrangeMapper.selectScheduleArrangeList(scheduleArrange);
    }

    /**
     * 新增日程安排
     * 
     * @param scheduleArrange 日程安排
     * @return 结果
     */
    @Override
    public int insertScheduleArrange(ScheduleArrange scheduleArrange)
    {
        scheduleArrange.setCreateTime(DateUtils.getNowDate());
        return scheduleArrangeMapper.insertScheduleArrange(scheduleArrange);
    }

    /**
     * 修改日程安排
     * 
     * @param scheduleArrange 日程安排
     * @return 结果
     */
    @Override
    public int updateScheduleArrange(ScheduleArrange scheduleArrange)
    {
        scheduleArrange.setUpdateTime(DateUtils.getNowDate());
        return scheduleArrangeMapper.updateScheduleArrange(scheduleArrange);
    }

    /**
     * 批量删除日程安排
     * 
     * @param orginIds 需要删除的日程安排主键
     * @return 结果
     */
    @Override
    public int deleteScheduleArrangeByOrginIds(String[] orginIds)
    {
        return scheduleArrangeMapper.deleteScheduleArrangeByOrginIds(orginIds);
    }

    /**
     * 删除日程安排信息
     * 
     * @param orginId 日程安排主键
     * @return 结果
     */
    @Override
    public int deleteScheduleArrangeByOrginId(String orginId)
    {
        return scheduleArrangeMapper.deleteScheduleArrangeByOrginId(orginId);
    }
}
