<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "库存信息查询">
<query id = "FrmrptProductRealTime.getStorgeData" desc = "实时库存信息">
<![CDATA[
select #columns# sum(T1.ACT_COUNT) as ACT_COUNT,
       sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
       sum(T1.ACT_LEN) as ACT_LEN,
       T1.SUBCONTRACT_LOG
  FROM (
  SELECT T1.*,(CASE WHEN HTTP.SUBCONTRACT_LOG = '00'
         THEN '初始值'
           WHEN HTTP.SUBCONTRACT_LOG = '10'
         THEN '审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '26'
         THEN '主管审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '27'
         THEN '主管审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '22'
         THEN '探伤审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '23'
         THEN '探伤审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '24'
         THEN '制造部审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '25'
         THEN '制造部审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '29'
         THEN '已生产'
           WHEN HTTP.SUBCONTRACT_LOG = '30'
         THEN '已回报'
           WHEN HTTP.SUBCONTRACT_LOG = '40'
         THEN '回报完毕'
           WHEN HTTP.SUBCONTRACT_LOG = '50'
         THEN '回报审核'
           WHEN HTTP.SUBCONTRACT_LOG = '60'
         THEN '关闭'
           ELSE '' END )SUBCONTRACT_LOG FROM MAT_ZC_M  T1 LEFT JOIN HTT_ENTRUST HTTP ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
       AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ)T1,
       YDM_ZC_BUTTRESS         T2,
       ydm_bs_storage          S,
       YDM_BS_LOCATION         S1,
       SLM_ORDER_HEAD          D,
       slm_order_line_delivery G,
       SLM_ORDER_LINE          L,
       ( SELECT TH_ORDER_NO_SEQ FROM PLN_ORDER_ZG_S GROUP BY TH_ORDER_NO_SEQ ) ZG
 WHERE T1.MAT_NO = T2.MAT_NO
   AND T2.STORAGE_NO = S.STORAGE_NO(+)
   AND T2.LOCATION_NO = S1.LOCATION_NO(+)
   AND T1.Ord_Pk = d.ord_pk(+)
   AND T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk(+)
   	AND T1.ORD_LN_PK = l.ORD_LN_PK ( + )
   	AND T1.PRO_ORDER_NO = ZG.TH_ORDER_NO_SEQ ( + )
   and T1.product_flag = '801403' #conditions# #belongcode# #conditions1#,T1.SUBCONTRACT_LOG
union all
select #columns# sum(T1.ACT_COUNT) as ACT_COUNT,
       sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
       sum(T1.ACT_LEN) as ACT_LEN,
       T1.SUBCONTRACT_LOG
  FROM (
  SELECT T1.*,(CASE WHEN HTTP.SUBCONTRACT_LOG = '00'
         THEN '初始值'
           WHEN HTTP.SUBCONTRACT_LOG = '10'
         THEN '审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '26'
         THEN '主管审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '27'
         THEN '主管审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '22'
         THEN '探伤审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '23'
         THEN '探伤审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '24'
         THEN '制造部审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '25'
         THEN '制造部审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '29'
         THEN '已生产'
           WHEN HTTP.SUBCONTRACT_LOG = '30'
         THEN '已回报'
           WHEN HTTP.SUBCONTRACT_LOG = '40'
         THEN '回报完毕'
           WHEN HTTP.SUBCONTRACT_LOG = '50'
         THEN '回报审核'
           WHEN HTTP.SUBCONTRACT_LOG = '60'
         THEN '关闭'
           ELSE '' END )SUBCONTRACT_LOG FROM MAT_ZC_M  T1 LEFT JOIN HTT_ENTRUST HTTP ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
       AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ) T1 ,
       YDM_ZC_BUTTRESS T2,
       ydm_bs_storage S,
       YDM_BS_LOCATION         S1,
       (select e.*
          from SLM_ORDER_HEAD e
         where e.validflag = '1') d,
       slm_order_line_delivery g,
       SLM_ORDER_LINE          L,
       (SELECT TH_ORDER_NO_SEQ from PLN_ORDER_ZG_S GROUP BY TH_ORDER_NO_SEQ) ZG
 WHERE t1.mat_no = t2.mat_no
   and t2.STORAGE_NO = S.STORAGE_NO(+)
   AND T2.LOCATION_NO = S1.LOCATION_NO(+)
   AND T1.PRO_ORDER_NO = ZG.TH_ORDER_NO_SEQ ( + )
   and substr(T1.PRO_ORDER_NO,
              1,
              decode(instr(T1.PRO_ORDER_NO, '/'),
                     0,
                     length(T1.PRO_ORDER_NO),
                     instr(T1.PRO_ORDER_NO, '/') - 1)) = d.order_no(+)
   and T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk(+)
    AND T1.ORD_LN_PK = l.ORD_LN_PK ( + )
   and T1.product_flag = '801402' #conditions# #conditions1#,T1.SUBCONTRACT_LOG
    ]]>
</query>
<!-- select 
 #columns#
 sum(T1.ACT_COUNT) as ACT_COUNT,
 sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
 sum(T1.ACT_LEN) as ACT_LEN
 FROM MAT_ZC_M T1,YDM_ZC_BUTTRESS T2 ,ydm_bs_storage S, SLM_ORDER_HEAD D,slm_order_line_delivery G
 WHERE T1.MAT_NO = T2.MAT_NO
   AND T2.STORAGE_NO = S.STORAGE_NO(+)
   AND  T1.Ord_Pk = d.ord_pk(+)
   AND  T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk(+)
   and T1.product_flag = '801403'
   #conditions#
   #conditions1#
   union all 
   select 
 #columns#
 sum(T1.ACT_COUNT) as ACT_COUNT,
 sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
 sum(T1.ACT_LEN) as ACT_LEN
 FROM MAT_ZC_M T1, YDM_ZC_BUTTRESS T2
  , ydm_bs_storage S 
  , (select e.SALE_AREA_DESC,
                    e.CREATE_NAME,
                    e.CUSTOMER_NM,
                    e.order_no
               from SLM_ORDER_HEAD e
              where e.validflag = '1') d ,
   slm_order_line_delivery g 
 WHERE t1.mat_no = t2.mat_no
  and t2.STORAGE_NO = S.STORAGE_NO(+)
  and substr(T1.OLD_ORDER_NO,
                                                   1,
                                                   decode(instr(T1.OLD_ORDER_NO,
                                                                '/'),
                                                          0,
                                                          length(T1.OLD_ORDER_NO),
                                                          instr(T1.OLD_ORDER_NO,
                                                                '/') - 1)) =
                                            d.order_no(+)
                                            and T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk(+)
    and T1.product_flag = '801402'
    #conditions#
    #conditions1# -->
<query id = "FrmrptProductRealTime.getRealityData" desc = "实际库存信息">
<![CDATA[
SELECT #columns2#
T1.ACT_COUNT,
T1.ACT_WEIGHT,
T1.ACT_LEN,S1.LOCATION_NAME,
T1.SUBCONTRACT_LOG
FROM (SELECT #columns# SUM(T1.ACT_COUNT) AS ACT_COUNT,
       SUM(T1.ACT_WEIGHT) AS ACT_WEIGHT,
       sum(T1.ACT_LEN) AS ACT_LEN,
       MAX(S.STORAGE_NO) STORAGE_NO,
               T1.ORD_PK,
               T1.ORD_LN_DLY_PK,MAX(S.LOCATION_NO ) LOCATION_NO,MAX(T1.SUBCONTRACT_LOG)SUBCONTRACT_LOG
          FROM 
          (SELECT T1.*,
                       (CASE
                         WHEN HTTP.SUBCONTRACT_LOG = '00' THEN
                          '初始值'
                         WHEN HTTP.SUBCONTRACT_LOG = '10' THEN
                          '审核通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '26' THEN
                          '主管审核通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '27' THEN
                          '主管审核不通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '22' THEN
                          '探伤审核通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '23' THEN
                          '探伤审核不通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '24' THEN
                          '制造部审核通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '25' THEN
                          '制造部审核不通过'
                         WHEN HTTP.SUBCONTRACT_LOG = '29' THEN
                          '已生产'
                         WHEN HTTP.SUBCONTRACT_LOG = '30' THEN
                          '已回报'
                         WHEN HTTP.SUBCONTRACT_LOG = '40' THEN
                          '回报完毕'
                         WHEN HTTP.SUBCONTRACT_LOG = '50' THEN
                          '回报审核'
                         WHEN HTTP.SUBCONTRACT_LOG = '60' THEN
                          '关闭'
                       END) SUBCONTRACT_LOG
                  FROM MAT_ZC_M T1
                  LEFT JOIN HTT_ENTRUST HTTP
                    ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
                   AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ) T1,
          YDM_ZC_BUTTRESS S,SLM_ORDER_LINE L
  WHERE T1.MAT_NO = S.MAT_NO
    AND T1.ORD_LN_PK = l.ORD_LN_PK ( + )
  AND NOT EXISTS
         (SELECT 1
                  FROM YDM_ZC_BILL_M G, YDM_ZC_BILL_C F
                 WHERE G.BILL_NO = F.BILL_NO
                 AND T1.MAT_NO = F.MAT_NO
                   AND G.LOADVEHICLE_TYPE = '2'
                   -- AND G.ISPRECLOSE <> '0'
                   AND F.RETURN_FLAG = '0'
                   AND G.RETURN_FLAG = '0'
                   AND (G.WIND_UP_FLAG = '1'
                    OR NOT EXISTS (
                        SELECT * FROM YDM_ZC_BILL_M
                        WHERE BILL_NO LIKE G.BILL_NO ||'-__'
                   ))
                   and ROWNUM = 1)
           AND T1.PRODUCT_FLAG = '801403'
           #conditions#   #conditions2# ,
                  T1.ORD_PK,
                  T1.ORD_LN_DLY_PK) T1
  LEFT JOIN YDM_BS_STORAGE S ON S.STORAGE_NO = T1.STORAGE_NO
  LEFT JOIN YDM_BS_LOCATION S1 ON T1.LOCATION_NO = S1.LOCATION_NO
  LEFT JOIN (SELECT MAX(D.SALE_AREA_DESC)SALE_AREA_DESC,
                    D.ORD_PK,
                    MAX(D.CUSTOMER_NM)CUSTOMER_NM,
                    MAX(G.RECEIV_NM)RECEIV_NM,
                    MAX(G.TRANSIT_TYP)TRANSIT_TYP,
                    MAX(D.CREATE_NAME)CREATE_NAME,
                    G.ORD_LN_DLY_PK
               FROM SLM_ORDER_HEAD D, SLM_ORDER_LINE_DELIVERY G
              WHERE D.ORD_PK = G.ORD_PK
                AND D.VALIDFLAG = '1'
                AND G.VALIDFLAG = '1'
              GROUP BY D.ORD_PK, G.ORD_LN_DLY_PK) G
  ON T1.ORD_PK = G.ORD_PK
   AND T1.ORD_LN_DLY_PK = G.ORD_LN_DLY_PK
union all
select #columns1# sum(T1.ACT_COUNT) as ACT_COUNT,
       sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
       sum(T1.ACT_LEN) as ACT_LEN,MAX(S1.LOCATION_NAME) LOCATION_NAME,
       (CASE WHEN max(HTTP.SUBCONTRACT_LOG) = '00'
         THEN '初始值'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '10'
         THEN '审核通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '26'
         THEN '主管审核通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '27'
         THEN '主管审核不通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '22'
         THEN '探伤审核通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '23'
         THEN '探伤审核不通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '24'
         THEN '制造部审核通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '25'
         THEN '制造部审核不通过'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '29'
         THEN '已生产'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '30'
         THEN '已回报'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '40'
         THEN '回报完毕'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '50'
         THEN '回报审核'
           WHEN max(HTTP.SUBCONTRACT_LOG) = '60'
         THEN '关闭'
           ELSE '' END )SUBCONTRACT_LOG
  FROM MAT_ZC_M T1
  left join YDM_ZC_BUTTRESS T2 on T1.MAT_NO = T2.MAT_NO
  LEFT JOIN ydm_bs_storage S ON S.STORAGE_NO = T2.STORAGE_NO
  LEFT JOIN YDM_BS_LOCATION S1 ON T2.LOCATION_NO = S1.LOCATION_NO
  left join (select e.SALE_AREA_DESC,
                    e.CREATE_NAME,
                    e.CUSTOMER_NM,
                    e.order_no
               from SLM_ORDER_HEAD e
              where e.validflag = '1') d on substr(T1.PRO_ORDER_NO,
                                                   1,
                                                   decode(instr(T1.PRO_ORDER_NO,
                                                                '/'),
                                                          0,
                                                          length(T1.PRO_ORDER_NO),
                                                          instr(T1.PRO_ORDER_NO,
                                                                '/') - 1)) =
                                            d.order_no
  left join slm_order_line_delivery g on T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk
  LEFT JOIN SLM_ORDER_LINE l on T1.ORD_LN_PK = l.ORD_LN_PK
  LEFT JOIN HTT_ENTRUST HTTP
  ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
  AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ
 WHERE T1.JUDGE_STOVE_NO = T2.JUDGE_STOVE_NO
   AND T1.BATCH_NO = T2.BATCH_NO
   AND T1.product_flag = '801402' #conditions# #conditions1#
   ]]>
</query>
<query id = "FrmrptProductRealTime.getVirtualData" desc = "查询虚单量">
select 
 #columns#
 sum(T1.ACT_COUNT) as ACT_COUNT,
 sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
 sum(T1.ACT_LEN) as ACT_LEN,max(s1.LOCATION_NAME) LOCATION_NAME,
 (CASE WHEN HTTP.SUBCONTRACT_LOG = '00'
         THEN '初始值'
           WHEN HTTP.SUBCONTRACT_LOG = '10'
         THEN '审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '26'
         THEN '主管审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '27'
         THEN '主管审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '22'
         THEN '探伤审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '23'
         THEN '探伤审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '24'
         THEN '制造部审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '25'
         THEN '制造部审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '29'
         THEN '已生产'
           WHEN HTTP.SUBCONTRACT_LOG = '30'
         THEN '已回报'
           WHEN HTTP.SUBCONTRACT_LOG = '40'
         THEN '回报完毕'
           WHEN HTTP.SUBCONTRACT_LOG = '50'
         THEN '回报审核'
           WHEN HTTP.SUBCONTRACT_LOG = '60'
         THEN '关闭'
           ELSE '' END )SUBCONTRACT_LOG
 FROM (
    SELECT
    T3.*,
    T2.STORAGE_NO,
    t2.LOCATION_NO
    FROM
    MAT_ZC_M_XN T3,
    YDM_ZC_BUTTRESS T2
    WHERE
    T3.MAT_NO = T2.MAT_NO
	    --AND EXISTS (
	    --SELECT
	    --1
	    --FROM
	    --YDM_ZC_BILL_M G,
	    --YDM_ZC_BILL_C F
	    --WHERE
	    --G.BILL_NO = F.BILL_NO
	    --AND G.LOADVEHICLE_TYPE = '2'
	    --AND F.MAT_NO = T3.MAT_NO
	    --and ROWNUM = 1)
    ) T1
 LEFT JOIN ydm_bs_storage S ON S.STORAGE_NO=T1.STORAGE_NO
    LEFT JOIN YDM_BS_LOCATION S1 ON T1.LOCATION_NO = S1.LOCATION_NO
 left join SLM_ORDER_HEAD d on T1.Ord_Pk = d.ord_pk
 left join slm_order_line_delivery g on T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk
    LEFT JOIN SLM_ORDER_LINE l on T1.ORD_LN_PK = l.ORD_LN_PK
    LEFT JOIN HTT_ENTRUST HTTP ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
    AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ
 WHERE T1.product_flag = '801403'
   #conditions#
   #conditions1#,HTTP.SUBCONTRACT_LOG
</query>
    <query id = "FrmrptProductRealTime.getNoVirtualData" desc = "查询虚单未关闭量">
        select
        #columns#
        sum(T1.ACT_COUNT) as ACT_COUNT,
        sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
        sum(T1.ACT_LEN) as ACT_LEN,
        (CASE WHEN HTTP.SUBCONTRACT_LOG = '00'
         THEN '初始值'
           WHEN HTTP.SUBCONTRACT_LOG = '10'
         THEN '审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '26'
         THEN '主管审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '27'
         THEN '主管审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '22'
         THEN '探伤审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '23'
         THEN '探伤审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '24'
         THEN '制造部审核通过'
           WHEN HTTP.SUBCONTRACT_LOG = '25'
         THEN '制造部审核不通过'
           WHEN HTTP.SUBCONTRACT_LOG = '29'
         THEN '已生产'
           WHEN HTTP.SUBCONTRACT_LOG = '30'
         THEN '已回报'
           WHEN HTTP.SUBCONTRACT_LOG = '40'
         THEN '回报完毕'
           WHEN HTTP.SUBCONTRACT_LOG = '50'
         THEN '回报审核'
           WHEN HTTP.SUBCONTRACT_LOG = '60'
         THEN '关闭'
           ELSE '' END )SUBCONTRACT_LOG
        FROM (SELECT T1.* from (SELECT T3.*,T2.STORAGE_NO FROM MAT_ZC_M T3,YDM_ZC_BUTTRESS T2
        WHERE T3.MAT_NO = T2.MAT_NO)T1,(SELECT DISTINCT F.MAT_NO
        FROM YDM_ZC_BILL_M G, YDM_ZC_BILL_C F
        WHERE G.BILL_NO = F.BILL_NO
        AND G.LOADVEHICLE_TYPE = '2' AND G.ISPRECLOSE = '0') T5 where t1.mat_no = t5.mat_no)T1
        LEFT JOIN ydm_bs_storage S ON S.STORAGE_NO=T1.STORAGE_NO
        left join SLM_ORDER_HEAD d on T1.Ord_Pk = d.ord_pk
        left join slm_order_line_delivery g on T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk
        LEFT JOIN SLM_ORDER_LINE l on T1.ORD_LN_PK = l.ORD_LN_PK
        LEFT JOIN HTT_ENTRUST HTTP ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
        AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ  
        WHERE T1.product_flag = '801403'
        #conditions#
        #conditions1#,HTTP.SUBCONTRACT_LOG
    </query>
<query id = "FrmrptProductRealTime.getTargetData" desc = "查询目标库库存">
select 
 #columns#
 sum(T1.ACT_COUNT) as ACT_COUNT,
 sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
 sum(T1.ACT_LEN)as ACT_LEN
 FROM (SELECT T1.* from (SELECT T3.*,T2.STORAGE_NO FROM MAT_ZC_M T3,YDM_ZC_BUTTRESS T2
   WHERE T3.MAT_NO = T2.MAT_NO)T1,(SELECT F.MAT_NO
               FROM YDM_ZC_BILL_M G, YDM_ZC_BILL_C F
              WHERE G.BILL_NO = F.BILL_NO
                AND G.ZOUT_FLAG = '1') T5 where t1.mat_no = t5.mat_no)T1
 LEFT JOIN ydm_bs_storage S ON S.STORAGE_NO=T1.STORAGE_NO
 left join SLM_ORDER_HEAD d on T1.Ord_Pk = d.ord_pk
 left join slm_order_line_delivery g on T1.Ord_Ln_Dly_Pk = g.ord_ln_dly_pk
    LEFT JOIN SLM_ORDER_LINE l on T1.ORD_LN_PK = l.ORD_LN_PK
 left join (SELECT F.MAT_NO
                  FROM YDM_ZC_BILL_M G, YDM_ZC_BILL_C F
                 WHERE G.BILL_NO = F.BILL_NO
                   AND G.LOADVEHICLE_TYPE = '2')T5
                   on T1.Mat_No = T5.mat_no
 LEFT JOIN HTT_ENTRUST HTTP ON T1.SUBCONTRACT_NO = HTTP.SUBCONTRACT_NO
       AND T1.SUBCONTRACT_NO_SEQ = HTTP.SUBCONTRACT_NO_SEQ                  
 WHERE T1.product_flag = '801403'
   #conditions#
   #conditions1#,HTTP.SUBCONTRACT_LOG
</query>
<query id = "FrmrptProductRealTime.getStorgeDataC" desc = "查询半成品库库存信息">
select 
 #columns#
 sum(T1.ACT_COUNT) as ACT_COUNT,
 sum(T1.ACT_WEIGHT) as ACT_WEIGHT,
 sum(T1.ACT_LEN) as ACT_LEN
 FROM MAT_ZC_M T1,YDM_ZC_BUTTRESS T2
 ,ydm_bs_storage S 
 WHERE T1.MAT_NO=T2.MAT_NO
   AND T2.STORAGE_NO=S.STORAGE_NO(+)
   --AND T1.product_flag = '801401'
   #conditions2#
   #conditions#
   #conditions1#
</query>
</queryMap>