package com.base.plan.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.base.plan.model.entity.StepWindowControlPassRelation;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

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


@Mapper
@Repository
public interface StepWindowControlPassRelationMapper extends BaseMapper<StepWindowControlPassRelation> {

    default List<StepWindowControlPassRelation> selectByWindowId(Set<String> set){
        return this.selectList(new QueryWrapper<StepWindowControlPassRelation>().in("window_id",set).eq("is_confirm",2));
    }

    default void confirmWindow(List<String> list){
        this.update(null, new UpdateWrapper<StepWindowControlPassRelation>().set("is_confirm",1).in("step_id",list));
    }

}
