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

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

import java.util.List;

public interface FbReCutDAO extends BaseDao<ReCut, Long> {

    @Query(value = "SELECT * FROM zhxx_operate_re_cut WHERE segment_no=?1 ORDER BY id DESC LIMIT 3", nativeQuery = true)
    List<ReCut> findByCrystalSectionNo(String crystalSectionNo);

    @Query(value = "SELECT * FROM zhxx_operate_re_cut WHERE segment_no=?1 AND status = ?2 ORDER BY id DESC LIMIT 3", nativeQuery = true)
    List<ReCut> findByCrystalSectionNoAndStatus(String crystalSectionNo, Integer status);
}
