<?xml version="1.0" encoding="UTF-8"?>
 <queryMap desc="合同产品生产监制要求界面">
  <query id="CoreOrderProducer.CoreOrderProducerHeadQuery" desc="合同产品生产监制界面头信息">
        <![CDATA[
        SELECT decode(T1.PRDCR_STS,
                            'M',
                            '要求维护',
                            'W',
                            '要求待确认',
                            'S',
                            '要求生效',
                            'F',
                            '要求回退') PRDCR_STS,
                     t.ORDER_SEQ,
                     t.ORDER_UNIT,
                     t.ORD_LN_PK,
                     t2.ORDER_NO,
                     t3.whole_backlog_desc,
                     t.final_user_desc,
                     t.producname,
                     t.order_spec_desc,
                     t.model_desc,
                     t.len_desc,
                     t.order_qty,
                     t.LEN_UNIT,
                     t.ord_ensu_totl_len,
                     t.order_add_desc,
                     t.order_special_desc,
                     t.outs_stl_pipe_fl,
                     t.outs_billet_fl,
                     t.assel_fl,
                     t1.approver,
                     t.prdcr_desc
                FROM SLM_ORDER_LINE        T,
                     SLM_ORDER_LINE_PRDCR  T1,
                     slm_order_head        t2,
                     SLM_ORD_DESIGN_MSC_PL t3
               WHERE T.ORD_LN_PK || T.ORDER_SEQ = T1.PRDCR_NO
                 and t.ord_pk = t2.ord_pk
                 and t.ord_pk = t3.desgin_key
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerMainQuery" desc="合同产品生产监制界面监制主表信息">
        <![CDATA[
         select t.PRDCR_NO,decode(T.PRDCR_STS,'M','要求维护','W','要求待确认','S','要求生效','F','要求回退') PRDCR_STS, t.PRDCR_DESC, t.PRDCR_FILE_PATH, t.FAIL_MAN，FAIL_RSN
	     from SLM_ORDER_LINE_PRDCR t
	     where t.prdcr_no = ?
       
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerTainQuery" desc="合同产品生产监制界面监制从表信息">
        <![CDATA[
         select 'false' XZ,ROWNUM,
       t.PRDCR_NO,
       t.PROCESS_DESC,
       t.PROCESS_DESC_C,
       t.STATION_DESC,
       t.CRAFTITEM_DESC,
       t.PRDCR_PRC_FL,
       t.PRDCR_PRC_DESC,
       t.PRDCR_ADVC_DAY,
       t.PDEPT_NO,
       t.PDEPT_NAME,
       t.PDEPT_NO2,
       t.PDEPT_NAME2,
       t.PDEPT_NO3,
       t.PDEPT_NAME3,
       t.MEMO
       from SLM_ORDER_LINE_PRDCR_LST t where t.PRDCR_NO = ?

       
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerPdeptBase" desc="合同产品生产监制要求监制从表信息单位绑定">
        <![CDATA[
         select t.pdept_no, t.pdept_name from slm_base_prdcr_dept t
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerPrcBase" desc="合同产品生产监制要求监制从表信息监制类型绑定">
        <![CDATA[
         select basecode,basename from com_base_info where basecode like '1220%' and basecode <> '1220'
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerPhoneQuery" desc="合同产品生产监制要求监制从表信息根据单位找出电话">
        <![CDATA[
         select phone from slm_base_prdcr_dept where pdept_no = ?
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerDeptAdd" desc="合同产品生产监制要求监制保存功能">
        <![CDATA[
	             update SLM_ORDER_LINE_PRDCR_LST t
			     set t.PRDCR_PRC_FL   = ?,
			         t.PRDCR_PRC_DESC = ?,
			         t.PRDCR_ADVC_DAY = ?,
			         t.PDEPT_NO       = ?,
			         t.PDEPT_NAME     = ?,
			         t.PDEPT_NO2      = ?,
			         t.PDEPT_NAME2    = ?,
			         t.PDEPT_NO3      = ?,
			         t.PDEPT_NAME3    = ?,
			         t.MEMO = ?
			     where t.PRDCR_NO = ?
        ]]>
    </query>
  <query id="CoreOrderProducer.CoreOrderProducerDeptDelete" desc="合同产品生产监制要求监制删除功能">
        <![CDATA[
                 DELETE SLM_ORDER_LINE_PRDCR_LST t
                 where t.PRDCR_NO = ? and t.PROCESS_DESC = ? and t.PROCESS_DESC_C = ? and t.STATION_DESC= ?
        ]]>
    </query>
     <query id="CoreOrderProducer.CoreOrderProducerDeptProFe" desc="合同产品生产监制要求监制审批提报功能">
        <![CDATA[
                  UPDATE SLM_ORDER_LINE_PRDCR
              SET PRDCR_STS = 'W'
            where PRDCR_NO = ?
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerDeptProBa" desc="合同产品生产监制要求监制审批退回功能">
        <![CDATA[
                  UPDATE SLM_ORDER_LINE_PRDCR
              SET PRDCR_STS = 'F',FAIL_MAN= ?,FAIL_RSN=?
            where PRDCR_NO = ?
        ]]>
    </query>
    <query id="CoreOrderProducer.CoreOrderProducerDeptProsu" desc="合同产品生产监制要求监制审批通过功能">
        <![CDATA[
                  UPDATE SLM_ORDER_LINE_PRDCR
              SET PRDCR_STS = 'S',
                  APPROVER= ?
            where PRDCR_NO = ?
        ]]>
    </query>
    </queryMap>