工单单头主要信息之sql
SELECT WE.ORGANIZATION_ID,
OOD.ORGANIZATION_CODE,
WE.WIP_ENTITY_ID,
WE.WIP_ENTITY_NAME,
MSI.SEGMENT1 ASSEMBLY,
DECODE(WDJ.JOB_TYPE,1,'Standard',3,'Non-standard') JOB_TYPE,
ML.MEANING STATUS_TYPE,
WDJ.START_QUANTITY,
WDJ.QUANTITY_COMPLETED,
WDJ.QUANTITY_SCRAPPED,
WDJ.SCHEDULED_START_DATE,
WDJ.SCHEDULED_COMPLETION_DATE
FROM WIP_ENTITIES WE,
WIP_DISCRETE_JOBS WDJ,
MFG_LOOKUPS ML,
MTL_SYSTEM_ITEMS_B MSI,
ORG_ORGANIZATION_DEFINITIONS OOD
WHERE WE.ORGANIZATION_ID=WDJ.ORGANIZATION_ID
AND WE.WIP_ENTITY_ID=WDJ.WIP_ENTITY_ID
AND WE.ORGANIZATION_ID=MSI.ORGANIZATION_ID
AND WE.PRIMARY_ITEM_ID=MSI.INVENTORY_ITEM_ID
AND ML.LOOKUP_TYPE='WIP_JOB_STATUS'
AND WDJ.STATUS_TYPE=ML.LOOKUP_CODE
AND OOD.ORGANIZATION_ID=WE.ORGANIZATION_ID
AND TO_CHAR(WDJ.SCHEDULED_START_DATE,'YYYYMM')='200407'
AND WE.ORGANIZATION_ID=9
AND WE.WIP_ENTITY_NAME='WFY1-353045'
ORDER BY OOD.ORGANIZATION_CODE
SELECT WE.ORGANIZATION_ID,
OOD.ORGANIZATION_CODE,
WE.WIP_ENTITY_ID,
WE.WIP_ENTITY_NAME,
MSI.SEGMENT1 ASSEMBLY,
DECODE(WDJ.JOB_TYPE,1,'Standard',3,'Non-standard') JOB_TYPE,
ML.MEANING STATUS_TYPE,
WDJ.START_QUANTITY,
WDJ.QUANTITY_COMPLETED,
WDJ.QUANTITY_SCRAPPED,
WDJ.SCHEDULED_START_DATE,
WDJ.SCHEDULED_COMPLETION_DATE
FROM WIP_ENTITIES WE,
WIP_DISCRETE_JOBS WDJ,
MFG_LOOKUPS ML,
MTL_SYSTEM_ITEMS_B MSI,
ORG_ORGANIZATION_DEFINITIONS OOD
WHERE WE.ORGANIZATION_ID=WDJ.ORGANIZATION_ID
AND WE.WIP_ENTITY_ID=WDJ.WIP_ENTITY_ID
AND WE.ORGANIZATION_ID=MSI.ORGANIZATION_ID
AND WE.PRIMARY_ITEM_ID=MSI.INVENTORY_ITEM_ID
AND ML.LOOKUP_TYPE='WIP_JOB_STATUS'
AND WDJ.STATUS_TYPE=ML.LOOKUP_CODE
AND OOD.ORGANIZATION_ID=WE.ORGANIZATION_ID
AND TO_CHAR(WDJ.SCHEDULED_START_DATE,'YYYYMM')='200407'
AND WE.ORGANIZATION_ID=9
AND WE.WIP_ENTITY_NAME='WFY1-353045'
ORDER BY OOD.ORGANIZATION_CODE
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/41594/viewspace-50510/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/41594/viewspace-50510/