INSERT INTO mes_base_barcode_info (batch_flag,barcode_type,barcode_info,batch_code,material_id,manufacturer_id,amount,purchase_order_id,po_no,production_date,accepted_date,last_outstock_date,plan_code,plan_detail_code,safe_flag,sale_order_id,saleorder_code,project_no,serial_number,remark,bind_status,update_by,update_time) VALUES
INSERT INTO mes_base_barcode_info (batch_flag,barcode_type,barcode_info,batch_code,material_id,barcode_spec,manufacturer_id,amount,purchase_order_id,po_no,production_date,accepted_date,last_outstock_date,plan_code,plan_detail_code,safe_flag,sale_order_id,saleorder_code,project_no,serial_number,remark,bind_status,update_by,update_time) VALUES
@ -230,8 +237,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpo.po_no,
mpo.document_status,
mpo.material_id,
mpo.material_code,
mpo.material_name,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
mpo.aux_prop_id,
mpo.specification_parameter,
@ -254,15 +261,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where mob.purchase_order_id = mpo.purchase_order_id
and mob.safe_flag = '1') barcode_amount
from mes_purchase_order mpo
left join mes_base_material_info mbmi on mbmi.material_id = mpo.material_id
left join mes_base_material_info mbmi on mbmi.erp_id = mpo.material_id
<where>
<iftest="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<iftest="materialCode != null and materialCode != ''"> and mpo.material_code like concat('%', #{materialCode}, '%')</if>
<iftest="materialName != null and materialName != ''"> and mpo.material_name like concat('%', #{materialName}, '%')</if>
<iftest="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<iftest="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<iftest="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<iftest="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
</where>
order by mpo.po_no ,mpo.material_code
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
from mes_order_bind mob where mob.purchase_order_id=mpo.purchase_order_id and mob.safe_flag='1') safe_bind_barcode_amount
from mes_purchase_order mpo
left join mes_base_material_info mbmi on mbmi.erp_id = mpo.material_id
<where>
<iftest="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<iftest="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<iftest="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<iftest="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<iftest="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
</where>
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name