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

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

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

    @Query(value = "SELECT * FROM outgo_mark_operate WHERE crystal_no = ?1 AND status =?2 ORDER BY id DESC limit 1",nativeQuery = true)
    OutgoMarkOperate findByCrystalNoAndStatus(String crystalNo,Integer status);

    @Query(value = "SELECT * FROM outgo_mark_operate WHERE section_no = ?1 AND status =?2 ORDER BY id DESC limit 1",nativeQuery = true)
    OutgoMarkOperate findBySectionNoAndStatus(String sectionNo,Integer status);

    OutgoMarkOperate findByCrystalNoAndSectionNo(String crystalNo, String sectionNo);
}