<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "缴库分组审核">
<query id = "FrmFirmInList.getPline" desc = "获取产线代码">
SELECT T.PLINE_CODE FROM COM_BASE_PLINE T WHERE T.GROUP_PAY = ?
</query>
<query id = "FrmFirmInList.queryInListData" desc = "查询入库实绩">
<![CDATA[
 SELECT 
       t.INSTOCK_DOC,
       t.JUDGE_STOVE_NO,
       t.BATCH_NO,
       t.PRODUCCODE,
       t.PRODUCNAME,
       t.STD_CODE,
       t.STD_NAME,
       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_DIMATER,
       t.ACT_HEIGHT,
       to_char(t.ACT_LEN_MIN,'FM999990.00') AS ACT_LEN_MIN,
       to_char(t.ACT_LEN_MAX,'FM999990.00') AS ACT_LEN_MAX,
       to_char(t.ACT_LEN_MIN,'FM999990.00')||'-'||to_char(t.ACT_LEN_MAX,'FM999990.00') as LEN,
       sum(t.ACT_COUNT) as ACT_COUNT,
       to_char(sum(t.ACT_WEIGHT),'FM999999990.000') as ACT_WEIGHT,
       sum(nvl(t.ACT_LEN,0)) as ACT_LEN,
       t.BELONG_CODE,
       t.BELONG_NAME,
       s.STORAGE_NAME,
       t.MEMO,
       t.CREATE_NAME,
       max(to_char(t.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS')) as INSTOCK_TIME,
       max(to_char(t.IN_TIME_F,'YYYY-MM-DD HH24:MI:SS')) AS IN_TIME_F,
       to_char(to_date(t.BAL_YEAR_MONTH,'YYYY-MM'),'yyyy-MM') as BAL_YEAR_MONTH,
       --t.BAL_YEAR_MONTH,
       t.ORDER_NO,
     t.ORDER_SEQ,
     t.DELIVERY_NO,
     t.JUDGE_STD_CODE,
     t.JUDGE_STD_NAME,
     t.PLINE_CODE,
     t.PLINE_NAME,
     t.GRADECODE,
     t.GRADENAME,
     DECODE(t.PRODUCT_FLAG,'801401','在制品','801402','成品','801403','商品')PRODUCT_FLAG,
     DECODE(t.AFFIRM_LOG,'0','未审核','1','已审核')AFFIRM_LOG,
     t.ZB_RCDID,
     d.SALE_AREA_DESC,
       d.create_name AS ordercreatename,
       t.PIPMEMO,
       t.BATCH_GROUD_NO,
       t.INSTOCK_TYPE_NAME,
       DECODE(T.HAND_FLAG,'0','缴库入库','1','手工入库')HAND_FLAG,
       t.SUPPLY_UNIT,
        DECODE(T.IS_ALL_SCRAP,'0','正常','1','整炉废','2','白条','3','红冲','4','成品利库','5','短节备料利库','6','半成品转成品','7','离线转压库','8','余材转压库') IS_ALL_SCRAP
 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
 where t.INSTOCK_TYPE_CODE in('800701','800704')
   AND t.JUDGE_STOVE_NO || '&' LIKE ('%' || upper(?) || '%')
   AND t.ORDER_NO || '&' LIKE ('%' || upper(?) || '%')
   ]]>
</query>
<query id = "FrmFirmInList.updateAffimLog" desc = "审核通过">
UPDATE YDM_ZC_INLIST T SET T.AFFIRM_LOG = '1' WHERE T.INSTOCK_DOC = ?
</query>
<query id = "FrmFirmInList.cancelUpdateAffimLog" desc = "撤销审核">
UPDATE YDM_ZC_INLIST T SET T.AFFIRM_LOG = '0' WHERE T.INSTOCK_DOC = ?
</query>
</queryMap>