/*
 * Author: wangjian
 * 生成ServiceImpl
 */
package com.tofly.dispatch.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tofly.dispatch.entity.EmergencyFacilities;
import com.tofly.dispatch.mapper.EmergencyFacilitiesMapper;
import com.tofly.dispatch.service.EmergencyFacilitiesService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Set;

/**
 * 事故设施
 *
 * @author xqf
 * @date Mon Apr 25 00:00:00 CST 2022
 */
@Service("emergencyFacilitiesService")
public class EmergencyFacilitiesServiceImpl extends ServiceImpl<EmergencyFacilitiesMapper, EmergencyFacilities> implements EmergencyFacilitiesService {


    @Override
    public void deleteEmergencyIds(Set<Long> emergencyIds) {
        if (CollectionUtils.isEmpty(emergencyIds)) {
            throw new RuntimeException("传入数据为空");
        }

        //删除中间表
        QueryWrapper<EmergencyFacilities> queryWrapperR = new QueryWrapper<>();
        queryWrapperR.in("EMERGENCY_ID",emergencyIds);
        this.baseMapper.delete(queryWrapperR);
    }


}
