<iftest="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if>
<iftest="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if>
<iftest="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if>
<iftest="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if>
</where>
</where>
order by mso.saleorder_code,mso.erp_modify_date desc
select * from wms_product_outstock_detail where begin_time > now() - interval 1 month and execute_status = 3 order by begin_time asc
select * from wms_product_outstock_detail where warehouse_id=231 and begin_time > now() - interval 1 month and execute_status = 2 order by begin_time asc