package com.sw.mes.fb.aio.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.fb.aio.entity.ProductionBackCuttingRecord;
import org.springframework.data.jpa.repository.Query;

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
public interface ProductionRecutDao extends BaseDao<ProductionBackCuttingRecord, Long> {

    @Query(value = "SELECT * FROM `production_back_cutting_record` WHERE segment_no = ?1  limit 1", nativeQuery = true)
    ProductionBackCuttingRecord findBySectionNo(String segmentNo);

    @Query(value = "SELECT COUNT(1) FROM production_painting_line_detail WHERE operate_reversecut_draw_id = ?1 and type = 1", nativeQuery = true)
    int getCountById(Long id);
}
