package com.sw.mes.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sw.mes.core.dto.store.WarehouseOutputBillDetailBo;
import com.sw.mes.store.entity.WarehouseOutputBillDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author wupeng
 * @Description 出库明细
 * @Date 14:22 2023/8/3
 * @Param
 * @return
 **/
@Mapper
public interface WarehouseOutputBillDetailMapper extends BaseMapper<WarehouseOutputBillDetail> {

    @Select("select * from warehouse_output_bill_detail where output_bill_id = #{billId}")
    List<WarehouseOutputBillDetail> getByBillId(@Param("billId") Long id);

    @Select("select * from warehouse_output_bill_detail where output_bill_no = #{billNo}")
    List<WarehouseOutputBillDetail> getByBillNo(@Param("billNo") String billNo);
    @Select("select * from warehouse_output_bill_detail where output_bill_no = #{billNo} and material_model_code = #{materialCode}")
    WarehouseOutputBillDetail getByBillMaterialCode(String billNo,String materialCode);
    @Select("select * from warehouse_output_bill_detail where material_model_code = #{materialCode} and status = '已出库'")
    List<WarehouseOutputBillDetail> findWarehouseOutputBillDetailByMaterialCode(String materialCode);
}