<iftest="params.planBeginTime != null and params.planEndTime != null">
AND (plan_begin_time <= #{params.planEndTime} AND plan_end_time >= #{params.planBeginTime})
</if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('0','1','3','4') and mpo.plan_end_time is not null and mpo.plan_end_time < now() </if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_end_time is not null and mpo.plan_end_time >= now() </if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('0','1','3','4') and mpo.plan_delivery_date is not null and mpo.plan_delivery_date < now() </if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_delivery_date is not null and mpo.plan_delivery_date >= now() </if>
</where>
order by mpo.product_order_id desc
@ -545,7 +545,9 @@
(
select
max(real_begin_time) real_begin_time
from mes_produce_statistics_detail where product_order_status='2')) group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id
from mes_produce_statistics_detail mpsd where
exists (select 1 from mes_product_order mpo where mpsd.product_order_id=mpo.product_order_id and mpo.order_status='2' and mpo.dispatch_id=4)))
group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id order by process_id
@ -301,6 +302,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
<iftest="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
<iftest="materialBomId != null"> and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mpo.material_id and mmb.ancestors like concat('0,', #{materialBomId}, '%') )</if>
from mes_purchase_order mpo left join mes_base_material_info mbmi on mpo.material_id =mbmi.erp_id
left join mes_project_info mpi on mpo.tond_base=mpi.erp_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>
@ -424,6 +426,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'%')</if>
<iftest="specificationParameter != null and specificationParameter != '' ">and replace(mpo.specification_parameter,' ','') like concat('%', #{specificationParameter},
'%')</if>
<iftest="projectName != null and projectName != ''">and mpi.project_name like concat('%', #{projectName},
'%')
</if>
<iftest="orderStatus != null and orderStatus != ''"> and mpo.order_status = #{orderStatus}</if>
<iftest="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
@ -441,6 +446,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="srcBillNo != null and srcBillNo != ''"> and mpo.src_bill_no like concat('%', #{srcBillNo}, '%')</if>
<iftest="tondBase != null and tondBase != ''"> and mpo.tond_base like concat('%', #{tondBase}, '%')</if>
<iftest="bindFlag != null and bindFlag != ''"> and exists (select 1 from mes_order_bind mob where mob.purchase_order_id=mpo.purchase_order_id and mob.sale_order_id=#{saleOrderId})</if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('1','2') and mpo.plan_delivery_date is not null and mpo.plan_delivery_date < now() </if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_delivery_date is not null and mpo.plan_delivery_date >= now() </if>
<iftest="saleOrderClassfication != null and saleOrderClassfication != ''">and mso.sale_order_classfication = #{saleOrderClassfication}</if>
<iftest="relateFlag != null and relateFlag != ''">and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId})</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='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mso.is_release in ('0','1','2') and mso.plan_delivery_date is not null and mso.plan_delivery_date < now() </if>
<iftest='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mso.plan_delivery_date is not null and mso.plan_delivery_date >= now() </if>