package com.sw.mes.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sw.mes.store.entity.WarehouseOutputRecordBillDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
@Mapper
public interface WarehouseOutputRecordBillDetailMapper extends BaseMapper<WarehouseOutputRecordBillDetail> {

    @Select("select * from warehouse_output_record_bill_detail where material_model_code = #{materialCode} and status = '已出库'")
    List<WarehouseOutputRecordBillDetail> findWarehouseOutputRecordBillDetailByMaterialCode(String materialCode);

    @Select("select * from warehouse_output_record_bill_detail where material_model_code = #{materialCode} order by id desc limit 1 ")
    WarehouseOutputRecordBillDetail getOutputBillByMaterialCode(String materialCode);

    @Select("select * from warehouse_output_record_bill_detail where manual_unique_code = #{uniqueCode}")
    WarehouseOutputRecordBillDetail getOutputBillByUniqueCode(String uniqueCode);
}