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

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

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
public interface RawMaterialLevelDao extends BaseDao<RawMaterialLevel, Integer>{

    @Query(value = "select * from alloy_raw_material_level where material_code = ?1 limit 1",nativeQuery = true)
    RawMaterialLevel findByMaterialCode(String code);
    @Query(value = "select * from alloy_raw_material_level where material_code = ?1 and resistance_gear = ?2 limit 1",nativeQuery = true)
    RawMaterialLevel findByMaterialCodeAndResistanceGear(String code, String materialGear);

    RawMaterialLevel findByMaterialCodeAndResistanceGearAndIdNot(String materialCode, String resistanceGear, Integer id);
}