package com.sw.mes.yb.pad.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.pad.entity.ProductionPaintingLineDetail;
import com.sw.mes.yb.pad.entity.ProductionPaintingLineDetailException;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
public interface ProductionPaintingLineDetailExceptionDao extends BaseDao<ProductionPaintingLineDetailException, Long>{
    @Query(value = "select * from production_painting_line_detail_exception where  segment_no = ?1", nativeQuery = true)
    List<ProductionPaintingLineDetailException> findBySegmentNo(String segmentNo);

    @Modifying
    @Query(value = "delete from production_painting_line_detail_exception where segment_no in (?1) ",nativeQuery = true)
    Integer deleteBySegmentNo(List<String> segmentNos);
}
