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

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.pc.entity.FbjoinDetail;
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 FbjoinDetailDao extends BaseDao<FbjoinDetail, Integer> {

    @Query(value="SELECT * FROM zhxx_fb_operate_fbjoin_detail WHERE section_no_fb IN (?1) AND status=?2",nativeQuery = true)
    List<FbjoinDetail> getListBySectionNoFbListAndStatus(List<String> sectionNoFbList, Integer status);

    @Modifying
    @Query(value = "UPDATE zhxx_fb_operate_fbjoin_detail SET status=?2 WHERE fbjoin_id=?1 ",nativeQuery = true)
    void updateStatusByfbjoinId(Integer id, Integer status);


    @Modifying
    @Query(value = "DELETE FROM  zhxx_fb_operate_fbjoin_detail WHERE fbjoin_id=?1 ",nativeQuery = true)
    void deleteByMainId(Integer id);
}
