package com.srs.staff.service.impl;

import java.util.List;

import com.srs.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.staff.mapper.StaffOneStopRoomOpeningHoursMapper;
import com.srs.staff.domain.StaffOneStopRoomOpeningHours;
import com.srs.staff.service.IStaffOneStopRoomOpeningHoursService;

/**
 * 一站式社区-功能房开放时间Service业务层处理
 *
 * @author chc
 * @date 2024-08-13
 */
@Service
public class StaffOneStopRoomOpeningHoursServiceImpl extends ServiceImpl<StaffOneStopRoomOpeningHoursMapper, StaffOneStopRoomOpeningHours> implements IStaffOneStopRoomOpeningHoursService {
    @Autowired
    private StaffOneStopRoomOpeningHoursMapper staffOneStopRoomOpeningHoursMapper;

    /**
     * 查询一站式社区-功能房开放时间
     *
     * @param ohId 一站式社区-功能房开放时间主键
     * @return 一站式社区-功能房开放时间
     */
    @Override
    public StaffOneStopRoomOpeningHours selectStaffOneStopRoomOpeningHoursByOhId(Long ohId) {
        return staffOneStopRoomOpeningHoursMapper.selectStaffOneStopRoomOpeningHoursByOhId(ohId);
    }

    /**
     * 查询一站式社区-功能房开放时间列表
     *
     * @param staffOneStopRoomOpeningHours 一站式社区-功能房开放时间
     * @return 一站式社区-功能房开放时间
     */
    @Override
    public List<StaffOneStopRoomOpeningHours> selectStaffOneStopRoomOpeningHoursList(StaffOneStopRoomOpeningHours staffOneStopRoomOpeningHours) {
        return staffOneStopRoomOpeningHoursMapper.selectStaffOneStopRoomOpeningHoursList(staffOneStopRoomOpeningHours);
    }

    /**
     * 新增一站式社区-功能房开放时间
     *
     * @param staffOneStopRoomOpeningHours 一站式社区-功能房开放时间
     * @return 结果
     */
    @Override
    public int insertStaffOneStopRoomOpeningHours(StaffOneStopRoomOpeningHours staffOneStopRoomOpeningHours) {
        staffOneStopRoomOpeningHours.setRtNo(UUID.randomUUID().toString());
        return staffOneStopRoomOpeningHoursMapper.insertStaffOneStopRoomOpeningHours(staffOneStopRoomOpeningHours);
    }

    // 批量新增一站式社区-功能房开放时间
    @Override
    public int insertStaffOneStopRoomOpeningHoursBatch(List<StaffOneStopRoomOpeningHours> staffOneStopRoomOpeningHoursList) {
        for (StaffOneStopRoomOpeningHours hours : staffOneStopRoomOpeningHoursList) {
            hours.setRtNo(UUID.randomUUID().toString());
        }
        return staffOneStopRoomOpeningHoursMapper.insertStaffOneStopRoomOpeningHoursBatch(staffOneStopRoomOpeningHoursList);
    }

    /**
     * 修改一站式社区-功能房开放时间
     *
     * @param staffOneStopRoomOpeningHours 一站式社区-功能房开放时间
     * @return 结果
     */
    @Override
    public int updateStaffOneStopRoomOpeningHours(StaffOneStopRoomOpeningHours staffOneStopRoomOpeningHours) {
        return staffOneStopRoomOpeningHoursMapper.updateStaffOneStopRoomOpeningHours(staffOneStopRoomOpeningHours);
    }

    /**
     * 批量删除一站式社区-功能房开放时间
     *
     * @param ohIds 需要删除的一站式社区-功能房开放时间主键
     * @return 结果
     */
    @Override
    public int deleteStaffOneStopRoomOpeningHoursByOhIds(Long[] ohIds) {
        return staffOneStopRoomOpeningHoursMapper.deleteStaffOneStopRoomOpeningHoursByOhIds(ohIds);
    }

    /**
     * 删除一站式社区-功能房开放时间信息
     *
     * @param ohId 一站式社区-功能房开放时间主键
     * @return 结果
     */
    @Override
    public int deleteStaffOneStopRoomOpeningHoursByOhId(Long ohId) {
        return staffOneStopRoomOpeningHoursMapper.deleteStaffOneStopRoomOpeningHoursByOhId(ohId);
    }
}
