package com.weather.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.weather.entity.WeaRotaInfo;
import com.weather.mapper.WeaRotaInfoMapper;
import com.weather.service.IWeaRotaInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author feng
 * @since 2023-09-05
 */
@Service
public class WeaRotaInfoServiceImpl extends ServiceImpl<WeaRotaInfoMapper, WeaRotaInfo> implements IWeaRotaInfoService {

    @Autowired
    private WeaRotaInfoMapper weaRotaInfoMapper;

    /**
     * 查询值班信息
     *
     * @param id 值班ID
     * @return 值班信息
     */
    @Override
    public WeaRotaInfo selectWeaRotaInfoById(Long id)
    {
        return weaRotaInfoMapper.selectWeaRotaInfoById(id);
    }

    /**
     * 查询值班信息
     *
     * @param startDate,endDate
     * @return 值班信息
     */
    @Override
    public List<WeaRotaInfo> selectWeaRotaInfoByDate(Date startDate , Date endDate)
    {
        return weaRotaInfoMapper.selectWeaRotaInfoByDate(startDate,endDate);
    }

    /**
     * 查询值班列表
     *
     * @param weaRotaInfo 值班信息
     * @return 值班集合
     */
    @Override
    public List<WeaRotaInfo> selectWeaRotaInfoList(WeaRotaInfo weaRotaInfo)
    {
        return weaRotaInfoMapper.selectWeaRotaInfoList(weaRotaInfo);
    }

    /**
     * 新增值班
     *
     * @param weaRotaInfo 值班信息
     * @return 结果
     */
    @Override
    public int insertWeaRotaInfo(WeaRotaInfo weaRotaInfo)
    {

        return weaRotaInfoMapper.insertWeaRotaInfo(weaRotaInfo);
    }

    /**
     * 修改值班
     *
     * @param weaRotaInfo 值班信息
     * @return 结果
     */
    @Override
    public int updateWeaRotaInfo(WeaRotaInfo weaRotaInfo)
    {
        return weaRotaInfoMapper.updateWeaRotaInfo(weaRotaInfo);
    }

    /**
     * 删除值班对象
     *
     * @param id 值班ID
     * @return 结果
     */
    @Override
    public int deleteWeaRotaInfoById(Long id)
    {
        return weaRotaInfoMapper.deleteWeaRotaInfoById(id);
    }



}
