<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="加工订单">

	<query id="FrmOrderJg.queryJgxM" desc="加工订单 查询加工订单">
             <![CDATA[
            SELECT 
       T.PRO_PLAN_ID,
       T.PRO_ORDER_NO,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.PLN_DIVIDE_ID,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.PLAN_GROUP_ID,
       T.REQ_BL_ID,
       T1.BASENAME AS GROUP_JGX,
       T.STEELCODE,
       T.STEELNAME,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.AIMWALLTHICK,
       T.LENGTHMAX,
       T.LENGTHMIN,
       T.LENGTHDISC,
       T.AIMLENGTH,
       T.SHRT_LEN_RATO,
       T.SHORTEST,
       T.LONG_LEN_RATO,
       T.LONGEST,
       T.SHRT_STOVE,
       T.AVG_LEN_MIN,
       T.DIFRNC_LEN_MAX,
       T.SIGL_LEN,
       T.ENDLEN_SPECSTD,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.GETRATE,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.PLANWEIGHT,
       T.PLANNUM,
       T.MATCH_WEIGHT,
       T.MATCH_NUM,
       DECODE(T.IFBUYPLAN,'0','无','1','有','无') IFBUYPLAN,
       T.BUYPLANID,
       T.BUYPLANWEIGHT,
       T.REQ_PROD_WEIGHT,
       T.IN_WEIGHT,
       T.IN_NUM,
       TO_CHAR(T.PLAN_TIME, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME,
       T.PLAN_USETIME,
       DECODE(T.ISENDGX,'1','是','否')ISENDGX,
       T.PREVIOUS_GX,
       T.PREV_GXPLAN_ID,
       DECODE(T.IF_MONITOR_JGX,'1','是','否')IF_MONITOR_JGX,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.PRO_MONTH,
       T.PLANSTATUS,
       T.FINISHWEIGHT,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.PREVIOUS_GX_CODE
 FROM PLN_GX_JGX_M T,COM_BASE_INFO T1
 WHERE 
 T.GROUP_JGX=T1.BASECODE(+)
  AND 1=1
                 ]]>
	</query>

	<query id="FrmOrderJg.queryJgx" desc="加工订单 查询加工工序合同">
             <![CDATA[
              SELECT 
       T.PRO_ORDER_NO,
       T.PLAN_GROUP_ID,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.PLN_DIVIDE_ID,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.INDEX_SEQ,
       T.BOM,
       T.BACKLOG_SEQ,
       T.STEELCODE,
       T.STEELNAME,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.AIMWALLTHICK,
       T.LENGTHMAX,
       T.LENGTHMIN,
       T.LENGTHDISC,
       T.AIMLENGTH,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.GETRATE,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.INWL_ID,
       T.OUTWL_ID,
       T1.BASENAME AS GROUP_JGX,
       T.PLINE_CODE_MAY,
       T.PLINE_NAME_MAY,
       T.ORDERWEIGHT,
       T.ORDERNUM,
       T.MATCH_WT,
       T.MATCH_NUM,
       DECODE(T.IFBUYPLAN,'1','是','0','否','')IFBUYPLAN,
       T.BUYPLANID,
       T.BUYPLAN_WT,
       T.REQ_PROD_WT,
       T.REQ_PROD_NUM,
       TO_CHAR(T.PROD_END_DATE, 'YYYY-MM-DD HH24:MI:SS') PROD_END_DATE,
       DECODE(T.ORDERSTATUS,'1','计划','2','排产','3','生产中','4','生产完成','5','合同关闭','6','合同取消','9','封闭','') ORDERSTATUS,
       DECODE(T.IS_PLANED,'1','是','0','否','') IS_PLANED,
       T.PRO_PLAN_ID,
       T.FINISHWEIGHT,
       DECODE(T.ISENDGX,'1','是','0','否','') ISENDGX,
       T.NEXT_GX,
       DECODE(T.IF_MONITOR_JGX,'1','是','0','否','') IF_MONITOR_JGX,
       T.PRDCR_NO,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.PLINE_CODE,
       T.PLINE_NAME,
       DECODE(T.IF_SET_TIME,'0','未折分','1','部分拆分','2','全部拆分','') IF_SET_TIME,
       T.CRAFT_SEQ,
       T.PROCESS_CODE_C,
       T.PROCESS_DESC_C,
       T.STATION_ROAD,
       T.PREVIOUS_GX,
       T.PREVIOUS_GX_CODE
 FROM PLN_ORDER_JGX T,COM_BASE_INFO T1
 WHERE 1=1
 AND T.GROUP_JGX=T1.BASECODE(+)
 AND T.PRO_PLAN_ID IS NOT NULL
                 ]]>
	</query>

</queryMap>