<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE qml SYSTEM "/wt/query/qml/qml.dtd">

<qml bypassAccessControl="true">

<parameter name="PID" type="java.lang.Object"/>

<statement>

<query>

<select distinct="true" group="false">

<object alias="WTPart" heading="Part" propertyName=""/>

<column alias="EPMDocument" heading="Drawing Name" isExternal="false"
propertyName="CADName" selectOnly="false" type="java.lang.String">

master>CADName

</column>

<column alias="EPMDocument" heading="Drawing State" isExternal="false"
propertyName="lifeCycleState" selectOnly="false" type="wt.lifecycle.State">

state.state

</column>

<column alias="EPMDocument" heading="Drawing Created On" isExternal="false"
propertyName="createTimestamp" selectOnly="false" type="java.sql.Timestamp">

thePersistInfo.createStamp

</column>

<column alias="LifeCycleHistory" heading="Drawing LifeCycle History"
isExternal="false" propertyName="state" selectOnly="false"
type="wt.lifecycle.State">

state

</column>

<function heading="Month" name="GET_MONTH" type="java.math.BigDecimal">

<column alias="LifeCycleHistory" heading="Month" isExternal="false"
propertyName="modifyTimestamp" selectOnly="false" type="java.sql.Timestamp">

thePersistInfo.modifyStamp

</column>

</function>

<function heading="Day" name="GET_DAY" type="java.math.BigDecimal">

<column alias="LifeCycleHistory" heading="Day" isExternal="false"
propertyName="modifyTimestamp" selectOnly="false" type="java.sql.Timestamp">

thePersistInfo.modifyStamp

</column>

</function>

<function heading="Year" name="GET_YEAR" type="java.math.BigDecimal">

<column alias="LifeCycleHistory" heading="Year" isExternal="false"
propertyName="modifyTimestamp" selectOnly="false" type="java.sql.Timestamp">

thePersistInfo.modifyStamp

</column>

</function>

<column alias="WTChangeActivity2" heading="ECN Number" isExternal="false"
propertyName="number" selectOnly="false" type="java.lang.String">

number

</column>

</select>

<from>

<table alias="WTPart" isExternal="false">

wt.part.WTPart

</table>

<table alias="EPMDescribeLink" isExternal="false" outerJoinAlias="WTPart">

wt.epm.structure.EPMDescribeLink

</table>

<table alias="EPMDocument" isExternal="false"
outerJoinAlias="EPMDescribeLink">

wt.epm.EPMDocument

</table>

<table alias="LifeCycleHistory" isExternal="false"
outerJoinAlias="EPMDocument">

wt.lifecycle.LifeCycleHistory

</table>

<table alias="WTChangeActivity2" isExternal="false"
outerJoinAlias="EPMDocument">

wt.change2.WTChangeActivity2

</table>

<table alias="WTProduct" isExternal="false">

wt.part.WTProduct

</table>

<table alias="Cabinet" isExternal="false">

wt.folder.Cabinet

</table>

</from>

<where>

<compositeCondition type="and">

<condition>

<operand>

<function name="TO_NUMBER" type="java.lang.Object">

<column alias="WTPart" heading="Latest Iteration" isExternal="false"
propertyName="latestIteration" selectOnly="false" type="boolean">

iterationInfo.latest

</column>

</function>

</operand>

<operator type="equal"/>

<operand>

<function name="TO_NUMBER" type="java.lang.Object">

<constant isMacro="false" type="java.lang.Object">

1

</constant>

</function>

</operand>

</condition>

<condition>

<operand>

<column alias="EPMDocument" heading="Doc Type" isExternal="false"
propertyName="docType" selectOnly="false" type="wt.epm.EPMDocumentType">

master>docType

</column>

</operand>

<operator type="equal"/>

<operand>

<constant isMacro="false" type="wt.epm.EPMDocumentType">

CADDRAWING

</constant>

</operand>

</condition>

<condition>

<operand>

<column alias="WTProduct" heading="Number" isExternal="false"
propertyName="number" selectOnly="false" type="java.lang.String">

master>number

</column>

</operand>

<operator type="equal"/>

<operand>

<parameterTarget name="PID"/>

</operand>

</condition>

<condition>

<operand>

<column alias="WTPart" heading="Cabinet (cabinet).Object Id.Id"
isExternal="false" propertyName="cabinet.objectId.id" selectOnly="false"
type="long">

folderingInfo.cabinet.key.id

</column>

</operand>

<operator type="equal"/>

<operand>

<column alias="WTProduct" heading="Cabinet (cabinet).Object Id.Id"
isExternal="false" propertyName="cabinet.objectId.id" selectOnly="false"
type="long">

folderingInfo.cabinet.key.id

</column>

</operand>

</condition>

</compositeCondition>

</where>

<linkJoin>

<join name="wt.change2.ChangeRecord2">

<aliasTarget alias="EPMDocument"/>

<aliasTarget alias="WTChangeActivity2"/>

</join>

<join name="wt.lifecycle.ObjectHistory">

<aliasTarget alias="EPMDocument"/>

<aliasTarget alias="LifeCycleHistory"/>

</join>

<join name="wt.folder.FolderMembership">

<aliasTarget alias="Cabinet"/>

<aliasTarget alias="WTProduct"/>

</join>

</linkJoin>

<referenceJoin>

<join name="roleBObjectRef">

<aliasTarget alias="EPMDescribeLink"/>

<aliasTarget alias="EPMDocument"/>

</join>

<join name="roleAObjectRef">

<aliasTarget alias="EPMDescribeLink"/>

<aliasTarget alias="WTPart"/>

</join>

</referenceJoin>

</query>

</statement>

</qml>

