<?xml version="1.0" encoding="UTF-8" ?>
<queryMap>
    <query id="CrmZcOutlistServer.Query" desc="出库信息查询">
        SELECT
            T.JUDGE_STOVE_NO,
            T.BATCH_NO,
            T.BATCH_GROUD_NO,
            T.MATERIAL_NO,
            T.MATERIAL_NAME,
            T.PRODUCCODE,
            T.PRODUCNAME,
            T.STD_CODE,
            T.STD_NAME,
            T.GRADECODE,
            T.GRADENAME,
            T.STEELCODE,
            T.STEELNAME,
            T.STD_STYLE,
            T.STD_STYLE_DESC,
            T.SPEC_CODE,
            T.SPEC_NAME,
            T.MODEL_CODE,
            T.MODEL_DESC,
            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,
            SUM(T.ACT_LEN) ACT_LEN,
            T.STORAGE_NO,
            (SELECT Y.STORAGE_NAME FROM YDM_BS_STORAGE Y WHERE Y.STORAGE_NO = T.STORAGE_NO) STORAGE_NAME,
            TO_CHAR(T.SEN_TIME, 'YYYY-MM-DD HH24:MI:SS') SEN_TIME,
            DECODE(T.VALIDFLAG,'0','发运无效','1','发运有效','2','确认有效','3','传送发运明细到销售和质检')VALIDFLAG,
            TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
            T.ORDER_NO,
            T.ORDER_SEQ,
            T.DELIVERY_NO,
            T.ORD_PK,
            T.ORD_LN_PK,
            T.ORD_LN_DLY_PK,
            DECODE(T.IS_FLAG,'0','未同步','1','已同步')IS_FLAG,
            DECODE(T.DATA_STATUS,'0','新增','1','修改','2','删除')DATA_STATUS,
            TO_CHAR(T.SYNCHRO_TIME, 'YYYY-MM-DD HH24:MI:SS') SYNCHRO_TIME,
            TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME
        FROM CRM_ZC_OUTLIST T
        WHERE
            1 = 1 #someThing#
        GROUP BY
            T.JUDGE_STOVE_NO,
            T.BATCH_NO,
            T.BATCH_GROUD_NO,
            T.MATERIAL_NO,
            T.MATERIAL_NAME,
            T.PRODUCCODE,
            T.PRODUCNAME,
            T.STD_CODE,
            T.STD_NAME,
            T.GRADECODE,
            T.GRADENAME,
            T.STEELCODE,
            T.STEELNAME,
            T.STD_STYLE,
            T.STD_STYLE_DESC,
            T.SPEC_CODE,
            T.SPEC_NAME,
            T.MODEL_CODE,
            T.MODEL_DESC,
            T.STORAGE_NO,
            STORAGE_NAME,
            T.SEN_TIME,
            T.VALIDFLAG,
            T.DELETE_TIME,
            T.ORDER_NO,
            T.ORDER_SEQ,
            T.DELIVERY_NO,
            T.ORD_PK,
            T.ORD_LN_PK,
            T.ORD_LN_DLY_PK,
            T.IS_FLAG,
            T.DATA_STATUS,
            T.SYNCHRO_TIME,
            T.CREATE_TIME
    </query>

    <query id="CrmZcOutlistServer.Query1" desc="出库信息查询">
        <![CDATA[
        SELECT
        T.LOADVEHICLE_SQE,
        T.BILL_NO,
        T.LOADVEHICLE_NO,
        T.JUDGE_STOVE_NO,
        T.BATCH_NO,
        T.BATCH_GROUD_NO,
        T.MATERIAL_NO,
        T.MATERIAL_NAME,
        T.PRODUCCODE,
        T.PRODUCNAME,
        T.STD_CODE,
        T.STD_NAME,
        T.GRADECODE,
        T.GRADENAME,
        T.STEELCODE,
        T.STEELNAME,
        T.STD_STYLE,
        T.STD_STYLE_DESC,
        T.SPEC_CODE,
        T.SPEC_NAME,
        T.MODEL_CODE,
        T.MODEL_DESC,
        T.ACT_LEN_MIN,
        T.ACT_LEN_MAX,
        T.ACT_COUNT,
        T.ACT_WEIGHT,
        T.ACT_LEN,
        T.STORAGE_NO,
        T.STORAGE_NAME,
        TO_CHAR(T.SEN_TIME, 'YYYY-MM-DD HH24:MI:SS') SEN_TIME,
        T.VALIDFLAG,
        TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
        T.ORDER_NO,
        T.ORDER_SEQ,
        T.DELIVERY_NO,
        T.ORD_PK,
        T.ORD_LN_PK,
        T.ORD_LN_DLY_PK,
        DECODE(T.IS_FLAG,'0','未同步','1','已同步')IS_FLAG,
        DECODE(T.DATA_STATUS,'0','新增','1','修改','2','删除')DATA_STATUS,
        TO_CHAR(T.SYNCHRO_TIME, 'YYYY-MM-DD HH24:MI:SS') SYNCHRO_TIME,
        TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
        T.INITIAL_ID,
        T.DELVRY_WHEREABOUTS,
        T.SUPPLY_UNIT_CODE,
        T.SUPPLY_UNIT,
        T.BAL_YEAR_MONTH,
        T.ACT_DIMATER,
        T.ACT_HEIGHT,
        T.BELONG_CODE,
        T.BELONG_NAME,
        OUTSTOCK_TYPE_CODE,
        OUTSTOCK_TYPE_NAME
        FROM CRM_ZC_OUTLIST T
        WHERE
        1 =1 #someThing#
        ]]>
    </query>
</queryMap>