diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index c187ec91..11d56627 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -612,13 +612,17 @@ SC.QTY*BC.QTY ISSUE_QTY, SC.QTY*BC.QTY-NVL(ZCI.REQUIRED_QTY,0) REQUIRED_QTY, ZSD.PLANNED_START_DATE REQUIRED_DATE_TIME, ZCI.HANDLE, ZCI.CALL_TYPE FROM Z_SFC_DISPATCH ZSD INNER JOIN SFC SC ON SC.SITE = ZSD.SITE AND SC.SFC = ZSD.SFC + INNER JOIN SHOP_ORDER SO ON SO.HANDLE = SC.SHOP_ORDER_BO + INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'FACTORY' INNER JOIN SFC_BOM SB ON SB.SFC_BO = SC.HANDLE INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO + LEFT JOIN CUSTOM_FIELDS CS ON CS.HANDLE = CP.HANDLE AND CS.ATTRIBUTE = 'ACCESSORY_TYPE' INNER JOIN BOM_OPERATION BO ON BO.BOM_COMPONENT_BO = BC.HANDLE AND BO.OPERATION_BO = 'OperationBO:'||SC.SITE||','||ZSD.OPERATION||',#' INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = ZSD.STEP_ID LEFT JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE AND ZCI.COMPONENT_BO = CP.HANDLE AND ZCI.STEP_ID = ZSD.STEP_ID - WHERE ZSD.HANDLE IN + WHERE ( (CF.VALUE ='6100' AND CS.VALUE = '9') OR (CF.VALUE = '6106' OR CP.MATERIAL_TYPE='ROH') ) + AND ZSD.HANDLE IN #{item.handle}