/*
 * Author: wangjian
 * 生成ServiceImpl
 */
package com.tofly.dispatch.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tofly.dispatch.common.FlowConstant;
import com.tofly.dispatch.entity.EmergencyFacilities;
import com.tofly.dispatch.entity.EmergencyStaff;
import com.tofly.dispatch.mapper.EmergencyStaffMapper;
import com.tofly.dispatch.service.EmergencyStaffService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.List;
import java.util.Set;

/**
 * 事故人员
 *
 * @author xqf
 * @date Mon Apr 25 00:00:00 CST 2022
 */
@Service("emergencyStaffService")
public class EmergencyStaffServiceImpl extends ServiceImpl<EmergencyStaffMapper, EmergencyStaff> implements EmergencyStaffService {







    @Override
    public void deleteEmergencyId(Set<Long> emergencyId) {
        if (CollectionUtils.isEmpty(emergencyId)){
            throw new RuntimeException("传入数据为空");
        }
        //删除中间表
        QueryWrapper<EmergencyStaff> queryWrapperR = new QueryWrapper<>();
        queryWrapperR.in("EMERGENCY_ID",emergencyId);
        this.baseMapper.delete(queryWrapperR);
    }




}
