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

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.mcs.entity.SegmentInspectionPassPointInfo;
import com.sw.mes.yb.report.entity.SuccessCrystalBase;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

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

    /**
     * 根据当前炉台号和复投次数查询成晶基础信息
     * @param deviceNo
     * @param againNum
     * @return
     */
    @Query(value = " SELECT  * FROM rpt_success_crystal_base WHERE device_no=?1 and again_num=?2 ",nativeQuery = true)
    List<SuccessCrystalBase> findByDeviceNoAndAgainNum(String deviceNo, String againNum);

    @Query(value = " SELECT * FROM  rpt_success_crystal_base  where device_no=?1  and splice_start_time=?2 order by id desc LIMIT 1 ",nativeQuery = true)
    SuccessCrystalBase getByDeviceNoAndSpliceStartTime(String deviceNo, Date spliceStartTime);
}
