JOIN Z_SFC_DISPATCH zsd ON ZPRT.SFC_DISPATCH_BO=ZSD.HANDLE
LEFT JOIN Z_PRINT_LOG ZPL ON ZPL.SFC=ZSD.SFC AND ZPL.SITE=ZSD.SITE AND ZPL.STEP_ID=ZSD.STEP_ID
LEFT JOIN Z_SFC_DISPATCH PREZSD ON zsd.SFC=PREZSD.SFC AND PREZSD.DISPATCH_SEQ=TO_NUMBER(zsd.DISPATCH_SEQ)-1
JOIN OPERATION OP ON OP.OPERATION = zprt.OPERATION AND OP.SITE = zprt.SITE AND OP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = OP.HANDLE AND OT.LOCALE =#{locale}
@ -654,7 +655,8 @@
<iftest="entity.workCenter!=null and entity.workCenter!='' "> AND ZPRT.WORK_CENTER=#{entity.workCenter}</if>
<iftest="entity.resrce!=null and entity.resrce!='' "> AND ZPRT.RESRCE=#{entity.resrce}</if>
<iftest="entity.dispatchNo!=null and entity.dispatchNo!='' "> AND ZSD.DISPATCH_NO=#{entity.dispatchNo}</if>
<iftest="entity.status!=null and entity.status!='' "> AND ZPRT.STATUS=#{entity.status}</if>
<iftest="entity.status!=null and entity.status!='' and entity.status!='PRINT'"> AND ZPRT.STATUS=#{entity.status}</if>
<iftest="entity.status!=null and entity.status!='' and entity.status eq 'PRINT' "> AND ZPL.IS_PRINT='true' AND ZPRT.STATUS='FINISH'</if>
<iftest="entity.result!=null and entity.result!='' "> AND ZPRT.RESULT=#{entity.result}</if>
<iftest="entity.sfcStepStatus!=null and entity.sfcStepStatus!='' and entity.sfcStepStatus=='COMPLETE' "> AND ZSD.DISPATCH_STATUS=#{entity.sfcStepStatus}</if>
<iftest="entity.sfcStepStatus!=null and entity.sfcStepStatus!='' and entity.sfcStepStatus!='COMPLETE' "> AND ZSD.DISPATCH_STATUS!='COMPLETE'</if>