package com.sw.mes.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sw.mes.store.entity.WarehouseInputBill;
import com.sw.mes.store.entity.WarehouseInputRecordBillDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
@Mapper
public interface WarehouseInputRecordBillDetailMapper extends BaseMapper<WarehouseInputRecordBillDetail>{
    @Select("select * from warehouse_input_record_bill_detail where material_model_code = #{materialCode} and batch_no = #{batchNo} limit 1")
    WarehouseInputRecordBillDetail getByMaterialCodeAndBatchNo(@Param("materialCode") String materialCode,@Param("batchNo") String batchNo);

    @Select("select * from warehouse_input_record_bill_detail where material_model_code = #{materialCode} and status = '已入库'")
    List<WarehouseInputRecordBillDetail> findWarehouseInputRecordBillDetailsByMaterialCode(String materialCode);
}