|
|
|
@ -265,10 +265,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
select wro.raw_outstock_id, wro.task_code, wro.warehouse_id, wro.location_code, wro.order_id, wro.plan_code, wro.plan_detail_code, wro.station_id,wro.material_batch,
|
|
|
|
|
wro.material_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date,
|
|
|
|
|
wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wro.outstock_amount,wro.real_outstock_amount,wbw.warehouse_name
|
|
|
|
|
,mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbui.unit_name
|
|
|
|
|
,mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbui.unit_name, wrod.erp_status, wrod.erp_amount
|
|
|
|
|
from wms_raw_outstock wro left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id
|
|
|
|
|
left join mes_base_material_info mbmi on wro.material_id=mbmi.material_id
|
|
|
|
|
left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id
|
|
|
|
|
left join (select raw_outstock_id, max(erp_status) erp_status, max(erp_amount) erp_amount
|
|
|
|
|
from wms_raw_outstock_detail
|
|
|
|
|
group by raw_outstock_id) wrod on wro.raw_outstock_id = wrod.raw_outstock_id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="taskCode != null and taskCode != ''"> and wro.task_code like concat('%', #{taskCode}, '%')</if>
|
|
|
|
|
<if test="warehouseId != null "> and wro.warehouse_id = #{warehouseId}</if>
|
|
|
|
@ -282,6 +285,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
|
|
|
|
|
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
|
|
|
|
|
<if test="erpStatus != null and erpStatus != ''"> and wrod.erp_status = #{erpStatus}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by wro.apply_date desc
|
|
|
|
|
</select>
|
|
|
|
|