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

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

import java.util.List;
import java.util.Map;

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

	CrystalPullingInfo getByDeviceNo(String deviceNo);

	@Query(value = "select * from rpt_equipment_run_monitor",nativeQuery = true)
	List<Map<String, Object>> findEquipmentMonitorAll();

	@Query(value = "select * from kb_equipment_run_monitor",nativeQuery = true)
	List<Map<String, Object>> findKbEquipmentMonitorAll();

	@Query(value = "select * from rpt_crystal_pulling_info where lot_no = ?1 order by id desc limit 1", nativeQuery = true)
	CrystalPullingInfo getOneByLotNoOrderByIdDesc(String lotNo);

}
