<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "查询在途">
<query id = "FrmBcOnPassage.doQueryOnPassage" desc = "查询">
SELECT 
       T.OUTSTOCK_DOC,
       MAX(T.OUTSTOCK_TYPE_CODE)OUTSTOCK_TYPE_CODE,
       MAX(T.OUTSTOCK_TYPE_NAME)OUTSTOCK_TYPE_NAME,
       T.VEHICLE_NO,
       T.LOT_NO,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       MAX(T.MATERIAL_NO)MATERIAL_NO,
       MAX(T.MATERIAL_NAME)MATERIAL_NAME,
       MAX(T.PRODUCCODE)PRODUCCODE,
       MAX(T.PRODUCNAME)PRODUCNAME,
       MAX(T.STD_CODE)STD_CODE,
       MAX(T.STD_NAME)STD_NAME,
       MAX(T.GRADECODE)GRADECODE,
       MAX(T.GRADENAME)GRADENAME,
       MAX(T.STEELCODE)STEELCODE,
       MAX(T.STEELNAME)STEELNAME,
       MAX(T.STD_STYLE)STD_STYLE,
       MAX(T.STD_STYLE_DESC)STD_STYLE_DESC,
       MAX(T.SPEC_CODE)SPEC_CODE,
       MAX(T.SPEC_NAME)SPEC_NAME,
       MAX(T.MODEL_CODE)MODEL_CODE,
       MAX(T.MODEL_DESC)MODEL_DESC,
       MAX(T.PRO_ORDER_NO)PRO_ORDER_NO,
       MAX(T.PLINE_CODE)PLINE_CODE,
       MAX(T.PLINE_NAME)PLINE_NAME,
       MAX(T.ACT_DIMATER)ACT_DIMATER,
       MAX(T.ACT_HEIGHT)ACT_HEIGHT,
       MAX(T.ACT_LEN)ACT_LEN,
       MAX(T.ACT_LEN_MIN)ACT_LEN_MIN,
       MAX(T.ACT_LEN_MAX)ACT_LEN_MAX,
       SUM(T.ACT_COUNT)ACT_COUNT,
       SUM(T.ACT_WEIGHT)ACT_WEIGHT,
       MAX(T.BELONG_CODE)BELONG_CODE,
       MAX(T.BELONG_NAME)BELONG_NAME,
       MAX(T.STORAGE_NO)STORAGE_NO,
       (SELECT T2.STORAGE_NAME FROM YDM_BS_STORAGE T2 WHERE T2.STORAGE_NO = T.STORAGE_NO)STORAGE_NAME,
       T.TAR_STORAGE_NO,
       (SELECT T1.STORAGE_NAME FROM YDM_BS_STORAGE T1 WHERE T1.STORAGE_NO = T.TAR_STORAGE_NO)TAR_STORAGE_NAME,
       MAX(TO_CHAR(T.OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
       MAX(T.CREATE_NAME)CREATE_NAME,
       MAX(T.JUDGE_STD_NAME)JUDGE_STD_NAME,
       DECODE(T.QCM_STAUS,'00','合格','11','待处理','22','判废')QCM_STAUS,
       MAX(DECODE(T.TAR_REC_FLAG,'0','未接收','1','已接收'))TAR_REC_FLAG,
       MAX(T.DRIVER)DRIVER,
       MAX(DECODE(T.OUT_TYPE,'0','写卡倒运','1','票据倒运'))OUT_TYPE
 FROM YDM_BC_OUTLIST T
 WHERE T.OUTSTOCK_TYPE_CODE = '800803'
 AND T.VALIDFLAG = '1'
 AND T.TAR_REC_FLAG = '0'
</query>
</queryMap>