<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "实绩入库表查询">
<query id = "FrmRptInput.queryInListData" desc = "查询实绩表">
select 
 #columns#
 sum(t.ACT_COUNT) as ACT_COUNT,
 sum(t.ACT_WEIGHT) as ACT_WEIGHT,
 sum(t.ACT_LEN) as ACT_LEN
 FROM YDM_ZC_INLIST t
 left join ydm_bs_storage s
 on t.storage_no = s.storage_no
 left join  SLM_ORDER_HEAD d on 
 t.ord_pk = d.ord_pk
 left join slm_order_line_delivery g on t.ord_ln_dly_pk = g.ord_ln_dly_pk
 left join COM_BASE_GRADE t1 on t1.GRADECODE=t.GRADECODE and  t1.VALIDFLAG = '1'
 LEFT JOIN (SELECT TH_ORDER_NO_SEQ from PLN_ORDER_ZG_S GROUP BY TH_ORDER_NO_SEQ) ZG ON t.ORDER_NO || '/' || t.ORDER_SEQ = ZG.TH_ORDER_NO_SEQ
 where 1=1 
 and t.INSTOCK_TYPE_CODE in('800701','800702','800704','800712') and t.VALIDFLAG ='1' #conditions#
 
</query>
<query id = "FrmRptInput.queryInListDataC" desc = "查询半成品的入库实绩">
select 
 #columns#
 sum(t.ACT_COUNT) as ACT_COUNT,
 sum(t.ACT_WEIGHT) as ACT_WEIGHT,
 sum(t.ACT_LEN) as ACT_LEN,
 nvl(sum(t.PACK_NO),0) PACK_NO
 FROM YDM_ZC_INLIST t
 left join ydm_bs_storage s
 on t.storage_no = s.storage_no
 where 1=1 
 and t.INSTOCK_TYPE_CODE in('800701','800702','800703','800704') and t.VALIDFLAG ='1' #conditions# 
</query>
<query id = "FrmRptInput.queryInListDataB" desc = "查询半成品的入库实绩">
select 
 #columns#
 sum(t.ACT_COUNT) as ACT_COUNT,
 sum(t.ACT_WEIGHT) as ACT_WEIGHT,
 sum(t.ACT_LEN) as ACT_LEN,
 nvl(sum(t.PACK_NO),0) PACK_NO
 FROM YDM_ZC_INLIST t
 left join ydm_bs_storage s
 on t.storage_no = s.storage_no
 where 1=1 
 and t.VALIDFLAG ='1' #conditions# 
</query>
<!--
INSTOCK_DOC,
       JUDGE_STOVE_NO,
       BATCH_NO,
       PRODUCCODE,
       PRODUCNAME,
       STD_CODE,
       STD_NAME,
       STEELCODE,
       STEELNAME,
       STD_STYLE,
       STD_STYLE_DESC,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       ACT_DIMATER,
       ACT_HEIGHT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       ACT_COUNT,
       ACT_WEIGHT,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       MEMO,
       CREATE_NAME,
       max(CREATE_TIME) as CREATE_TIME,
       ORDER_NO,
     ORDER_SEQ,
     DELIVERY_NO,
     DECODE(PRODUCT_FLAG,'801401','在制品','801402','成品','801403','商品')PRODUCT_FLAG 
 -->
</queryMap>