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


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

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

    @Query(value = "SELECT m.* FROM interface_eap_grinding_blanking m where m.sn = ?1 order by m.id desc limit 1", nativeQuery = true)
    GrindingBlanking findTopByFbSectionNoOrderByIdDesc(String fbSectionNo);

    @Query(value = "SELECT m.* FROM interface_eap_grinding_blanking m where m.equip_no = ?1 order by m.id desc limit 1", nativeQuery = true)
    GrindingBlanking findByEquipNo(String equipNo);
}
