package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.OperatingHours;
import com.ruoyi.system.mapper.OperatingHoursMapper;
import com.ruoyi.system.service.IOperatingHoursService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * OperatingHoursService业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-11
 */
@Service
public class OperatingHoursServiceImpl extends ServiceImpl<BaseMapper<OperatingHours>,OperatingHours> implements IOperatingHoursService
{
    @Autowired
    private OperatingHoursMapper operatingHoursMapper;

    /**
     * 查询OperatingHours
     * 
     * @param id OperatingHours主键
     * @return OperatingHours
     */
    @Override
    public OperatingHours selectOperatingHoursById(Long id)
    {
        return operatingHoursMapper.selectOperatingHoursById(id);
    }

    /**
     * 查询OperatingHours列表
     * 
     * @param operatingHours OperatingHours
     * @return OperatingHours
     */
    @Override
    public List<OperatingHours> selectOperatingHoursList(OperatingHours operatingHours)
    {
        return operatingHoursMapper.selectOperatingHoursList(operatingHours);
    }

    /**
     * 新增OperatingHours
     * 
     * @param operatingHours OperatingHours
     * @return 结果
     */
    @Override
    public int insertOperatingHours(OperatingHours operatingHours)
    {
        return operatingHoursMapper.insertOperatingHours(operatingHours);
    }

    /**
     * 修改OperatingHours
     * 
     * @param operatingHours OperatingHours
     * @return 结果
     */
    @Override
    public int updateOperatingHours(OperatingHours operatingHours)
    {
        return operatingHoursMapper.updateOperatingHours(operatingHours);
    }

    /**
     * 批量删除OperatingHours
     * 
     * @param ids 需要删除的OperatingHours主键
     * @return 结果
     */
    @Override
    public int deleteOperatingHoursByIds(Long[] ids)
    {
        return operatingHoursMapper.deleteOperatingHoursByIds(ids);
    }

    /**
     * 删除OperatingHours信息
     * 
     * @param id OperatingHours主键
     * @return 结果
     */
    @Override
    public int deleteOperatingHoursById(Long id)
    {
        return operatingHoursMapper.deleteOperatingHoursById(id);
    }

    /**
     * 新增OperatingHours并返回主键
     * 
     * @param operatingHours OperatingHours
     * @return 结果
     */
    @Override
    public Long insertOperatingHoursReturnId(OperatingHours operatingHours)
    {
        int result = operatingHoursMapper.insertOperatingHours(operatingHours);
        if (result > 0) {
            return operatingHours.getId();
        }
        return null;
    }
    
}
