<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "门岗确认管理">
<query id = "FrmGateFrim.doQueryGpOutList" desc = "查询管坯倒库信息">
SELECT OUTSTOCK_PLAN_NO,
       OUTSTOCK_DOC,
       OUTSTOCK_TYPE_CODE,
       OUTSTOCK_TYPE_NAME,
       VEHICLE_NO,
       STOVE_NO,
       FLAG_STOVE_NO,
       JUDGE_STOVE_NO,
       MATERIAL_NO,
       MATERIAL_NAME,
       GRADECODE,
       GRADENAME,
       STD_CODE,
       STD_NAME,
       DIMATER,
       ACT_LEN,
       FIX_NUM,
       FIX_LEN,
       SUM(ACT_COUNT) ACT_COUNT,
       SUM(ACT_WEIGHT) ACT_WEIGHT,
       SUM(T.PONDER_GROSS_WT) PONDER_GROSS_WT,
       PLINE_CODE,
       PLINE_NAME,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       (SELECT C.STORAGE_NAME
          FROM YDM_BS_STORAGE C
         WHERE C.STORAGE_NO = T.STORAGE_NO) STORAGE_NAME,
       (SELECT C.STORAGE_NAME
          FROM YDM_BS_STORAGE C
         WHERE C.STORAGE_NO = T.TAR_STORAGE_NO) TAR_STORAGE_NAME,
       DECODE(TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
       MAX(TO_CHAR(OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
       MEMO,
       CREATE_NAME,
       MAX((SELECT S.ORDER_NO || '/' || S.ORDER_SEQ
             FROM PLN_ORDER_ZG_S S
            WHERE S.PRO_PLAN_ID = T.PRO_PLAN_ID_ZG
              AND S.GX_PLAN_NO = T.GX_PLAN_NO_ZG)) ORDER_NO,
       PRO_PLAN_ID_ZG,
       GX_PLAN_NO_ZG,
       MAX(LEAVE_FACTORY_NAME)LEAVE_FACTORY_NAME,
       MAX(TO_CHAR(LEAVE_FACTORY_TIME,'YYYY-MM-DD HH:MM:SS'))LEAVE_FACTORY_TIME,
       MAX(DECODE(LEAVE_FACTORY_FLAG,'0','未确认','1','已确认'))LEAVE_FACTORY_FLAG,
       MAX(T.DRIVER)DRIVER
  FROM YDM_GP_OUTLIST T
 WHERE OUTSTOCK_TYPE_CODE = '800803'
   AND TAR_REC_FLAG = '0'
   AND LEAVE_FACTORY_FLAG = '0'
   AND VALIDFLAG = '1'
   AND T.OUTSTOCK_DOC = ?
 GROUP BY OUTSTOCK_PLAN_NO,
          OUTSTOCK_DOC,
          OUTSTOCK_TYPE_CODE,
          OUTSTOCK_TYPE_NAME,
          VEHICLE_NO,
          STOVE_NO,
          FLAG_STOVE_NO,
          JUDGE_STOVE_NO,
          MATERIAL_NO,
          MATERIAL_NAME,
          GRADECODE,
          GRADENAME,
          STD_CODE,
          STD_NAME,
          DIMATER,
          ACT_LEN,
          FIX_NUM,
          FIX_LEN,
          PLINE_CODE,
          PLINE_NAME,
          BELONG_CODE,
          BELONG_NAME,
          STORAGE_NO,
          TAR_STORAGE_NO,
          TAR_REC_FLAG,
          MEMO,
          CREATE_NAME,
          PRO_PLAN_ID_ZG,
          GX_PLAN_NO_ZG
</query>
<query id = "FrmGateFrim.doQueryBcOutList" desc = "查询钢管倒库信息">
SELECT T.OUTSTOCK_DOC,
       MAX(T.OUTSTOCK_TYPE_CODE) OUTSTOCK_TYPE_CODE,
       MAX(T.OUTSTOCK_TYPE_NAME) OUTSTOCK_TYPE_NAME,
       T.ICCAR_NO,
       T.VEHICLE_NO,
       T.LOT_NO,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       MAX(C.BASENAME) PRODUCT_FLAG,
       MAX(T.MAT_STATUS) MAT_STATUS,
       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,
       T.PRO_ORDER_NO,
       T.PLINE_CODE,
       T.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,
       SUM(T.PONDER_GROSS_WT) PONDER_GROSS_WT,
       MAX(METER_WEIGHT) METER_WEIGHT,
       T.BELONG_CODE,
       T.BELONG_NAME,
       T.STORAGE_NO,
       (SELECT T1.STORAGE_NAME
          FROM YDM_BS_STORAGE T1
         WHERE T1.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,
       DECODE(T.TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
       MAX(TO_CHAR(T.OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
       MAX(T.JUDGE_STD_NAME) JUDGE_STD_NAME,
       T.DATA_SUORCE,
       T.QCM_STAUS,
       MAX(LEAVE_FACTORY_NAME) LEAVE_FACTORY_NAME,
       MAX(TO_CHAR(LEAVE_FACTORY_TIME, 'YYYY-MM-DD HH:MM:SS')) LEAVE_FACTORY_TIME,
       MAX(DECODE(LEAVE_FACTORY_FLAG, '0', '未确认', '1', '已确认')) LEAVE_FACTORY_FLAG,
       MAX(T.DRIVER) DRIVER,
       MAX(DECODE(T.OUT_TYPE,
                  '0',
                  '写卡倒运',
                  '1',
                  '票据倒运',
                  '2',
                  '纠错倒运')) OUT_TYPE
  FROM YDM_BC_OUTLIST T
  LEFT JOIN METER_WORK_CAR_ACTUAL_FIRST@TGJL_120_LINK
    ON T.OUTSTOCK_DOC = NOTICE_NO
   AND WEIGHT_TYPE = '0', COM_BASE_INFO C
 WHERE T.OUTSTOCK_DOC = ?
   AND T.VALIDFLAG = '1'
   AND T.TAR_REC_FLAG = '0'
   AND T.LEAVE_FACTORY_FLAG = '0'
   AND T.OUT_TYPE IN ('0', '1')
   AND T.PRODUCT_FLAG = C.BASECODE
 GROUP BY T.OUTSTOCK_DOC,
          T.ICCAR_NO,
          T.VEHICLE_NO,
          T.LOT_NO,
          T.STOVE_NO,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.BATCH_GROUD_NO,
          T.PRO_ORDER_NO,
          T.PLINE_CODE,
          T.PLINE_NAME,
          T.BELONG_CODE,
          T.BELONG_NAME,
          T.STORAGE_NO,
          T.TAR_STORAGE_NO,
          T.DATA_SUORCE,
          T.QCM_STAUS,
          T.TAR_REC_FLAG


</query>
<query id = "FrmGateFrim.doQueryGpOutList1" desc = "票据查询管坯倒库信息">
SELECT OUTSTOCK_PLAN_NO,
       OUTSTOCK_DOC,
       OUTSTOCK_TYPE_CODE,
       OUTSTOCK_TYPE_NAME,
       VEHICLE_NO,
       STOVE_NO,
       FLAG_STOVE_NO,
       JUDGE_STOVE_NO,
       MATERIAL_NO,
       MATERIAL_NAME,
       GRADECODE,
       GRADENAME,
       STD_CODE,
       STD_NAME,
       DIMATER,
       ACT_LEN,
       FIX_NUM,
       FIX_LEN,
       SUM(ACT_COUNT) ACT_COUNT,
       SUM(ACT_WEIGHT) ACT_WEIGHT,
       SUM(T.PONDER_GROSS_WT) PONDER_GROSS_WT,
       PLINE_CODE,
       PLINE_NAME,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       (SELECT C.STORAGE_NAME
          FROM YDM_BS_STORAGE C
         WHERE C.STORAGE_NO = T.STORAGE_NO) STORAGE_NAME,
       (SELECT C.STORAGE_NAME
          FROM YDM_BS_STORAGE C
         WHERE C.STORAGE_NO = T.TAR_STORAGE_NO) TAR_STORAGE_NAME,
       DECODE(TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
       max(TO_CHAR(OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
       MEMO,
       CREATE_NAME,
       MAX((SELECT S.ORDER_NO || '/' || S.ORDER_SEQ
             FROM PLN_ORDER_ZG_S S
            WHERE S.PRO_PLAN_ID = T.PRO_PLAN_ID_ZG
              AND S.GX_PLAN_NO = T.GX_PLAN_NO_ZG)) ORDER_NO,
       PRO_PLAN_ID_ZG,
       GX_PLAN_NO_ZG,
       MAX(LEAVE_FACTORY_NAME) LEAVE_FACTORY_NAME,
       MAX(TO_CHAR(LEAVE_FACTORY_TIME, 'YYYY-MM-DD HH:MM:SS')) LEAVE_FACTORY_TIME,
       MAX(DECODE(LEAVE_FACTORY_FLAG, '0', '未确认', '1', '已确认')) LEAVE_FACTORY_FLAG,
       MAX(T.DRIVER) DRIVER
  FROM YDM_GP_OUTLIST T
 WHERE OUTSTOCK_TYPE_CODE = '800803'
   AND TAR_REC_FLAG = '0'
   AND LEAVE_FACTORY_FLAG = '0'
   AND VALIDFLAG = '1'
</query>
<query id = "FrmGateFrim.doQueryBcOutList1" desc = "票据查询钢管倒库信息">
SELECT T.OUTSTOCK_DOC,
       MAX(T.OUTSTOCK_TYPE_CODE) OUTSTOCK_TYPE_CODE,
       MAX(T.OUTSTOCK_TYPE_NAME) OUTSTOCK_TYPE_NAME,
       T.ICCAR_NO,
       T.VEHICLE_NO,
       T.LOT_NO,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       MAX(C.BASENAME) PRODUCT_FLAG,
       MAX(T.MAT_STATUS) MAT_STATUS,
       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,
       T.PRO_ORDER_NO,
       T.PLINE_CODE,
       T.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,
       SUM(T.PONDER_GROSS_WT) PONDER_GROSS_WT,
       MAX(METER_WEIGHT) METER_WEIGHT,
       T.BELONG_CODE,
       T.BELONG_NAME,
       T.STORAGE_NO,
       (SELECT T1.STORAGE_NAME
          FROM YDM_BS_STORAGE T1
         WHERE T1.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,
       DECODE(T.TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
       MAX(TO_CHAR(T.OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
       MAX(T.JUDGE_STD_NAME) JUDGE_STD_NAME,
       T.DATA_SUORCE,
       T.QCM_STAUS,
       MAX(LEAVE_FACTORY_NAME) LEAVE_FACTORY_NAME,
       MAX(TO_CHAR(LEAVE_FACTORY_TIME, 'YYYY-MM-DD HH:MM:SS')) LEAVE_FACTORY_TIME,
       MAX(DECODE(LEAVE_FACTORY_FLAG, '0', '未确认', '1', '已确认')) LEAVE_FACTORY_FLAG,
       MAX(T.DRIVER) DRIVER,
       MAX(DECODE(T.OUT_TYPE,
                  '0',
                  '写卡倒运',
                  '1',
                  '票据倒运',
                  '2',
                  '纠错倒运')) OUT_TYPE
  FROM YDM_BC_OUTLIST T
  LEFT JOIN METER_WORK_CAR_ACTUAL_FIRST@TGJL_120_LINK
    ON T.OUTSTOCK_DOC = NOTICE_NO
   AND WEIGHT_TYPE = '0', COM_BASE_INFO C
 WHERE T.OUTSTOCK_TYPE_CODE = '800803'
   AND T.VALIDFLAG = '1'
   AND T.LEAVE_FACTORY_FLAG = '0'
   AND T.OUT_TYPE IN ('0', '1')
   AND T.PRODUCT_FLAG = C.BASECODE
</query>
<query id = "FrmGateFrim.doQueryGpOutList2" desc = "票据查询管坯倒库信息">
SELECT 
       OUTSTOCK_PLAN_NO,
       OUTSTOCK_DOC,
       OUTSTOCK_TYPE_CODE,
       OUTSTOCK_TYPE_NAME,
       VEHICLE_NO,
       STOVE_NO,
       FLAG_STOVE_NO,
       JUDGE_STOVE_NO,
       MATERIAL_NO,
       MATERIAL_NAME,
       GRADECODE,
       GRADENAME,
       STD_CODE,
       STD_NAME,
       DIMATER,
       ACT_LEN,
       FIX_NUM,
       FIX_LEN,
       SUM(ACT_COUNT)ACT_COUNT,
       SUM(ACT_WEIGHT)ACT_WEIGHT,
       SUM(T.PONDER_GROSS_WT) PONDER_GROSS_WT,
       PLINE_CODE,
       PLINE_NAME,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       (SELECT C.STORAGE_NAME FROM YDM_BS_STORAGE C WHERE C.STORAGE_NO = T.STORAGE_NO)STORAGE_NAME,
       (SELECT C.STORAGE_NAME FROM YDM_BS_STORAGE C WHERE C.STORAGE_NO = T.TAR_STORAGE_NO)TAR_STORAGE_NAME,
       DECODE(TAR_REC_FLAG,'0','未接收','1','已接收')TAR_REC_FLAG,
       max(TO_CHAR(OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
       MEMO,
       CREATE_NAME,
       MAX((SELECT S.ORDER_NO||'/'||S.ORDER_SEQ  FROM PLN_ORDER_ZG_S S WHERE S.PRO_PLAN_ID = T.PRO_PLAN_ID_ZG AND S.GX_PLAN_NO = T.GX_PLAN_NO_ZG))ORDER_NO,
       PRO_PLAN_ID_ZG,
       GX_PLAN_NO_ZG,
       MAX(LEAVE_FACTORY_NAME)LEAVE_FACTORY_NAME,
       MAX(TO_CHAR(LEAVE_FACTORY_TIME,'YYYY-MM-DD HH:MM:SS'))LEAVE_FACTORY_TIME,
       MAX(DECODE(LEAVE_FACTORY_FLAG,'0','未确认','1','已确认'))LEAVE_FACTORY_FLAG,
       MAX(T.DRIVER)DRIVER
 FROM YDM_GP_OUTLIST T
 WHERE OUTSTOCK_TYPE_CODE = '800803'
 AND TAR_REC_FLAG = '0'
 AND LEAVE_FACTORY_FLAG = '1'
 AND VALIDFLAG = '1'
</query>
<query id = "FrmGateFrim.doQueryBcOutList2" desc = "票据查询钢管倒库信息">
SELECT T.OUTSTOCK_DOC,
        MAX(T.OUTSTOCK_TYPE_CODE) OUTSTOCK_TYPE_CODE,
        MAX(T.OUTSTOCK_TYPE_NAME) OUTSTOCK_TYPE_NAME,
        T.ICCAR_NO,
        T.VEHICLE_NO,
        T.LOT_NO,
        T.STOVE_NO,
        T.JUDGE_STOVE_NO,
        T.BATCH_NO,
        T.BATCH_GROUD_NO,
        MAX(T.PRODUCT_FLAG) PRODUCT_FLAG,
       MAX(T.MAT_STATUS) MAT_STATUS,
        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,
        T.PRO_ORDER_NO,
        T.PLINE_CODE,
        T.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,
        SUM(T.PONDER_GROSS_WT) PONDER_GROSS_WT,
        T.BELONG_CODE,
        T.BELONG_NAME,
        T.STORAGE_NO,
        (SELECT T1.STORAGE_NAME FROM YDM_BS_STORAGE T1 WHERE T1.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,
        DECODE(T.TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
        MAX(TO_CHAR(T.OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) OUTSTOCK_TIME,
        MAX(T.JUDGE_STD_NAME) JUDGE_STD_NAME,
        T.DATA_SUORCE,
        T.QCM_STAUS,
        MAX(LEAVE_FACTORY_NAME)LEAVE_FACTORY_NAME,
       MAX(TO_CHAR(LEAVE_FACTORY_TIME,'YYYY-MM-DD HH:MM:SS'))LEAVE_FACTORY_TIME,
       MAX(DECODE(LEAVE_FACTORY_FLAG,'0','未确认','1','已确认'))LEAVE_FACTORY_FLAG,
       MAX(T.DRIVER)DRIVER
   FROM YDM_BC_OUTLIST T
  WHERE T.OUTSTOCK_TYPE_CODE = '800803'
  AND T.VALIDFLAG = '1'
  AND T.LEAVE_FACTORY_FLAG = '1'
</query>
<query id = "FrmGateFrim.updateYdmBcLeaveFlag" desc = "确认出厂">
UPDATE YDM_BC_OUTLIST T
   SET T.LEAVE_FACTORY_FLAG = '1',
   T.LEAVE_FACTORY_NAME = '#LEAVE_FACTORY_NAME#',
   T.LEAVE_FACTORY_TIME = SYSDATE,
   T.LEAVE_MANAGEMENT_NO = '#LEAVE_MANAGEMENT_NO#',
   T.LEAVE_MANAGEMENT_NAME = '#LEAVE_MANAGEMENT_NAME#'
 WHERE T.OUTSTOCK_DOC = '#OUTSTOCK_DOC#'
   AND T.LEAVE_FACTORY_FLAG = '0'
</query>
<query id = "FrmGateFrim.updateYdmGpLeaveFlag" desc = "确认出厂">
UPDATE YDM_GP_OUTLIST T
   SET T.LEAVE_FACTORY_FLAG = '1',
   T.LEAVE_FACTORY_NAME = '#LEAVE_FACTORY_NAME#',
   T.LEAVE_FACTORY_TIME = SYSDATE,
   T.LEAVE_MANAGEMENT_NO = '#LEAVE_MANAGEMENT_NO#',
   T.LEAVE_MANAGEMENT_NAME = '#LEAVE_MANAGEMENT_NAME#'
 WHERE T.OUTSTOCK_DOC = '#OUTSTOCK_DOC#'
   AND T.LEAVE_FACTORY_FLAG = '0'
</query>
<query id = "FrmGateFrim.cancelUpdateYdmBcLeaveFlag" desc = "撤销确认成功">
UPDATE YDM_BC_OUTLIST T
   SET T.LEAVE_FACTORY_FLAG = '0',
   T.LEAVE_FACTORY_NAME = '',
   T.LEAVE_FACTORY_TIME = '',
   T.LEAVE_MANAGEMENT_NO = '',
   T.LEAVE_MANAGEMENT_NAME = ''
 WHERE T.OUTSTOCK_DOC = '#OUTSTOCK_DOC#'
   AND T.LEAVE_FACTORY_FLAG = '1'
</query>
<query id = "FrmGateFrim.cancelUpdateYdmGpLeaveFlag" desc = "撤销确认成功">
UPDATE YDM_GP_OUTLIST T
   SET T.LEAVE_FACTORY_FLAG = '0',
   T.LEAVE_FACTORY_NAME = '',
   T.LEAVE_FACTORY_TIME = '',
   T.LEAVE_MANAGEMENT_NO = '',
   T.LEAVE_MANAGEMENT_NAME = ''
 WHERE T.OUTSTOCK_DOC = '#OUTSTOCK_DOC#'
   AND T.LEAVE_FACTORY_FLAG = '1'
</query>

<query id = "FrmGateFrim.doQueryMeterWeight" desc = "查询过磅信息">
select T.PREDICTION_NO,
       T.CAR_NO,
       T.METER_WEIGHT,
       T.CREATE_TIME,
       '毛重' WEIGHT_TYPE
  from METER_WORK_CAR_ACTUAL_FIRST t
 WHERE T.WEIGHT_TYPE = '0'
   AND T.NOTICE_NO = ?
</query>
</queryMap>