package cn.cslg.report.service.business;


import cn.cslg.report.entity.AssoScenarIOS;
import cn.cslg.report.entity.asso.AssoRecordsFeature;

import cn.cslg.report.mapper.AssoRecordsFeatureMapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@Slf4j
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class AssoRecordsFeatureService extends ServiceImpl<AssoRecordsFeatureMapper, AssoRecordsFeature> {
    private final AssoScenarIOSService assoScenarIOSService;

    /**
     *
     * @param AssoFRIds  特征记录关联Id
     * @return 是否删除成功
     * @autor lrj
     */
 public Boolean deleleAssos(List<Integer> AssoFRIds){
     //根据特征记录的关联Id 删除方案和特征记录关联表信息
     if(AssoFRIds!=null&&AssoFRIds.size()!=0) {
         LambdaQueryWrapper<AssoScenarIOS> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(AssoScenarIOS::getFeatureRecordID, AssoFRIds);
         assoScenarIOSService.remove(queryWrapper);
         //删除特征记录关联表信息
         return this.removeByIds(AssoFRIds);
     }
return  true;
 }

}
