package com.base.plan.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.base.plan.model.dto.request.AreaOptimizationResultReqDTO;
import com.base.plan.model.entity.AreaOptimizationResultInfo;
import com.base.plan.model.entity.WindowResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AreaOptimizationResultInfoMapper extends BaseMapper<AreaOptimizationResultInfo> {

    List<AreaOptimizationResultInfo> selectAreaOptimizationResultInfoList(@Param("req") AreaOptimizationResultReqDTO req);

    default void deleteByReqIds(List<String> reqIds) {
        QueryWrapper<AreaOptimizationResultInfo> areaOptimizationResultInfoQueryWrapper = new QueryWrapper<>();
        areaOptimizationResultInfoQueryWrapper.in("req_id",reqIds);
        this.delete(areaOptimizationResultInfoQueryWrapper);
    }

}
