package com.steering.common;

import net.sf.json.JSONObject;

import java.sql.PreparedStatement;

public class XsSql {

	/**
	 * 销售片区插入SQL
	 * */
	public static String insertslmbasesaleareatyp =
			"INSERT INTO SLM_BASE_SALE_AREA_TYP("
			+ "SALE_ORG,SALE_AREA_NO,SALE_AREA_DESC,VALIDFLAG,CREATE_TIME,CREATE_NMAE) VALUES"
			+ "(?,?,?,'1',SYSDATE,?)";

	
	/**
	 * 销售片区插入SQL数据注入
	 * */
	public static void psInsertsertslmbasesaleareatyp(PreparedStatement ps, JSONObject basecode1) throws Exception {
		ps.setString(1, basecode1.getString("SALE_ORG"));ps.setString(2, basecode1.getString("SALE_AREA_NO"));
		ps.setString(3, basecode1.getString("SALE_AREA_DESC"));ps.setString(4, basecode1.getString("CREATE_NMAE"));
	}
	
	/**
	 * 销售片区删除SQL
	 * */
	public static String deleteslmbasesaleareatyp =
			"UPDATE SLM_BASE_SALE_AREA_TYP SET VALIDFLAG = '0',DELETE_NMAE = ?,DELETE_TIME = SYSDATE WHERE SALE_ORG = ? AND SALE_AREA_NO = ? ";

	
	/**
	 * 销售片区删除SQL数据注入
	 * */
	public static void psDelslmbasesaleareatyp(PreparedStatement ps, JSONObject basecode1) throws Exception {
		ps.setString(1, basecode1.getString("DELETE_NAME"));ps.setString(1, basecode1.getString("SALE_ORG"));
		ps.setString(1, basecode1.getString("SALE_AREA_NO"));
	}
	
	/**
	 * 销售片区修改SQL
	 * */
	public static String Updateslmbasesaleareatyp =
			"update SLM_BASE_SALE_AREA_TYP "
			+ "SET SALE_AREA_DESC = ?, "
			+ "UPDATE_NAME = ?, "
			+ "UPDATE_TIME = SYSDATE, "
            + " WHERE SALE_ORG = ? AND SALE_AREA_NO = ?";

	
	/**
	 * 销售片区修改SQL数据注入
	 * */
	public static void psUpdslmbasesaleareatyp(PreparedStatement ps, JSONObject basecode1) throws Exception {
		ps.setString(1, basecode1.getString("SALE_AREA_DESC"));ps.setString(2, basecode1.getString("UPDATE_NAME"));
		ps.setString(3, basecode1.getString("SALE_ORG"));ps.setString(4, basecode1.getString("SALE_AREA_NO"));
	}
	
	/**
	 * 客户单位插入SQL
	 * */
	public static String insertslmbasecustomer =
			"INSERT INTO SLM_BASE_CUSTOMER("
			+ "CUSTOMER_NO,CUSTOMER_NM,VALIDFLAG,CREATE_TIME,CREATE_NAME) VALUES"
			+ "(?,?,'1',SYSDATE,?)";

	
	/**
	 * 客户单位插入SQL数据注入
	 * */
	public static void psInsertslmbasecustomer(PreparedStatement ps, JSONObject basecode1) throws Exception {
		ps.setString(1, basecode1.getString("CUSTOMER_NO"));ps.setString(2, basecode1.getString("CUSTOMER_NM"));
		ps.setString(3, basecode1.getString("NAME"));
	}
	
	/**
	 * 客户单位删除SQL
	 * */
	public static String deleteslmbasecustomer =
			"UPDATE SLM_BASE_CUSTOMER SET VALIDFLAG = '0',DELETE_TIME = SYSDATE,DELETE_NAME = ? WHERE CUSTOMER_NO = ? ";

	
	/**
	 * 客户单位删除SQL数据注入
	 * */
	public static void psDelslmbasecustomer(PreparedStatement ps, JSONObject basecode1) throws Exception {
		ps.setString(1, basecode1.getString("NAME"));ps.setString(2, basecode1.getString("CUSTOMER_NO"));
	}
	
	/**
	 * 客户单位修改SQL
	 * */
	public static String Updateslmbasecustomer =
			"update SLM_BASE_CUSTOMER "
			+ "SET CUSTOMER_NM = ?, "
			+ "UPDATE_TIME = SYSDATE, "
			+ "UPDATE_NAME = ? "
            + " WHERE CUSTOMER_NO = ? ";

	
	/**
	 * 客户单位修改SQL数据注入
	 * */
	public static void psUpdslmbasecustomer(PreparedStatement ps, JSONObject basecode1) throws Exception {
		ps.setString(1, basecode1.getString("CUSTOMER_NM"));ps.setString(2, basecode1.getString("NAME"));
		ps.setString(3, basecode1.getString("CUSTOMER_NO"));
	}
	
	/**
	 * 脱单sql
	 */
	public static String TakeOff =
			"UPDATE MAT_ZC_M T "
            + " SET T.ORDER_NO      = '', "
       + " T.ORDER_SEQ     = '', "
       + " T.ORDER_SEQ_NO  = '', "
       + " T.ORD_PK        = '', "
       + " T.ORD_LN_PK     = '', "
       + " T.ORD_LN_DLY_PK = '', "
       + " T.PRODUCT_FLAG  = '801402', "
       + " T.MAT_STATUS    = '80150202' "
    + " WHERE T.ORD_PK = ? "
    + " AND T.PRODUCT_FLAG = '801403' "
    + " AND T.MAT_STATUS = '80150301'";
	
	/**
	 * 脱单sql
	 */
	public static void psTakeOff(PreparedStatement ps, String ord_pk) throws Exception {
		ps.setString(1, ord_pk);
	}
	
	/**
	 * 脱单sql
	 */
	public static String deletePurchase =
			"DELETE FROM  SLM_ORDER_LINE_PURCHASE T "
            +" WHERE T.VALIDFLAG = '1' "
            +"     AND  T.ORD_PK = ?";
	/**
	 * 脱单sql
	 */
	public static void psdeletePurchase(PreparedStatement ps, String ord_pk)throws Exception {
		ps.setString(1, ord_pk);
	}
	/**
	 * 废除合同头
	 */
	public static String DELETEHead =
			" UPDATE SLM_ORDER_HEAD SET DELETE_NAME=?,DELETE_TIME=SYSDATE,VALIDFLAG=0 WHERE ORD_PK=?  ";
	
	/**
	 * 废除合同头
	 */
	public static void psDELETEHead(PreparedStatement ps, String ord_pk)throws Exception {
		ps.setString(1, ord_pk);
	}
	
	/**
	 * 废除合同行
	 */
	public static String DELETELine =
			" UPDATE SLM_ORDER_LINE SET DELETE_NAME=?,DELETE_TIME=SYSDATE,VALIDFLAG=0 WHERE ORD_PK=?  ";
	
	/**
	 * 废除合同行
	 */
	public static void psDELETELine(PreparedStatement ps, String ord_pk)throws Exception {
		ps.setString(1, ord_pk);
	}
	
	/**
	 * 废除交货行
	 */
	public static String DELETEDeliveryLine =
			" UPDATE SLM_ORDER_LINE_DELIVERY SET DELETE_NAME=?,DELETE_TIME=SYSDATE,VALIDFLAG=0 WHERE ORD_PK=?  ";
	
	/**
	 * 废除交货行
	 */
	public static void psDELETEDeliveryLine(PreparedStatement ps, String ord_pk)throws Exception {
		ps.setString(1, ord_pk);
	}
	
	
	/**
	 * 获取评审明细
	 */
	public static String getCrmOrderInfo =
			"SELECT   H.ORD_PK,L.ORD_LN_PK,D.ORD_LN_DLY_PK,H.ORDER_NO,L.ORDER_SEQ,D.DELIVERY_NO,"
		                  + " H.CUSTM_ORDER_NO,H.ORDER_TYP,H.ORDER_TYP_DESC,C.REGION_NO, "
		                  + " (SELECT T.REGION_NM FROM SEL_ADMIN_REGION T WHERE T.REGION_NO=C.REGION_NO) REGION_NAME, "
		                  + " H.SALE_ORG,H.SALE_ORG_DESC,H.SALE_AREA_NO,H.SALE_AREA_DESC,H.CUSTOMER_NO,H.CUSTOMER_NM, "
		                  + " H.CREATE_NAME,D.RECEIV_NO,D.RECEIV_NM,(SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.PRICE_FL) PRICE_FL, "
		                  + " D.DELVRY_QTY ORDER_QTY,L.BALNCE_PRICE,(SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.CURRENCY) CURRENCY, "
		                  + " (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.MNY_ASK_TYP) MNY_ASK_TYP,H.CONTAIN_TAX, "
		                  + " D.ORDER_UNIT,L.PRODUCCODE,L.PRODUCNAME,L.STD_CODE,L.STD_NAME,L.STEELCODE,L.STEELNAME,L.STD_STYLE, "
		                  + " L.STD_STYLE_DESC,L.MODEL_CODE,L.MODEL_DESC,L.ORDER_SPEC_CODE,L.ORDER_SPEC_DESC,L.SPEC_CODE,L.SPEC_NAME, "
		                  + " L.DIMATER,L.HEIGHT,L.LEN_NO,L.LEN_DESC,L.LEN_UNIT,(SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=L.OUTS_BILLET_FL) OUTS_BILLET_FL, "
		                  + " (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=L.OUTS_STL_PIPE_FL) OUTS_STL_PIPE_FL, "
		                  + " H.MNY_ASK_DESC,L.ISLOCK,L.PRDCR_DESC,L.MPS_DESC,H.STLMT_UNIT_NO,H.STLMT_UNIT_NM,L.DELVRY_RANGE_TPE, "
		                  + " L.DELVRY_RANGE_MIN,L.DELVRY_RANGE_MAX,L.ADD_ASK_NO,L.ORDER_ADD_DESC,L.ORDER_SPECIAL_DESC,D.DELIVERY_STATUS ORDER_STS, "
		                  + " (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=D.DELIVERY_STATUS) ORDER_STS_DESC,L.ORDER_LN_STATUS ORDER_LN_STS, "
		                  + " (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=L.ORDER_LN_STATUS) ORDER_LN_STS_DESC, "
		                  + " H.SUPPLY_UNIT SUPPLY_UNIT_CODE,(SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.SUPPLY_UNIT) SUPPLY_UNIT, "
		                  + " D.WGT_ESTMT,to_char(D.DELVRY_EDATE,'YYYY-MM-DD') DELVRY_EDATE,to_char(H.EFFECT_TIME,'YYYY-MM-DD') EFFECT_TIME, "
		                  + " to_char((SELECT T.CREATE_TIME FROM PLN_SALEORD T WHERE T.ORD_LN_DLY_PK=D.ORD_LN_DLY_PK),'YYYY-MM-DD') TIBAO_TIME, "
		                  + " P.PORDERSTATUS,L.BALNCE_PRICE_STS,DECODE(l.KEEP_TYPE,'0','保单价','1','保总价') KEEP_TYPE, "
		                  + " (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.FST_DRAWEE_UNIT) FST_DRAWEE_UNIT, "
		                  + " H.ORDER_STS ORDER_HEAD_STS,H.ORDER_STS_DESC ORDER_HEAD_STS_DESC FROM 	SLM_ORDER_HEAD H LEFT join SLM_ORDER_LINE L on H.ORD_PK = L.ORD_PK "
		                  + " LEFT JOIN SLM_BASE_CUSTOMER C ON H.CUSTOMER_NO = C.CUSTOMER_NO LEFT JOIN SLM_ORDER_LINE_DELIVERY D ON L.ORD_LN_PK = D.ORD_LN_PK "
		                  + " LEFT JOIN PLN_SALEORD P ON D.ORD_LN_DLY_PK = P.ORD_LN_DLY_PK WHERE 1 = 1 AND H.ORD_PK= ? AND ROWNUM = 1";
	
	/**
	 * 获取评审明细
	 */
	public static void psgetCrmOrderInfo(PreparedStatement ps, String ord_pk) throws Exception {
		ps.setString(1, ord_pk);
	}
	
	/**
	 * 新增合同头
	 */
	public static String InsertOrderHead = "insert into slm_order_head\r\n" +
			"  (ORD_PK, \r\n" + 
			"   MANAG_NO,\r\n" + 
			"   ORDER_NO,\r\n" + 
			"   CUSTM_ORDER_NO,\r\n" + 
			"   REVW_RPT_NO,\r\n" + 
			"   ORDER_TYP,\r\n" + 
			"   ORDER_TYP_DESC,\r\n" + 
			"   PROTCL_NO,\r\n" + 
			"   CUSTOMER_NO,\r\n" + 
			"   CUSTOMER_NM,\r\n" + 
			"   MARKET_SYS,\r\n" + 
			"   MARKET_SYS_DESC,\r\n" + 
			"   ABRVITION,\r\n" + 
			"   SUPPLY_UNIT,\r\n" + 
			"   PRICE_FL,\r\n" + 
			"   CURRENCY,\r\n" + 
			"   MNY_ASK_TYP,\r\n" + 
			"   STLMT_UNIT_NO,\r\n" + 
			"   STLMT_UNIT_NM,\r\n" + 
			"   FST_DRAWEE_UNIT,\r\n" + 
			"   LEGAL_PSN,\r\n" + 
			"   AGENT,\r\n" + 
			"   ADDRESS,\r\n" + 
			"   ZIP_CODE,\r\n" + 
			"   BANK,\r\n" + 
			"   ACCOUNT,\r\n" + 
			"   TAX_ID,\r\n" + 
			"   PHONE,\r\n" + 
			"   FAX,\r\n" + 
			"   ORDER_WGT,\r\n" + 
			"   ORDER_MNY_TAX,\r\n" + 
			"   ORDER_MNY_NTAX,\r\n" + 
			"   MNY_ASK_DESC,\r\n" + 
			"   SIGN_PERSON,\r\n" + 
			"   SIGN_DATE,\r\n" + 
			"   SIGN_ADDRESS,\r\n" + 
			"   ORDER_YEAR,\r\n" + 
			"   ORDER_BDATE,\r\n" + 
			"   ORDER_EDATE,\r\n" + 
			"   ORDER_SCAN_NO,\r\n" + 
			"   CUSTOMER_MODEL_FL,\r\n" + 
			"   ORDER_MODEL_NO,\r\n" + 
			"   ORDER_MODEL_DESC,\r\n" + 
			"   SALE_ORG,\r\n" + 
			"   SALE_ORG_DESC,\r\n" + 
			"   SALE_AREA_NO,\r\n" + 
			"   SALE_AREA_DESC,\r\n" + 
			"   MEMO,\r\n" + 
			"   BE_ORDER_STS,\r\n" + 
			"   BE_OBJ_STS_OP,\r\n" + 
			"   ORDER_STS,\r\n" + 
			"   ORDER_STS_DESC,\r\n" + 
			"   OBJ_STS_OP,\r\n" + 
			"   APPROVAL_MAN,\r\n" + 
			"   APPROVAL_TIME,\r\n" + 
			"   EFFECT_MAN,\r\n" + 
			"   EFFECT_TIME,\r\n" + 
			"   CLOSE_MAN,\r\n" + 
			"   CLOSE_TIME,\r\n" + 
			"   VALIDFLAG,\r\n" + 
			"   CREATE_NAME,\r\n" + 
			"   CREATE_DEPT,\r\n" + 
			"   CREATE_TIME,\r\n" + 
			"   UPDATE_NAME,\r\n" + 
			"   UPDATE_TIME,\r\n" + 
			"   DELETE_NAME,\r\n" + 
			"   DELETE_TIME,\r\n" + 
			"   ORD_PK_OLD,\r\n" + 
			"   BE_ORDER_STS_DESC,\r\n" + 
			"   PRICE_NO,\r\n" + 
			"   ORDER_CHGE_NO,\r\n" + 
			"   ISLOCK,\r\n" + 
			"   PRINT_PRICE,\r\n" + 
			"   PRICE_PLAN,\r\n" + 
			"   CONTAIN_TAX,\r\n" + 
			"   ORDER_ARCHIVE,\r\n" + 
			"   PASS_TIME,\r\n" + 
			"   CONFIRM_TIME,\r\n" + 
			"   TRADE_TYPE,\r\n" + 
			"   ORDER_CLASSIFY,\r\n" + 
			"   BUSINESS_TYPE,\r\n" + 
			"   PRINT_TIME,\r\n" + 
			"   PRINT_COUNT,\r\n" + 
			"   LOCAL_LAW,\r\n" + 
			"   ORDER_FILE,\r\n" + 
			"   IPMAC,\r\n" + 
			"   AREA_FLAG,\r\n" + 
			"   USERORDER_FILE,\r\n" + 
			"   DOCUMENTARY_NAME,\r\n" + 
			"   DOCUMENTARY_DEPT,\r\n" + 
			"   TH_EXAMINE_STATUS,\r\n" + 
			"   TH_ORDER_FALG_ZC,\r\n" + 
			"   ORDER_REQUIRE_STATUS,\r\n" + 
			"   PORT_OF_DESTINATION,\r\n" + 
			"   PENALTY_DESC,\r\n" + 
			"   CREATE_NAME_OLD,\r\n" + 
			"   SALE_AREA_NO_OLD,\r\n" + 
			"   SALE_AREA_DESC_OLD)\r\n" + 
			"values\r\n" + 
			"  ('#ORD_PK#',\r\n" + 
			"   '#MANAG_NO#',\r\n" + 
			"   '#ORDER_NO#',\r\n" + 
			"   '#CUSTM_ORDER_NO#',\r\n" + 
			"   '#REVW_RPT_NO#',\r\n" + 
			"   '#ORDER_TYP#',\r\n" + 
			"   '#ORDER_TYP_DESC#',\r\n" + 
			"   '#PROTCL_NO#',\r\n" + 
			"   '#CUSTOMER_NO#',\r\n" + 
			"   '#CUSTOMER_NM#',\r\n" + 
			"   '#MARKET_SYS#',\r\n" + 
			"   '#MARKET_SYS_DESC#',\r\n" + 
			"   '#ABRVITION#',\r\n" + 
			"   '#SUPPLY_UNIT#',\r\n" + 
			"   '#PRICE_FL#',\r\n" + 
			"   '#CURRENCY#',\r\n" + 
			"   '#MNY_ASK_TYP#',\r\n" + 
			"   '#STLMT_UNIT_NO#',\r\n" + 
			"   '#STLMT_UNIT_NM#',\r\n" + 
			"   '#FST_DRAWEE_UNIT#',\r\n" + 
			"   '#LEGAL_PSN#',\r\n" + 
			"   '#AGENT#',\r\n" + 
			"   '#ADDRESS#',\r\n" + 
			"   '#ZIP_CODE#',\r\n" + 
			"   '#BANK#',\r\n" + 
			"   '#ACCOUNT#',\r\n" + 
			"   '#TAX_ID#',\r\n" + 
			"   '#PHONE#',\r\n" + 
			"   '#FAX#',\r\n" + 
			"   '#ORDER_WGT#',\r\n" + 
			"   '#ORDER_MNY_TAX#',\r\n" + 
			"   '#ORDER_MNY_NTAX#',\r\n" + 
			"   '#MNY_ASK_DESC#',\r\n" + 
			"   '#SIGN_PERSON#',\r\n" + 
			"   to_date('#SIGN_DATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#SIGN_ADDRESS#',\r\n" + 
			"   '#ORDER_YEAR#',\r\n" + 
			"   to_date('#ORDER_BDATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   to_date('#ORDER_EDATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#ORDER_SCAN_NO#',\r\n" + 
			"   '#CUSTOMER_MODEL_FL#',\r\n" + 
			"   '#ORDER_MODEL_NO#',\r\n" + 
			"   '#ORDER_MODEL_DESC#',\r\n" + 
			"   '#SALE_ORG#',\r\n" + 
			"   '#SALE_ORG_DESC#',\r\n" + 
			"   '#SALE_AREA_NO#',\r\n" + 
			"   '#SALE_AREA_DESC#',\r\n" + 
			"   '#MEMO#',\r\n" + 
			"   '#BE_ORDER_STS#',\r\n" + 
			"   '#BE_OBJ_STS_OP#',\r\n" + 
			"   '#ORDER_STS#',\r\n" + 
			"   '#ORDER_STS_DESC#',\r\n" + 
			"   '#OBJ_STS_OP#',\r\n" + 
			"   '#APPROVAL_MAN#',\r\n" + 
			"   to_date('#APPROVAL_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#EFFECT_MAN#',\r\n" + 
			"   to_date('#EFFECT_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#CLOSE_MAN#',\r\n" + 
			"   to_date('#CLOSE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#VALIDFLAG#',\r\n" + 
			"   '#CREATE_NAME#',\r\n" + 
			"   '#CREATE_DEPT#',\r\n" + 
			"   to_date('#CREATE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#UPDATE_NAME#',\r\n" + 
			"   to_date('#UPDATE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#DELETE_NAME#',\r\n" + 
			"   to_date('#DELETE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#ORD_PK_OLD#',\r\n" + 
			"   '#BE_ORDER_STS_DESC#',\r\n" + 
			"   '#PRICE_NO#',\r\n" + 
			"   '#ORDER_CHGE_NO#',\r\n" + 
			"   '#ISLOCK#',\r\n" + 
			"   '#PRINT_PRICE#',\r\n" + 
			"   '#PRICE_PLAN#',\r\n" + 
			"   '#CONTAIN_TAX#',\r\n" + 
			"   '#ORDER_ARCHIVE#',\r\n" + 
			"   to_date('#PASS_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   to_date('#CONFIRM_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#TRADE_TYPE#',\r\n" + 
			"   '#ORDER_CLASSIFY#',\r\n" + 
			"   '#BUSINESS_TYPE#',\r\n" + 
			"   to_date('#PRINT_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#PRINT_COUNT#',\r\n" + 
			"   '#LOCAL_LAW#',\r\n" + 
			"   '#ORDER_FILE#',\r\n" + 
			"   '#IPMAC#',\r\n" + 
			"   '#AREA_FLAG#',\r\n" + 
			"   '#USERORDER_FILE#',\r\n" + 
			"   '#DOCUMENTARY_NAME#',\r\n" + 
			"   '#DOCUMENTARY_DEPT#',\r\n" + 
			"   '#TH_EXAMINE_STATUS#',\r\n" + 
			"   '#TH_ORDER_FALG_ZC#',\r\n" + 
			"   '#ORDER_REQUIRE_STATUS#',\r\n" + 
			"   '#PORT_OF_DESTINATION#',\r\n" + 
			"   '#PENALTY_DESC#',\r\n" + 
			"   '#CREATE_NAME_OLD#',\r\n" + 
			"   '#SALE_AREA_NO_OLD#',\r\n" + 
			"   '#SALE_AREA_DESC_OLD#')\r\n" + 
			"";
	/**
	 * 修改合同头信息
	 */
	public static String UpdateOrderHead = "update slm_order_head\r\n" +
			"   set MANAG_NO             = '#MANAG_NO#',\r\n" + 
			"       CUSTM_ORDER_NO       = '#CUSTM_ORDER_NO#',\r\n" + 
			"       REVW_RPT_NO          = '#REVW_RPT_NO#',\r\n" + 
			"       ORDER_TYP            = '#ORDER_TYP#',\r\n" + 
			"       ORDER_TYP_DESC       = '#ORDER_TYP_DESC#',\r\n" + 
			"       PROTCL_NO            = '#PROTCL_NO#',\r\n" + 
			"       CUSTOMER_NO          = '#CUSTOMER_NO#',\r\n" + 
			"       CUSTOMER_NM          = '#CUSTOMER_NM#',\r\n" + 
			"       MARKET_SYS           = '#MARKET_SYS#',\r\n" + 
			"       MARKET_SYS_DESC      = '#MARKET_SYS_DESC#',\r\n" + 
			"       ABRVITION            = '#ABRVITION#',\r\n" + 
			"       SUPPLY_UNIT          = '#SUPPLY_UNIT#',\r\n" + 
			"       PRICE_FL             = '#PRICE_FL#',\r\n" + 
			"       CURRENCY             = '#CURRENCY#',\r\n" + 
			"       MNY_ASK_TYP          = '#MNY_ASK_TYP#',\r\n" + 
			"       STLMT_UNIT_NO        = '#STLMT_UNIT_NO#',\r\n" + 
			"       STLMT_UNIT_NM        = '#STLMT_UNIT_NM#',\r\n" + 
			"       FST_DRAWEE_UNIT      = '#FST_DRAWEE_UNIT#',\r\n" + 
			"       LEGAL_PSN            = '#LEGAL_PSN#',\r\n" + 
			"       AGENT                = '#AGENT#',\r\n" + 
			"       ADDRESS              = '#ADDRESS#',\r\n" + 
			"       ZIP_CODE             = '#ZIP_CODE#',\r\n" + 
			"       BANK                 = '#BANK#',\r\n" + 
			"       ACCOUNT              = '#ACCOUNT#',\r\n" + 
			"       TAX_ID               = '#TAX_ID#',\r\n" + 
			"       PHONE                = '#PHONE#',\r\n" + 
			"       FAX                  = '#FAX#',\r\n" + 
			"       ORDER_WGT            = '#ORDER_WGT#',\r\n" + 
			"       ORDER_MNY_TAX        = '#ORDER_MNY_TAX#',\r\n" + 
			"       ORDER_MNY_NTAX       = '#ORDER_MNY_NTAX#',\r\n" + 
			"       MNY_ASK_DESC         = '#MNY_ASK_DESC#',\r\n" + 
			"       SIGN_PERSON          = '#SIGN_PERSON#',\r\n" + 
			"       SIGN_DATE            = '#SIGN_DATE#',\r\n" + 
			"       SIGN_ADDRESS         = '#SIGN_ADDRESS#',\r\n" + 
			"       ORDER_YEAR           = '#ORDER_YEAR#',\r\n" + 
			"       ORDER_BDATE          = '#ORDER_BDATE#',\r\n" + 
			"       ORDER_EDATE          = '#ORDER_EDATE#',\r\n" + 
			"       ORDER_SCAN_NO        = '#ORDER_SCAN_NO#',\r\n" + 
			"       CUSTOMER_MODEL_FL    = '#CUSTOMER_MODEL_FL#',\r\n" + 
			"       ORDER_MODEL_NO       = '#ORDER_MODEL_NO#',\r\n" + 
			"       ORDER_MODEL_DESC     = '#ORDER_MODEL_DESC#',\r\n" + 
			"       SALE_ORG             = '#SALE_ORG#',\r\n" + 
			"       SALE_ORG_DESC        = '#SALE_ORG_DESC#',\r\n" + 
			"       SALE_AREA_NO         = '#SALE_AREA_NO#',\r\n" + 
			"       SALE_AREA_DESC       = '#SALE_AREA_DESC#',\r\n" + 
			"       MEMO                 = '#MEMO#',\r\n" + 
			"       BE_ORDER_STS         = '#BE_ORDER_STS#',\r\n" + 
			"       BE_OBJ_STS_OP        = '#BE_OBJ_STS_OP#',\r\n" + 
			"       ORDER_STS            = '#ORDER_STS#',\r\n" + 
			"       ORDER_STS_DESC       = '#ORDER_STS_DESC#',\r\n" + 
			"       OBJ_STS_OP           = '#OBJ_STS_OP#',\r\n" + 
			"       APPROVAL_MAN         = '#APPROVAL_MAN#',\r\n" + 
			"       APPROVAL_TIME        = '#APPROVAL_TIME#',\r\n" + 
			"       EFFECT_MAN           = '#EFFECT_MAN#',\r\n" + 
			"       EFFECT_TIME          = '#EFFECT_TIME#',\r\n" + 
			"       CLOSE_MAN            = '#CLOSE_MAN#',\r\n" + 
			"       CLOSE_TIME           = '#CLOSE_TIME#',\r\n" + 
			"       VALIDFLAG            = '#VALIDFLAG#',\r\n" + 
			"       CREATE_NAME          = '#CREATE_NAME#',\r\n" + 
			"       CREATE_DEPT          = '#CREATE_DEPT#',\r\n" + 
			"       CREATE_TIME          = '#CREATE_TIME#',\r\n" + 
			"       UPDATE_NAME          = '#UPDATE_NAME#',\r\n" + 
			"       UPDATE_TIME          = '#UPDATE_TIME#',\r\n" + 
			"       DELETE_NAME          = '#DELETE_NAME#',\r\n" + 
			"       DELETE_TIME          = '#DELETE_TIME#',\r\n" + 
			"       ORD_PK_OLD           = '#ORD_PK_OLD#',\r\n" + 
			"       BE_ORDER_STS_DESC    = '#BE_ORDER_STS_DESC#',\r\n" + 
			"       PRICE_NO             = '#PRICE_NO#',\r\n" + 
			"       ORDER_CHGE_NO        = '#ORDER_CHGE_NO#',\r\n" + 
			"       ISLOCK               = '#ISLOCK#',\r\n" + 
			"       PRINT_PRICE          = '#PRINT_PRICE#',\r\n" + 
			"       PRICE_PLAN           = '#PRICE_PLAN#',\r\n" + 
			"       CONTAIN_TAX          = '#CONTAIN_TAX#',\r\n" + 
			"       ORDER_ARCHIVE        = '#ORDER_ARCHIVE#',\r\n" + 
			"       PASS_TIME            = '#PASS_TIME#',\r\n" + 
			"       CONFIRM_TIME         = '#CONFIRM_TIME#',\r\n" + 
			"       TRADE_TYPE           = '#TRADE_TYPE#',\r\n" + 
			"       ORDER_CLASSIFY       = '#ORDER_CLASSIFY#',\r\n" + 
			"       BUSINESS_TYPE        = '#BUSINESS_TYPE#',\r\n" + 
			"       PRINT_TIME           = '#PRINT_TIME#',\r\n" + 
			"       PRINT_COUNT          = '#PRINT_COUNT#',\r\n" + 
			"       LOCAL_LAW            = '#LOCAL_LAW#',\r\n" + 
			"       ORDER_FILE           = '#ORDER_FILE#',\r\n" + 
			"       IPMAC                = '#IPMAC#',\r\n" + 
			"       AREA_FLAG            = '#AREA_FLAG#',\r\n" + 
			"       USERORDER_FILE       = '#USERORDER_FILE#',\r\n" + 
			"       DOCUMENTARY_NAME     = '#DOCUMENTARY_NAME#',\r\n" + 
			"       DOCUMENTARY_DEPT     = '#DOCUMENTARY_DEPT#',\r\n" + 
			"       TH_EXAMINE_STATUS    = '#TH_EXAMINE_STATUS#',\r\n" + 
			"       TH_ORDER_FALG_ZC     = '#TH_ORDER_FALG_ZC#',\r\n" + 
			"       ORDER_REQUIRE_STATUS = '#ORDER_REQUIRE_STATUS#',\r\n" + 
			"       PORT_OF_DESTINATION  = '#PORT_OF_DESTINATION#',\r\n" + 
			"       PENALTY_DESC         = '#PENALTY_DESC#',\r\n" + 
			"       CREATE_NAME_OLD      = '#CREATE_NAME_OLD#',\r\n" + 
			"       SALE_AREA_NO_OLD     = '#SALE_AREA_NO_OLD#',\r\n" + 
			"       SALE_AREA_DESC_OLD   = '#SALE_AREA_DESC_OLD#'\r\n" + 
			" where ORD_PK = '#ORD_PK#'" ;
	
	/**
	 * 新增合同行
	 */
	public static String InsertOrderLine = "insert into slm_order_line\r\n" +
			"  (ORD_PK,\r\n" + 
			"   ORD_LN_PK,\r\n" + 
			"   ORDER_SEQ,\r\n" + 
			"   CUST_ALPHA_NO,\r\n" + 
			"   PSC,\r\n" + 
			"   PSC_DESC,\r\n" + 
			"   MSC,\r\n" + 
			"   MSC_DESC,\r\n" + 
			"   MSC_STYLE,\r\n" + 
			"   USE_CODE,\r\n" + 
			"   USE_DESC,\r\n" + 
			"   PRD_CLS,\r\n" + 
			"   PRODUCCODE,\r\n" + 
			"   PRODUCNAME,\r\n" + 
			"   STD_CODE,\r\n" + 
			"   STD_NAME,\r\n" + 
			"   STEELCODE,\r\n" + 
			"   STEELNAME,\r\n" + 
			"   STD_STYLE,\r\n" + 
			"   STD_STYLE_DESC,\r\n" + 
			"   ORDER_SPEC_CODE,\r\n" + 
			"   ORDER_SPEC_DESC,\r\n" + 
			"   SPEC_CODE,\r\n" + 
			"   SPEC_NAME,\r\n" + 
			"   DIMATER,\r\n" + 
			"   HEIGHT,\r\n" + 
			"   MODEL_CODE,\r\n" + 
			"   MODEL_DESC,\r\n" + 
			"   LEN_NO,\r\n" + 
			"   LEN_DESC,\r\n" + 
			"   LEN_UNIT,\r\n" + 
			"   LEN_MIN,\r\n" + 
			"   LEN_MAX,\r\n" + 
			"   SHRT_LEN_RATO,\r\n" + 
			"   SHORTEST,\r\n" + 
			"   LONG_LEN_RATO,\r\n" + 
			"   LONGEST,\r\n" + 
			"   SHRT_STOVE,\r\n" + 
			"   AVG_LEN_MIN,\r\n" + 
			"   DIFRNC_LEN_MAX,\r\n" + 
			"   ENDLEN_SPECSTD,\r\n" + 
			"   SIGL_LEN,\r\n" + 
			"   ORDER_UNIT,\r\n" + 
			"   ORDER_QTY,\r\n" + 
			"   ORD_ENSU_TOTL_LEN,\r\n" + 
			"   PRDCT_WGT,\r\n" + 
			"   DELVRY_RANGE_TPE,\r\n" + 
			"   DELVRY_RANGE_MIN,\r\n" + 
			"   DELVRY_RANGE_MAX,\r\n" + 
			"   FINAL_USER,\r\n" + 
			"   FINAL_USER_DESC,\r\n" + 
			"   OUTS_BILLET_FL,\r\n" + 
			"   OUTS_STL_PIPE_FL,\r\n" + 
			"   ASSEL_FL,\r\n" + 
			"   PRODUCER_FL,\r\n" + 
			"   PRDCR_NO,\r\n" + 
			"   PRDCR_DESC,\r\n" + 
			"   MPS_FL,\r\n" + 
			"   MPS_NO,\r\n" + 
			"   MPS_DESC,\r\n" + 
			"   DELVRY_BDATE,\r\n" + 
			"   DELVRY_EDATE,\r\n" + 
			"   DELVRY_DESC,\r\n" + 
			"   TRANS_DESC,\r\n" + 
			"   ADD_ASK_NO,\r\n" + 
			"   ORDER_ADD_DESC,\r\n" + 
			"   ORDER_SPECIAL_FL,\r\n" + 
			"   ORDER_SPECIAL_HEAD,\r\n" + 
			"   ORDER_SPECIAL_PATH,\r\n" + 
			"   ORDER_SPECIAL_DESC,\r\n" + 
			"   ZBS,\r\n" + 
			"   ORDER_PRICE,\r\n" + 
			"   TRANS_PRICE,\r\n" + 
			"   TEST_ID,\r\n" + 
			"   TEST_PRICE,\r\n" + 
			"   OUT_PRICE,\r\n" + 
			"   BALNCE_PRICE,\r\n" + 
			"   BE_ORDER_LN_STATUS,\r\n" + 
			"   BE_OBJ_STS_OP,\r\n" + 
			"   ORDER_LN_STATUS,\r\n" + 
			"   OBJ_STS_OP,\r\n" + 
			"   MEMO,\r\n" + 
			"   VALIDFLAG,\r\n" + 
			"   CREATE_NAME,\r\n" + 
			"   CREATE_TIME,\r\n" + 
			"   UPDATE_NAME,\r\n" + 
			"   UPDATE_TIME,\r\n" + 
			"   DELETE_NAME,\r\n" + 
			"   DELETE_TIME,\r\n" + 
			"   ORD_LN_PK_OLD,\r\n" + 
			"   ISLOCK,\r\n" + 
			"   CUST_ALPHA_NO2,\r\n" + 
			"   ORDER_CHGE_NO,\r\n" + 
			"   CHGE_ORD_LN_PK,\r\n" + 
			"   BALNCE_PRICE_STS,\r\n" + 
			"   BALNCE_PRICE_ORG,\r\n" + 
			"   BALNCE_PRICE_ORG_STS,\r\n" + 
			"   PAK_PRICE,\r\n" + 
			"   AW,\r\n" + 
			"   MPS_NO_INPUT,\r\n" + 
			"   MAN_INSPECTION,\r\n" + 
			"   INSPECTION_VALUE,\r\n" + 
			"   MPS_NO_FILE,\r\n" + 
			"   QUALITY_USER,\r\n" + 
			"   QUALITY_USER_DESC,\r\n" + 
			"   OUTPUT_STD_NO,\r\n" + 
			"   PROJECT_NO,\r\n" + 
			"   CRAFT_NO,\r\n" + 
			"   CRAFT_NO_V,\r\n" + 
			"   ORDER_COUNT,\r\n" + 
			"   MPS_ID,\r\n" + 
			"   LOGOUT_REVIEW_NO,\r\n" + 
			"   PIC_FD_CHECK,\r\n" + 
			"   BALNCE_PRICE_UNIT,\r\n" + 
			"   TON_PRICE,\r\n" + 
			"   KEEP_TYPE,\r\n" + 
			"   ORDER_SPECIAL_DESC_C,\r\n" + 
			"   AVG_LEN_MAX,\r\n" + 
			"   WBS_CODE,\r\n" + 
			"   OUTBOUND_CALCULATE,\r\n" + 
			"   ORDER_TEAM,\r\n" + 
			"   REVIEW_ASK_END,\r\n" + 
			"   JHSTATE,\r\n" + 
			"   PROD_CODE_NEW,\r\n" + 
			"   PROD_NAME_NEW,\r\n" +
			"   MODE_OF_TRANSPORT)\r\n" + 
			"values\r\n" + 
			"  ('#ORD_PK#',\r\n" + 
			"   '#ORD_LN_PK#',\r\n" + 
			"   '#ORDER_SEQ#',\r\n" + 
			"   '#CUST_ALPHA_NO#',\r\n" + 
			"   '#PSC#',\r\n" + 
			"   '#PSC_DESC#',\r\n" + 
			"   '#MSC#',\r\n" + 
			"   '#MSC_DESC#',\r\n" + 
			"   '#MSC_STYLE#',\r\n" + 
			"   '#USE_CODE#',\r\n" + 
			"   '#USE_DESC#',\r\n" + 
			"   '#PRD_CLS#',\r\n" + 
			"   '#PRODUCCODE#',\r\n" + 
			"   '#PRODUCNAME#',\r\n" + 
			"   '#STD_CODE#',\r\n" + 
			"   '#STD_NAME#',\r\n" + 
			"   '#STEELCODE#',\r\n" + 
			"   '#STEELNAME#',\r\n" + 
			"   '#STD_STYLE#',\r\n" + 
			"   '#STD_STYLE_DESC#',\r\n" + 
			"   '#ORDER_SPEC_CODE#',\r\n" + 
			"   '#ORDER_SPEC_DESC#',\r\n" + 
			"   '#SPEC_CODE#',\r\n" + 
			"   '#SPEC_NAME#',\r\n" + 
			"   '#DIMATER#',\r\n" + 
			"   '#HEIGHT#',\r\n" + 
			"   '#MODEL_CODE#',\r\n" + 
			"   '#MODEL_DESC#',\r\n" + 
			"   '#LEN_NO#',\r\n" + 
			"   '#LEN_DESC#',\r\n" + 
			"   '#LEN_UNIT#',\r\n" + 
			"   '#LEN_MIN#',\r\n" + 
			"   '#LEN_MAX#',\r\n" + 
			"   '#SHRT_LEN_RATO#',\r\n" + 
			"   '#SHORTEST#',\r\n" + 
			"   '#LONG_LEN_RATO#',\r\n" + 
			"   '#LONGEST#',\r\n" + 
			"   '#SHRT_STOVE#',\r\n" + 
			"   '#AVG_LEN_MIN#',\r\n" + 
			"   '#DIFRNC_LEN_MAX#',\r\n" + 
			"   '#ENDLEN_SPECSTD#',\r\n" + 
			"   '#SIGL_LEN#',\r\n" + 
			"   '#ORDER_UNIT#',\r\n" + 
			"   '#ORDER_QTY#',\r\n" + 
			"   '#ORD_ENSU_TOTL_LEN#',\r\n" + 
			"   '#PRDCT_WGT#',\r\n" + 
			"   '#DELVRY_RANGE_TPE#',\r\n" + 
			"   '#DELVRY_RANGE_MIN#',\r\n" + 
			"   '#DELVRY_RANGE_MAX#',\r\n" + 
			"   '#FINAL_USER#',\r\n" + 
			"   '#FINAL_USER_DESC#',\r\n" + 
			"   '#OUTS_BILLET_FL#',\r\n" + 
			"   '#OUTS_STL_PIPE_FL#',\r\n" + 
			"   '#ASSEL_FL#',\r\n" + 
			"   '#PRODUCER_FL#',\r\n" + 
			"   '#PRDCR_NO#',\r\n" + 
			"   '#PRDCR_DESC#',\r\n" + 
			"   '#MPS_FL#',\r\n" + 
			"   '#MPS_NO#',\r\n" + 
			"   '#MPS_DESC#',\r\n" + 
			"   to_date('#DELVRY_BDATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   to_date('#DELVRY_EDATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#DELVRY_DESC#',\r\n" + 
			"   '#TRANS_DESC#',\r\n" + 
			"   '#ADD_ASK_NO#',\r\n" + 
			"   '#ORDER_ADD_DESC#',\r\n" + 
			"   '#ORDER_SPECIAL_FL#',\r\n" + 
			"   '#ORDER_SPECIAL_HEAD#',\r\n" + 
			"   '#ORDER_SPECIAL_PATH#',\r\n" + 
			"   '#ORDER_SPECIAL_DESC#',\r\n" + 
			"   '#ZBS#',\r\n" + 
			"   '#ORDER_PRICE#',\r\n" + 
			"   '#TRANS_PRICE#',\r\n" + 
			"   '#TEST_ID#',\r\n" + 
			"   '#TEST_PRICE#',\r\n" + 
			"   '#OUT_PRICE#',\r\n" + 
			"   '#BALNCE_PRICE#',\r\n" + 
			"   '#BE_ORDER_LN_STATUS#',\r\n" + 
			"   '#BE_OBJ_STS_OP#',\r\n" + 
			"   '#ORDER_LN_STATUS#',\r\n" + 
			"   '#OBJ_STS_OP#',\r\n" + 
			"   '#MEMO#',\r\n" + 
			"   '#VALIDFLAG#',\r\n" + 
			"   '#CREATE_NAME#',\r\n" + 
			"   to_date('#CREATE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#UPDATE_NAME#',\r\n" + 
			"   to_date('#UPDATE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#DELETE_NAME#',\r\n" + 
			"   to_date('#DELETE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#ORD_LN_PK_OLD#',\r\n" + 
			"   '#ISLOCK#',\r\n" + 
			"   '#CUST_ALPHA_NO2#',\r\n" + 
			"   '#ORDER_CHGE_NO#',\r\n" + 
			"   '#CHGE_ORD_LN_PK#',\r\n" + 
			"   '#BALNCE_PRICE_STS#',\r\n" + 
			"   '#BALNCE_PRICE_ORG#',\r\n" + 
			"   '#BALNCE_PRICE_ORG_STS#',\r\n" + 
			"   '#PAK_PRICE#',\r\n" + 
			"   '#AW#',\r\n" + 
			"   '#MPS_NO_INPUT#',\r\n" + 
			"   '#MAN_INSPECTION#',\r\n" + 
			"   '#INSPECTION_VALUE#',\r\n" + 
			"   '#MPS_NO_FILE#',\r\n" + 
			"   '#QUALITY_USER#',\r\n" + 
			"   '#QUALITY_USER_DESC#',\r\n" + 
			"   '#OUTPUT_STD_NO#',\r\n" + 
			"   '#PROJECT_NO#',\r\n" + 
			"   '#CRAFT_NO#',\r\n" + 
			"   '#CRAFT_NO_V#',\r\n" + 
			"   '#ORDER_COUNT#',\r\n" + 
			"   '#MPS_ID#',\r\n" + 
			"   '#LOGOUT_REVIEW_NO#',\r\n" + 
			"   '#PIC_FD_CHECK#',\r\n" + 
			"   '#BALNCE_PRICE_UNIT#',\r\n" + 
			"   '#TON_PRICE#',\r\n" + 
			"   '#KEEP_TYPE#',\r\n" + 
			"   '#ORDER_SPECIAL_DESC_C#',\r\n" + 
			"   '#AVG_LEN_MAX#',\r\n" + 
			"   '#WBS_CODE#',\r\n" + 
			"   '#OUTBOUND_CALCULATE#',\r\n" + 
			"   '#ORDER_TEAM#',\r\n" + 
			"   '#REVIEW_ASK_END#',\r\n" + 
			"   '#JHSTATE#',\r\n" + 
			"   '#PROD_CODE_NEW#',\r\n" + 
			"   '#PROD_NAME_NEW#',\r\n" + 
			"   '#MODE_OF_TRANSPORT#')\r\n" + 
			"";
	/**
	 * 修改合同行
	 */
	public static String UpdateOrderLine = "update slm_order_line\r\n" +
			"   set ORD_PK               = '#ORD_PK#',\r\n" + 
			"       ORD_LN_PK            = '#ORD_LN_PK#',\r\n" + 
			"       ORDER_SEQ            = '#ORDER_SEQ#',\r\n" + 
			"       CUST_ALPHA_NO        = '#CUST_ALPHA_NO#',\r\n" + 
			"       PSC                  = '#PSC#',\r\n" + 
			"       PSC_DESC             = '#PSC_DESC#',\r\n" + 
			"       MSC                  = '#MSC#',\r\n" + 
			"       MSC_DESC             = '#MSC_DESC#',\r\n" + 
			"       MSC_STYLE            = '#MSC_STYLE#',\r\n" + 
			"       USE_CODE             = '#USE_CODE#',\r\n" + 
			"       USE_DESC             = '#USE_DESC#',\r\n" + 
			"       PRD_CLS              = '#PRD_CLS#',\r\n" + 
			"       PRODUCCODE           = '#PRODUCCODE#',\r\n" + 
			"       PRODUCNAME           = '#PRODUCNAME#',\r\n" + 
			"       STD_CODE             = '#STD_CODE#',\r\n" + 
			"       STD_NAME             = '#STD_NAME#',\r\n" + 
			"       STEELCODE            = '#STEELCODE#',\r\n" + 
			"       STEELNAME            = '#STEELNAME#',\r\n" + 
			"       STD_STYLE            = '#STD_STYLE#',\r\n" + 
			"       STD_STYLE_DESC       = '#STD_STYLE_DESC#',\r\n" + 
			"       ORDER_SPEC_CODE      = '#ORDER_SPEC_CODE#',\r\n" + 
			"       ORDER_SPEC_DESC      = '#ORDER_SPEC_DESC#',\r\n" + 
			"       SPEC_CODE            = '#SPEC_CODE#',\r\n" + 
			"       SPEC_NAME            = '#SPEC_NAME#',\r\n" + 
			"       DIMATER              = '#DIMATER#',\r\n" + 
			"       HEIGHT               = '#HEIGHT#',\r\n" + 
			"       MODEL_CODE           = '#MODEL_CODE#',\r\n" + 
			"       MODEL_DESC           = '#MODEL_DESC#',\r\n" + 
			"       LEN_NO               = '#LEN_NO#',\r\n" + 
			"       LEN_DESC             = '#LEN_DESC#',\r\n" + 
			"       LEN_UNIT             = '#LEN_UNIT#',\r\n" + 
			"       LEN_MIN              = '#LEN_MIN#',\r\n" + 
			"       LEN_MAX              = '#LEN_MAX#',\r\n" + 
			"       SHRT_LEN_RATO        = '#SHRT_LEN_RATO#',\r\n" + 
			"       SHORTEST             = '#SHORTEST#',\r\n" + 
			"       LONG_LEN_RATO        = '#LONG_LEN_RATO#',\r\n" + 
			"       LONGEST              = '#LONGEST#',\r\n" + 
			"       SHRT_STOVE           = '#SHRT_STOVE#',\r\n" + 
			"       AVG_LEN_MIN          = '#AVG_LEN_MIN#',\r\n" + 
			"       DIFRNC_LEN_MAX       = '#DIFRNC_LEN_MAX#',\r\n" + 
			"       ENDLEN_SPECSTD       = '#ENDLEN_SPECSTD#',\r\n" + 
			"       SIGL_LEN             = '#SIGL_LEN#',\r\n" + 
			"       ORDER_UNIT           = '#ORDER_UNIT#',\r\n" + 
			"       ORDER_QTY            = '#ORDER_QTY#',\r\n" + 
			"       ORD_ENSU_TOTL_LEN    = '#ORD_ENSU_TOTL_LEN#',\r\n" + 
			"       PRDCT_WGT            = '#PRDCT_WGT#',\r\n" + 
			"       DELVRY_RANGE_TPE     = '#DELVRY_RANGE_TPE#',\r\n" + 
			"       DELVRY_RANGE_MIN     = '#DELVRY_RANGE_MIN#',\r\n" + 
			"       DELVRY_RANGE_MAX     = '#DELVRY_RANGE_MAX#',\r\n" + 
			"       FINAL_USER           = '#FINAL_USER#',\r\n" + 
			"       FINAL_USER_DESC      = '#FINAL_USER_DESC#',\r\n" + 
			"       OUTS_BILLET_FL       = '#OUTS_BILLET_FL#',\r\n" + 
			"       OUTS_STL_PIPE_FL     = '#OUTS_STL_PIPE_FL#',\r\n" + 
			"       ASSEL_FL             = '#ASSEL_FL#',\r\n" + 
			"       PRODUCER_FL          = '#PRODUCER_FL#',\r\n" + 
			"       PRDCR_NO             = '#PRDCR_NO#',\r\n" + 
			"       PRDCR_DESC           = '#PRDCR_DESC#',\r\n" + 
			"       MPS_FL               = '#MPS_FL#',\r\n" + 
			"       MPS_NO               = '#MPS_NO#',\r\n" + 
			"       MPS_DESC             = '#MPS_DESC#',\r\n" + 
			"       DELVRY_BDATE         = '#DELVRY_BDATE#',\r\n" + 
			"       DELVRY_EDATE         = '#DELVRY_EDATE#',\r\n" + 
			"       DELVRY_DESC          = '#DELVRY_DESC#',\r\n" + 
			"       TRANS_DESC           = '#TRANS_DESC#',\r\n" + 
			"       ADD_ASK_NO           = '#ADD_ASK_NO#',\r\n" + 
			"       ORDER_ADD_DESC       = '#ORDER_ADD_DESC#',\r\n" + 
			"       ORDER_SPECIAL_FL     = '#ORDER_SPECIAL_FL#',\r\n" + 
			"       ORDER_SPECIAL_HEAD   = '#ORDER_SPECIAL_HEAD#',\r\n" + 
			"       ORDER_SPECIAL_PATH   = '#ORDER_SPECIAL_PATH#',\r\n" + 
			"       ORDER_SPECIAL_DESC   = '#ORDER_SPECIAL_DESC#',\r\n" + 
			"       ZBS                  = '#ZBS#',\r\n" + 
			"       ORDER_PRICE          = '#ORDER_PRICE#',\r\n" + 
			"       TRANS_PRICE          = '#TRANS_PRICE#',\r\n" + 
			"       TEST_ID              = '#TEST_ID#',\r\n" + 
			"       TEST_PRICE           = '#TEST_PRICE#',\r\n" + 
			"       OUT_PRICE            = '#OUT_PRICE#',\r\n" + 
			"       BALNCE_PRICE         = '#BALNCE_PRICE#',\r\n" + 
			"       BE_ORDER_LN_STATUS   = '#BE_ORDER_LN_STATUS#',\r\n" + 
			"       BE_OBJ_STS_OP        = '#BE_OBJ_STS_OP#',\r\n" + 
			"       ORDER_LN_STATUS      = '#ORDER_LN_STATUS#',\r\n" + 
			"       OBJ_STS_OP           = '#OBJ_STS_OP#',\r\n" + 
			"       MEMO                 = '#MEMO#',\r\n" + 
			"       VALIDFLAG            = '#VALIDFLAG#',\r\n" + 
			"       CREATE_NAME          = '#CREATE_NAME#',\r\n" + 
			"       CREATE_TIME          = '#CREATE_TIME#',\r\n" + 
			"       UPDATE_NAME          = '#UPDATE_NAME#',\r\n" + 
			"       UPDATE_TIME          = '#UPDATE_TIME#',\r\n" + 
			"       DELETE_NAME          = '#DELETE_NAME#',\r\n" + 
			"       DELETE_TIME          = '#DELETE_TIME#',\r\n" + 
			"       ORD_LN_PK_OLD        = '#ORD_LN_PK_OLD#',\r\n" + 
			"       ISLOCK               = '#ISLOCK#',\r\n" + 
			"       CUST_ALPHA_NO2       = '#CUST_ALPHA_NO2#',\r\n" + 
			"       ORDER_CHGE_NO        = '#ORDER_CHGE_NO#',\r\n" + 
			"       CHGE_ORD_LN_PK       = '#CHGE_ORD_LN_PK#',\r\n" + 
			"       BALNCE_PRICE_STS     = '#BALNCE_PRICE_STS#',\r\n" + 
			"       BALNCE_PRICE_ORG     = '#BALNCE_PRICE_ORG#',\r\n" + 
			"       BALNCE_PRICE_ORG_STS = '#BALNCE_PRICE_ORG_STS#',\r\n" + 
			"       PAK_PRICE            = '#PAK_PRICE#',\r\n" + 
			"       AW                   = '#AW#',\r\n" + 
			"       MPS_NO_INPUT         = '#MPS_NO_INPUT#',\r\n" + 
			"       MAN_INSPECTION       = '#MAN_INSPECTION#',\r\n" + 
			"       INSPECTION_VALUE     = '#INSPECTION_VALUE#',\r\n" + 
			"       MPS_NO_FILE          = '#MPS_NO_FILE#',\r\n" + 
			"       QUALITY_USER         = '#QUALITY_USER#',\r\n" + 
			"       QUALITY_USER_DESC    = '#QUALITY_USER_DESC#',\r\n" + 
			"       OUTPUT_STD_NO        = '#OUTPUT_STD_NO#',\r\n" + 
			"       PROJECT_NO           = '#PROJECT_NO#',\r\n" + 
			"       CRAFT_NO             = '#CRAFT_NO#',\r\n" + 
			"       CRAFT_NO_V           = '#CRAFT_NO_V#',\r\n" + 
			"       ORDER_COUNT          = '#ORDER_COUNT#',\r\n" + 
			"       MPS_ID               = '#MPS_ID#',\r\n" + 
			"       LOGOUT_REVIEW_NO     = '#LOGOUT_REVIEW_NO#',\r\n" + 
			"       PIC_FD_CHECK         = '#PIC_FD_CHECK#',\r\n" + 
			"       BALNCE_PRICE_UNIT    = '#BALNCE_PRICE_UNIT#',\r\n" + 
			"       TON_PRICE            = '#TON_PRICE#',\r\n" + 
			"       KEEP_TYPE            = '#KEEP_TYPE#',\r\n" + 
			"       ORDER_SPECIAL_DESC_C = '#ORDER_SPECIAL_DESC_C#',\r\n" + 
			"       AVG_LEN_MAX          = '#AVG_LEN_MAX#',\r\n" + 
			"       WBS_CODE             = '#WBS_CODE#',\r\n" + 
			"       OUTBOUND_CALCULATE   = '#OUTBOUND_CALCULATE#',\r\n" + 
			"       ORDER_TEAM           = '#ORDER_TEAM#',\r\n" + 
			"       MODE_OF_TRANSPORT    = '#MODE_OF_TRANSPORT#'\r\n" + 
			" where ORD_PK = '#ORD_PK#'\r\n" + 
			"   AND ORD_LN_PK = '#ORD_LN_PK#'\r\n" + 
			"   AND ORDER_SEQ = '#ORDER_SEQ#'\r\n" + 
			"";
	/**
	 * 修改交货行
	 */
	public static String UpdateOderDelivery ="update slm_order_line_delivery\r\n" +
			"      set\r\n" + 
			"    DELIVERY_NO ='#DELIVERY_NO#',\r\n" + 
			"    DELVRY_BDATE ='#DELVRY_BDATE#',\r\n" + 
			"    DELVRY_EDATE ='#DELVRY_EDATE#',\r\n" + 
			"    DELVRY_QTY ='#DELVRY_QTY#',\r\n" + 
			"    ORDER_UNIT ='#ORDER_UNIT#',\r\n" + 
			"    WGT_ESTMT ='#WGT_ESTMT#',\r\n" + 
			"    ENSU_TOTL_LEN ='#ENSU_TOTL_LEN#',\r\n" + 
			"    RECEIV_NO ='#RECEIV_NO#',\r\n" + 
			"    RECEIV_NM ='#RECEIV_NM#',\r\n" + 
			"    DELVRY_ADDR ='#DELVRY_ADDR#',\r\n" + 
			"    AGENCY_FL ='#AGENCY_FL#',\r\n" + 
			"    RECEIV_ADDR ='#RECEIV_ADDR#',\r\n" + 
			"    TRANSIT_TYP ='#TRANSIT_TYP#',\r\n" + 
			"    TRANSIT_PLAN ='#TRANSIT_PLAN#',\r\n" + 
			"    TRANSIT_MNY ='#TRANSIT_MNY#',\r\n" + 
			"    BE_DELIVERY_STATUS ='#BE_DELIVERY_STATUS#',\r\n" + 
			"    BE_OBJ_STS_OP ='#BE_OBJ_STS_OP#',\r\n" + 
			"    DELIVERY_STATUS ='#DELIVERY_STATUS#',\r\n" + 
			"    OBJ_STS_OP ='#OBJ_STS_OP#',\r\n" + 
			"    VALIDFLAG ='#VALIDFLAG#',\r\n" + 
			"    CREATE_NAME ='#CREATE_NAME#',\r\n" + 
			"    CREATE_TIME ='#CREATE_TIME#',\r\n" + 
			"    UPDATE_NAME ='#UPDATE_NAME#',\r\n" + 
			"    UPDATE_TIME ='#UPDATE_TIME#',\r\n" + 
			"    DELETE_NAME ='#DELETE_NAME#',\r\n" + 
			"    DELETE_TIME ='#DELETE_TIME#',\r\n" + 
			"    ISLOCK ='#ISLOCK#',\r\n" + 
			"    PICKUP_FLAG ='#PICKUP_FLAG#',\r\n" + 
			"    EXTRA_FLAG ='#EXTRA_FLAG#',\r\n" + 
			"    IS_ADD ='#IS_ADD#',\r\n" + 
			"    IS_LIKU ='#IS_LIKU#',\r\n" + 
			"    NLK_RSN ='#NLK_RSN#',\r\n" + 
			"    NLK_CHECK ='#NLK_CHECK#',\r\n" + 
			"    LK_ID ='#LK_ID#',\r\n" + 
			"    TD_ID ='#TD_ID#',\r\n" + 
			"    PRESENT_STATUS ='#PRESENT_STATUS#'\r\n" + 
			"\r\n" + 
			" where ORD_PK ='#ORD_PK#'\r\n" + 
			"    AND ORD_LN_PK ='#ORD_LN_PK#',\r\n" + 
			"    AND  ORD_LN_DLY_PK ='#ORD_LN_DLY_PK#'\r\n" + 
			"";
	/**
	 * 新增交货行
	 */
	public static String InsertOderDelivery = "insert into slm_order_line_delivery\r\n" +
			"  (ORD_PK,\r\n" + 
			"   ORD_LN_PK,\r\n" + 
			"   ORD_LN_DLY_PK,\r\n" + 
			"   DELIVERY_NO,\r\n" + 
			"   DELVRY_BDATE,\r\n" + 
			"   DELVRY_EDATE,\r\n" + 
			"   DELVRY_QTY,\r\n" + 
			"   ORDER_UNIT,\r\n" + 
			"   WGT_ESTMT,\r\n" + 
			"   ENSU_TOTL_LEN,\r\n" + 
			"   RECEIV_NO,\r\n" + 
			"   RECEIV_NM,\r\n" + 
			"   DELVRY_ADDR,\r\n" + 
			"   AGENCY_FL,\r\n" + 
			"   RECEIV_ADDR,\r\n" + 
			"   TRANSIT_TYP,\r\n" + 
			"   TRANSIT_PLAN,\r\n" + 
			"   TRANSIT_MNY,\r\n" + 
			"   BE_DELIVERY_STATUS,\r\n" + 
			"   BE_OBJ_STS_OP,\r\n" + 
			"   DELIVERY_STATUS,\r\n" + 
			"   OBJ_STS_OP,\r\n" + 
			"   VALIDFLAG,\r\n" + 
			"   CREATE_NAME,\r\n" + 
			"   CREATE_TIME,\r\n" + 
			"   UPDATE_NAME,\r\n" + 
			"   UPDATE_TIME,\r\n" + 
			"   DELETE_NAME,\r\n" + 
			"   DELETE_TIME,\r\n" + 
			"   ISLOCK,\r\n" + 
			"   PICKUP_FLAG,\r\n" + 
			"   EXTRA_FLAG,\r\n" + 
			"   IS_ADD,\r\n" + 
			"   IS_LIKU,\r\n" + 
			"   NLK_RSN,\r\n" + 
			"   NLK_CHECK,\r\n" + 
			"   LK_ID,\r\n" + 
			"   TD_ID,\r\n" + 
			"   PRESENT_STATUS)\r\n" + 
			"values\r\n" + 
			"  ('#ORD_PK#',\r\n" + 
			"   '#ORD_LN_PK#',\r\n" + 
			"   '#ORD_LN_DLY_PK#',\r\n" + 
			"   '#DELIVERY_NO#',\r\n" + 
			"   to_date('#DELVRY_BDATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   to_date('#DELVRY_EDATE#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#DELVRY_QTY#',\r\n" + 
			"   '#ORDER_UNIT#',\r\n" + 
			"   '#WGT_ESTMT#',\r\n" + 
			"   '#ENSU_TOTL_LEN#',\r\n" + 
			"   '#RECEIV_NO#',\r\n" + 
			"   '#RECEIV_NM#',\r\n" + 
			"   '#DELVRY_ADDR#',\r\n" + 
			"   '#AGENCY_FL#',\r\n" + 
			"   '#RECEIV_ADDR#',\r\n" + 
			"   '#TRANSIT_TYP#',\r\n" + 
			"   '#TRANSIT_PLAN#',\r\n" + 
			"   '#TRANSIT_MNY#',\r\n" + 
			"   '#BE_DELIVERY_STATUS#',\r\n" + 
			"   '#BE_OBJ_STS_OP#',\r\n" + 
			"   '#DELIVERY_STATUS#',\r\n" + 
			"   '#OBJ_STS_OP#',\r\n" + 
			"   '#VALIDFLAG#',\r\n" + 
			"   '#CREATE_NAME#',\r\n" + 
			"   to_date('#CREATE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#UPDATE_NAME#',\r\n" + 
			"   to_date('#UPDATE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#DELETE_NAME#',\r\n" + 
			"   to_date('#DELETE_TIME#','yyyy-mm-dd hh24:mi:ss'),\r\n" + 
			"   '#ISLOCK#',\r\n" + 
			"   '#PICKUP_FLAG#',\r\n" + 
			"   '#EXTRA_FLAG#',\r\n" + 
			"   '#IS_ADD#',\r\n" + 
			"   '#IS_LIKU#',\r\n" + 
			"   '#NLK_RSN#',\r\n" + 
			"   '#NLK_CHECK#',\r\n" + 
			"   '#LK_ID#',\r\n" + 
			"   '#TD_ID#',\r\n" + 
			"   '#PRESENT_STATUS#')\r\n" + 
			"";
	
	/**
	 * 新增提单信息
	 */
	public static String InsertYdmZcBillm = "INSERT INTO YDM_ZC_BILL_M\r\n" +
			"  (DEPARTMENT_DESC,\r\n" + 
			"   MANAGEMENT_NO,\r\n" + 
			"   MANAGEMENT_NAME,\r\n" + 
			"   CUSTOMER_NM,\r\n" + 
			"   RECEIV_NO,\r\n" + 
			"   RECEIV_NM,\r\n" + 
			"   STLMT_UNIT_NO,\r\n" + 
			"   STLMT_UNIT_NM,\r\n" + 
			"   CARRY_COMPANY_CODE,\r\n" + 
			"   CARRY_COMPANY_NAME,\r\n" + 
			"   PRD_CLS,\r\n" + 
			"   PRODUCCODE,\r\n" + 
			"   PRODUCNAME,\r\n" + 
			"   STD_CODE,\r\n" + 
			"   STD_NAME,\r\n" + 
			"   STEELCODE,\r\n" + 
			"   STEELNAME,\r\n" + 
			"   PLAN_START_TIME,\r\n" + 
			"   PLAN_END_TIME,\r\n" + 
			"   ACT_START_TIME,\r\n" + 
			"   ACT_END_TIME,\r\n" + 
			"   PLAN_WT,\r\n" + 
			"   PLAN_NUM,\r\n" + 
			"   PLAN_TOTL_LEN,\r\n" + 
			"   ACT_WT,\r\n" + 
			"   ACT_NUM,\r\n" + 
			"   ACT_TOTL_LEN,\r\n" + 
			"   SPEC_CODE,\r\n" + 
			"   SPEC_NAME,\r\n" + 
			"   BILL_STATUS,\r\n" + 
			"   MEMO,\r\n" + 
			"   VALIDFLAG,\r\n" + 
			"   CREATE_NAME,\r\n" + 
			"   CREATE_TIME,\r\n" + 
			"   UPDATE_NAME,\r\n" + 
			"   UPDATE_TIME,\r\n" + 
			"   DELETE_NAME,\r\n" + 
			"   DELETE_TIME,\r\n" + 
			"   DEPARTMENT_CODE,\r\n" + 
			"   BILL_NO_SEQ,\r\n" + 
			"   BILL_NO,\r\n" + 
			"   ORDER_NO,\r\n" + 
			"   ORDER_SEQ,\r\n" + 
			"   DELIVERY_NO,\r\n" + 
			"   SEND_PLAN_NO,\r\n" + 
			"   VSTEL_CODE,\r\n" + 
			"   VSTEL_DESC,\r\n" + 
			"   PLAN_TRANS_TYPE,\r\n" + 
			"   ACT_TRANS_TYPE,\r\n" + 
			"   STATION_NO,\r\n" + 
			"   STATION_NM,\r\n" + 
			"   SPCL_LN_NO,\r\n" + 
			"   SPCL_LN_NM,\r\n" + 
			"   PORT_NO,\r\n" + 
			"   PORT_DESC,\r\n" + 
			"   DELIVY_PLACE_CODE,\r\n" + 
			"   DELIVY_PLACE_NAME,\r\n" + 
			"   SALE_ORG,\r\n" + 
			"   SALE_ORG_DESC,\r\n" + 
			"   CUSTOMER_NO,\r\n" + 
			"   LOADVEHICLE_TYPE,\r\n" + 
			"   FST_DRAWEE_UNIT,\r\n" + 
			"   ORD_PK,\r\n" + 
			"   ORD_LN_PK,\r\n" + 
			"   ORD_LN_DLY_PK,\r\n" + 
			"   AGENCY_FL,\r\n" + 
			"   RECEIV_ADDR,\r\n" + 
			"   DELVRY_ADDR,\r\n" + 
			"   PICKUP_FLAG,CREDIT_NO,EXTRA_FLAG,SINGLE_NO,ITEM_NO,LICENSE_NO,ZBS_SOURCE,FLAG_LEN,WIND_UP_FLAG,SUPPLY_UNIT,SUPPLY_UNIT_DESC,\r\n" + 
			"   DELVRY_WHEREABOUTS,IS_OVERSTOCK)\r\n" + 
			"VALUES\r\n" + 
			"  ('#DEPARTMENT_DESC#',\r\n" + 
			"   '#MANAGEMENT_NO#',\r\n" + 
			"   '#MANAGEMENT_NAME#',\r\n" + 
			"   '#CUSTOMER_NM#',\r\n" + 
			"   '#RECEIV_NO#',\r\n" + 
			"   '#RECEIV_NM#',\r\n" + 
			"   '#STLMT_UNIT_NO#',\r\n" + 
			"   '#STLMT_UNIT_NM#',\r\n" + 
			"   '#CARRY_COMPANY_CODE#',\r\n" + 
			"   '#CARRY_COMPANY_NAME#',\r\n" + 
			"   '#PRD_CLS#',\r\n" + 
			"   '#PRODUCCODE#',\r\n" + 
			"   '#PRODUCNAME#',\r\n" + 
			"   '#STD_CODE#',\r\n" + 
			"   '#STD_NAME#',\r\n" + 
			"   '#STEELCODE#',\r\n" + 
			"   '#STEELNAME#',\r\n" + 
			"   TO_DATE('#PLAN_START_TIME#','YYYY/MM/DD HH24:MI:SS'),\r\n" + 
			"   TO_DATE('#PLAN_END_TIME#','YYYY/MM/DD HH24:MI:SS'),\r\n" + 
			"   TO_DATE('#ACT_START_TIME#','YYYY-MM-DD'),\r\n" + 
			"   TO_DATE('#ACT_END_TIME#','YYYY-MM_DD'),\r\n" + 
			"   '#PLAN_WT#',\r\n" + 
			"   '#PLAN_NUM#',\r\n" + 
			"   '#PLAN_TOTL_LEN#',\r\n" + 
			"   '#ACT_WT#',\r\n" + 
			"   '#ACT_NUM#',\r\n" + 
			"   '#ACT_TOTL_LEN#',\r\n" + 
			"   '#SPEC_CODE#',\r\n" + 
			"   '#SPEC_NAME#',\r\n" + 
			"   '#BILL_STATUS#',\r\n" + 
			"   '#MEMO#',\r\n" + 
			"   '#VALIDFLAG#',\r\n" + 
			"   '#CREATE_NAME#',\r\n" + 
			"   TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),\r\n" + 
			"   NULL,\r\n" + 
			"   NULL,\r\n" + 
			"   NULL,\r\n" + 
			"   NULL,\r\n" + 
			"   '#DEPARTMENT_CODE#',\r\n" + 
			"   '#BILL_NO_SEQ#',\r\n" + 
			"   '#BILL_NO#',\r\n" + 
			"   '#ORDER_NO#',\r\n" + 
			"   '#ORDER_SEQ#',\r\n" + 
			"   '#DELIVERY_NO#',\r\n" + 
			"   '#SEND_PLAN_NO#',\r\n" + 
			"   '#VSTEL_CODE#',\r\n" + 
			"   '#VSTEL_DESC#',\r\n" + 
			"   '#PLAN_TRANS_TYPE#',\r\n" + 
			"   '#ACT_TRANS_TYPE#',\r\n" + 
			"   '#STATION_NO#',\r\n" + 
			"   '#STATION_NM#',\r\n" + 
			"   '#SPCL_LN_NO#',\r\n" + 
			"   '#SPCL_LN_NM#',\r\n" + 
			"   '#PORT_NO#',\r\n" + 
			"   '#PORT_DESC#',\r\n" + 
			"   '#DELIVY_PLACE_CODE#',\r\n" + 
			"   '#DELIVY_PLACE_NAME#',\r\n" + 
			"   '#SALE_ORG#',\r\n" + 
			"   '#SALE_ORG_DESC#',\r\n" + 
			"   '#CUSTOMER_NO#',\r\n" + 
			"   '#LOADVEHICLE_TYPE#',\r\n" + 
			"   '#FST_DRAWEE_UNIT#',\r\n" + 
			"   '#ORD_PK#',\r\n" + 
			"   '#ORD_LN_PK#',\r\n" + 
			"   '#ORD_LN_DLY_PK#',\r\n" + 
			"   '#AGENCY_FL#',\r\n" + 
			"   '#RECEIV_ADDR#',\r\n" + 
			"   '#DELVRY_ADDR#',\r\n" + 
			"   '#PICKUP_FLAG#','#CREDIT_NO#','#EXTRA_FLAG#','#SINGLE_NO#','#ITEM_NO#','#LICENSE_NO#',?,?,'','#SUPPLY_UNIT#','#SUPPLY_UNIT_DESC#',\r\n" + 
			"   (SELECT STORAGE_NAME FROM SLM_BASE_CUST_STORAGE WHERE CUSTOMER_NO = '#RECEIV_NO#' AND VALIDFLAG = '1' AND ROWNUM = 1),\r\n" + 
			"   '#OVERSTOCK#')";
	
	/**
	 * 修改提单信息
	 */
	public static String updateYdmZcBillm ="UPDATE YDM_ZC_BILL_M\r\n" +
			"   set BILL_NO_SEQ                 = '#BILL_NO_SEQ#',\r\n" + 
			"       BILL_NO                     = '#BILL_NO#',\r\n" + 
			"       ORDER_NO                    = '#ORDER_NO#',\r\n" + 
			"       ORDER_SEQ                   = '#ORDER_SEQ#',\r\n" + 
			"       DELIVERY_NO                 = '#DELIVERY_NO#',\r\n" + 
			"       SEND_PLAN_NO                = '#SEND_PLAN_NO#',\r\n" + 
			"       VSTEL_CODE                  = '#VSTEL_CODE#',\r\n" + 
			"       VSTEL_DESC                  = '#VSTEL_DESC#',\r\n" + 
			"       PLAN_TRANS_TYPE             = '#PLAN_TRANS_TYPE#',\r\n" + 
			"       ACT_TRANS_TYPE              = '#ACT_TRANS_TYPE#',\r\n" + 
			"       STATION_NO                  = '#STATION_NO#',\r\n" + 
			"       STATION_NM                  = '#STATION_NM#',\r\n" + 
			"       SPCL_LN_NO                  = '#SPCL_LN_NO#',\r\n" + 
			"       SPCL_LN_NM                  = '#SPCL_LN_NM#',\r\n" + 
			"       PORT_NO                     = '#PORT_NO#',\r\n" + 
			"       PORT_DESC                   = '#PORT_DESC#',\r\n" + 
			"       DELIVY_PLACE_CODE           = '#DELIVY_PLACE_CODE#',\r\n" + 
			"       DELIVY_PLACE_NAME           = '#DELIVY_PLACE_NAME#',\r\n" + 
			"       SALE_ORG                    = '#SALE_ORG#',\r\n" + 
			"       SALE_ORG_DESC               = '#SALE_ORG_DESC#',\r\n" + 
			"       CUSTOMER_NO                 = '#CUSTOMER_NO#',\r\n" + 
			"       CUSTOMER_NM                 = '#CUSTOMER_NM#',\r\n" + 
			"       RECEIV_NO                   = '#RECEIV_NO#',\r\n" + 
			"       RECEIV_NM                   = '#RECEIV_NM#',\r\n" + 
			"       STLMT_UNIT_NO               = '#STLMT_UNIT_NO#',\r\n" + 
			"       STLMT_UNIT_NM               = '#STLMT_UNIT_NM#',\r\n" + 
			"       CARRY_COMPANY_CODE          = '#CARRY_COMPANY_CODE#',\r\n" + 
			"       CARRY_COMPANY_NAME          = '#CARRY_COMPANY_NAME#',\r\n" + 
			"       PRD_CLS                     = '#PRD_CLS#',\r\n" + 
			"       PRODUCCODE                  = '#PRODUCCODE#',\r\n" + 
			"       PRODUCNAME                  = '#PRODUCNAME#',\r\n" + 
			"       STD_CODE                    = '#STD_CODE#',\r\n" + 
			"       STD_NAME                    = '#STD_NAME#',\r\n" + 
			"       STEELCODE                   = '#STEELCODE#',\r\n" + 
			"       STEELNAME                   = '#STEELNAME#',\r\n" + 
			"       PLAN_START_TIME             = '#PLAN_START_TIME#',\r\n" + 
			"       PLAN_END_TIME               = '#PLAN_END_TIME#',\r\n" + 
			"       ACT_START_TIME              = '#ACT_START_TIME#',\r\n" + 
			"       ACT_END_TIME                = '#ACT_END_TIME#',\r\n" + 
			"       PLAN_WT                     = '#PLAN_WT#',\r\n" + 
			"       PLAN_NUM                    = '#PLAN_NUM#',\r\n" + 
			"       PLAN_TOTL_LEN_TEMP          = '#PLAN_TOTL_LEN_TEMP#',\r\n" + 
			"       ACT_WT                      = '#ACT_WT#',\r\n" + 
			"       ACT_NUM                     = '#ACT_NUM#',\r\n" + 
			"       ACT_TOTL_LEN_TEMP           = '#ACT_TOTL_LEN_TEMP#',\r\n" + 
			"       SPEC_CODE                   = '#SPEC_CODE#',\r\n" + 
			"       SPEC_NAME                   = '#SPEC_NAME#',\r\n" + 
			"       BILL_STATUS                 = '#BILL_STATUS#',\r\n" + 
			"       MEMO                        = '#MEMO#',\r\n" + 
			"       VALIDFLAG                   = '#VALIDFLAG#',\r\n" + 
			"       CREATE_NAME                 = '#CREATE_NAME#',\r\n" + 
			"       CREATE_TIME                 = '#CREATE_TIME#',\r\n" + 
			"       UPDATE_NAME                 = '#UPDATE_NAME#',\r\n" + 
			"       UPDATE_TIME                 = '#UPDATE_TIME#',\r\n" + 
			"       DELETE_NAME                 = '#DELETE_NAME#',\r\n" + 
			"       DELETE_TIME                 = '#DELETE_TIME#',\r\n" + 
			"       LOADVEHICLE_TYPE            = '#LOADVEHICLE_TYPE#',\r\n" + 
			"       FST_DRAWEE_UNIT             = '#FST_DRAWEE_UNIT#',\r\n" + 
			"       ORD_PK                      = '#ORD_PK#',\r\n" + 
			"       ORD_LN_PK                   = '#ORD_LN_PK#',\r\n" + 
			"       ORD_LN_DLY_PK               = '#ORD_LN_DLY_PK#',\r\n" + 
			"       AGENCY_FL                   = '#AGENCY_FL#',\r\n" + 
			"       RECEIV_ADDR                 = '#RECEIV_ADDR#',\r\n" + 
			"       DELVRY_ADDR                 = '#DELVRY_ADDR#',\r\n" + 
			"       PICKUP_FLAG                 = '#PICKUP_FLAG#',\r\n" + 
			"       DEPARTMENT_CODE             = '#DEPARTMENT_CODE#',\r\n" + 
			"       DEPARTMENT_DESC             = '#DEPARTMENT_DESC#',\r\n" + 
			"       MANAGEMENT_NO               = '#MANAGEMENT_NO#',\r\n" + 
			"       MANAGEMENT_NAME             = '#MANAGEMENT_NAME#',\r\n" + 
			"       ISPRECLOSE                  = '#ISPRECLOSE#',\r\n" + 
			"       PRINT_FLAG                  = '#PRINT_FLAG#',\r\n" + 
			"       PRINT_NUM                   = '#PRINT_NUM#',\r\n" + 
			"       PRINT_TIME                  = '#PRINT_TIME#',\r\n" + 
			"       PRINT_NUMBER                = '#PRINT_NUMBER#',\r\n" + 
			"       ZOUT_FLAG                   = '#ZOUT_FLAG#',\r\n" + 
			"       REALINVOICENO               = '#REALINVOICENO#',\r\n" + 
			"       REALINVOICENO_DATE          = '#REALINVOICENO_DATE#',\r\n" + 
			"       REALINVOICENO1              = '#REALINVOICENO1#',\r\n" + 
			"       BAL_YEAR_MONTH              = '#BAL_YEAR_MONTH#',\r\n" + 
			"       CREDIT_NO                   = '#CREDIT_NO#',\r\n" + 
			"       EXTRA_FLAG                  = '#EXTRA_FLAG#',\r\n" + 
			"       BILL_TICKET_STATUS          = '#BILL_TICKET_STATUS#',\r\n" + 
			"       OUTSTOCK_TICKET_STATUS      = '#OUTSTOCK_TICKET_STATUS#',\r\n" + 
			"       TRANSMNY_TICKET_STATUS      = '#TRANSMNY_TICKET_STATUS#',\r\n" + 
			"       BILL_TICKET_AFFRIM_NAME     = '#BILL_TICKET_AFFRIM_NAME#',\r\n" + 
			"       OUTSTOCK_TICKET_AFFRIM_NAME = '#OUTSTOCK_TICKET_AFFRIM_NAME#',\r\n" + 
			"       TRANSMNY_TICKET_AFFRIM_NAME = '#TRANSMNY_TICKET_AFFRIM_NAME#',\r\n" + 
			"       BILL_TICKET_AFFRIM_TIME     = '#BILL_TICKET_AFFRIM_TIME#',\r\n" + 
			"       OUTSTOCK_TICKET_AFFRIM_TIME = '#OUTSTOCK_TICKET_AFFRIM_TIME#',\r\n" + 
			"       TRANSMNY_TICKET_AFFRIM_TIME = '#TRANSMNY_TICKET_AFFRIM_TIME#',\r\n" + 
			"       RETURN_FLAG                 = '#RETURN_FLAG#',\r\n" + 
			"       ZBS_FLAG                    = '#ZBS_FLAG#',\r\n" + 
			"       ZBS_NUM                     = '#ZBS_NUM#',\r\n" + 
			"       ZBS_TIME                    = '#ZBS_TIME#',\r\n" + 
			"       ZBS_NAME                    = '#ZBS_NAME#',\r\n" + 
			"       ZBS_PATH                    = '#ZBS_PATH#',\r\n" + 
			"       ASK_ITEM_NO                 = '#ASK_ITEM_NO#',\r\n" + 
			"       METRIC_SYSTEM               = '#METRIC_SYSTEM#',\r\n" + 
			"       ITEM_NO                     = '#ITEM_NO#',\r\n" + 
			"       LICENSE_NO                  = '#LICENSE_NO#',\r\n" + 
			"       SINGLE_NO                   = '#SINGLE_NO#',\r\n" + 
			"       CHECK_NO                    = '#CHECK_NO#',\r\n" + 
			"       ZBS_SOURCE                  = '#ZBS_SOURCE#',\r\n" + 
			"       PLAN_TOTL_LEN               = '#PLAN_TOTL_LEN#',\r\n" + 
			"       ACT_TOTL_LEN                = '#ACT_TOTL_LEN#',\r\n" + 
			"       FLAG_LEN                    = '#FLAG_LEN#',\r\n" + 
			"       WIND_UP_FLAG                = '#WIND_UP_FLAG#',\r\n" + 
			"       LOCK_BILL_FLAG              = '#LOCK_BILL_FLAG#',\r\n" + 
			"       SUPPLY_UNIT                 = '#SUPPLY_UNIT#',\r\n" + 
			"       SUPPLY_UNIT_DESC            = '#SUPPLY_UNIT_DESC#',\r\n" + 
			"       DELVRY_WHEREABOUTS          = '#DELVRY_WHEREABOUTS#',\r\n" + 
			"       ZBS_ORDER_NO                = '#ZBS_ORDER_NO#',\r\n" + 
			"       ZBS_ORDER_NO_NAME           = '#ZBS_ORDER_NO_NAME#',\r\n" + 
			"       ZBS_ORDER_NO_TIME           = '#ZBS_ORDER_NO_TIME#',\r\n" + 
			"       LANGUAGE_CODE               = '#LANGUAGE_CODE#',\r\n" + 
			"       LANGUAGE_NAME               = '#LANGUAGE_NAME#',\r\n" + 
			"       ZBS_TYPE_CODE               = '#ZBS_TYPE_CODE#',\r\n" + 
			"       ZBS_TYPE_DESC               = '#ZBS_TYPE_DESC#',\r\n" + 
			"       LET_DELIVERY_FLAG           = '#LET_DELIVERY_FLAG#',\r\n" + 
			"       STOVE_TICKET_FLAG           = '#STOVE_TICKET_FLAG#',\r\n" + 
			"       IS_OVERSTOCK                = '#IS_OVERSTOCK#',\r\n" + 
			" where BILL_NO_SEQ = '#BILL_NO_SEQ#'\r\n" + 
			"";
	/**
	 * 新增监制主表
	 */
	public static String InsertSlmOrderLinePrdcr =
			"insert into slm_order_line_prdcr "
			+ "(PRDCR_NO,PRDCR_DESC,PSC,PSC_DESC,STD_CODE,STD_NAME,PRDCR_STS,FINAL_USER,MSC_PLINE,VALIDFLAG,PRDCR_INDEX)"
			+ " values (?,?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 新增监制从表
	 */
	public static String InsertSlmOrderLinePrdcrLst =
			"insert into slm_order_line_prdcr_lst "
			+ "(PRDCR_NO,PROCESS_CODE,PROCESS_DESC,PROCESS_CODE_C,PROCESS_DESC_C,STATION_CODE,STATION_DESC,PRDCR_PRC_FL, "
			+ "PRDCR_PRC_DESC,PRDCR_ADVC_DAY,PDEPT_NO,PRDCR_MAN,PRDCR_MAN_PHONE,PRDCR_INDEX)"
			+ " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 新增提单
	 */
	public static String InsertYdmZcBillc = "INSERT INTO YDM_ZC_BILL_C\r\n" +
			"  (BILL_SQE,\r\n" + 
			"   BILL_NO,\r\n" + 
			"   ORDER_NO,\r\n" + 
			"   ORDER_SEQ,\r\n" + 
			"   MAT_NO,\r\n" + 
			"   LOT_NO,\r\n" + 
			"   JUDGE_STOVE_NO,\r\n" + 
			"   BATCH_NO,\r\n" + 
			"   GROUP_NO,\r\n" + 
			"   STOVE_NO,\r\n" + 
			"   MATERIAL_NO,\r\n" + 
			"   MATERIAL_NAME,\r\n" + 
			"   PRODUCCODE,\r\n" + 
			"   PRODUCNAME,\r\n" + 
			"   STD_CODE,\r\n" + 
			"   STD_NAME,\r\n" + 
			"   GRADECODE,\r\n" + 
			"   GRADENAME,\r\n" + 
			"   STEELCODE,\r\n" + 
			"   STEELNAME,\r\n" + 
			"   STD_STYLE,\r\n" + 
			"   STD_STYLE_DESC,\r\n" + 
			"   SPEC_CODE,\r\n" + 
			"   SPEC_NAME,\r\n" + 
			"   MODEL_CODE,\r\n" + 
			"   MODEL_DESC,\r\n" + 
			"   PLINE_CODE,\r\n" + 
			"   PLINE_NAME,\r\n" + 
			"   ACT_DIMATER,\r\n" + 
			"   ACT_HEIGHT,\r\n" + 
			"   ACT_LEN_TEMP,\r\n" + 
			"   ACT_LEN_MIN,\r\n" + 
			"   ACT_LEN_MAX,\r\n" + 
			"   ACT_COUNT,\r\n" + 
			"   ACT_WEIGHT,\r\n" + 
			"   ACT_THEORY_WEIGHT,\r\n" + 
			"   JUDGE_RESULT_CODE,\r\n" + 
			"   PRO_BC,\r\n" + 
			"   PRO_BZ,\r\n" + 
			"   RPO_TIME,\r\n" + 
			"   EDIT_FLAG,\r\n" + 
			"   STORAGE_NO,\r\n" + 
			"   LOCATION_NO,\r\n" + 
			"   MEMO,\r\n" + 
			"   CREATE_NAME,\r\n" + 
			"   CREATE_TIME,\r\n" + 
			"   UPDATE_NAME,\r\n" + 
			"   UPDATE_TIME,\r\n" + 
			"   DELETE_NAME,\r\n" + 
			"   DELETE_TIME,\r\n" + 
			"   DELIVERY_NO,\r\n" + 
			"   VALIDFLAG,\r\n" + 
			"   ORD_PK,\r\n" + 
			"   ORD_LN_PK,\r\n" + 
			"   ORD_LN_DLY_PK,\r\n" + 
			"   LOADVEHICLE_FLAG,\r\n" + 
			"   PRT_FLAG,\r\n" + 
			"   VSTEL,\r\n" + 
			"   VSTEL_DESC,\r\n" + 
			"   MOVE_LOAD_FLAG,\r\n" + 
			"   SEND_NUM,\r\n" + 
			"   ACT_FIX_NUM,\r\n" + 
			"   ACT_FIX_LEN,\r\n" + 
			"   RETURN_FLAG,\r\n" + 
			"   BOUND_NUM,\r\n" + 
			"   FINISHPRO_MOLD,\r\n" + 
			"   IN_MOLD,\r\n" + 
			"   ZBS_ID,\r\n" + 
			"   ACT_LEN,\r\n" + 
			"   JG_ZBS_ID,\r\n" + 
			"   YEAR_SEQ,\r\n" + 
			"   RECEIVE_FLAG,\r\n" + 
			"   PACK_NO,\r\n" + 
			"   IN_TYPE,\r\n" + 
			"   BILL_BATCH_NO)\r\n" + 
			"values\r\n" + 
			"  ('#BILL_SQE#',\r\n" + 
			"   '#BILL_NO#',\r\n" + 
			"   '#ORDER_NO#',\r\n" + 
			"   '#ORDER_SEQ#',\r\n" + 
			"   '#MAT_NO#',\r\n" + 
			"   '#LOT_NO#',\r\n" + 
			"   '#JUDGE_STOVE_NO#',\r\n" + 
			"   '#BATCH_NO#',\r\n" + 
			"   '#GROUP_NO#',\r\n" + 
			"   '#STOVE_NO#',\r\n" + 
			"   '#MATERIAL_NO#',\r\n" + 
			"   '#MATERIAL_NAME#',\r\n" + 
			"   '#PRODUCCODE#',\r\n" + 
			"   '#PRODUCNAME#',\r\n" + 
			"   '#STD_CODE#',\r\n" + 
			"   '#STD_NAME#',\r\n" + 
			"   '#GRADECODE#',\r\n" + 
			"   '#GRADENAME#',\r\n" + 
			"   '#STEELCODE#',\r\n" + 
			"   '#STEELNAME#',\r\n" + 
			"   '#STD_STYLE#',\r\n" + 
			"   '#STD_STYLE_DESC#',\r\n" + 
			"   '#SPEC_CODE#',\r\n" + 
			"   '#SPEC_NAME#',\r\n" + 
			"   '#MODEL_CODE#',\r\n" + 
			"   '#MODEL_DESC#',\r\n" + 
			"   '#PLINE_CODE#',\r\n" + 
			"   '#PLINE_NAME#',\r\n" + 
			"   '#ACT_DIMATER#',\r\n" + 
			"   '#ACT_HEIGHT#',\r\n" + 
			"   '#ACT_LEN_TEMP#',\r\n" + 
			"   '#ACT_LEN_MIN#',\r\n" + 
			"   '#ACT_LEN_MAX#',\r\n" + 
			"   '#ACT_COUNT#',\r\n" + 
			"   '#ACT_WEIGHT#',\r\n" + 
			"   '#ACT_THEORY_WEIGHT#',\r\n" + 
			"   '#JUDGE_RESULT_CODE#',\r\n" + 
			"   '#PRO_BC#',\r\n" + 
			"   '#PRO_BZ#',\r\n" + 
			"   '#RPO_TIME#',\r\n" + 
			"   '#EDIT_FLAG#',\r\n" + 
			"   '#STORAGE_NO#',\r\n" + 
			"   '#LOCATION_NO#',\r\n" + 
			"   '#MEMO#',\r\n" + 
			"   '#CREATE_NAME#',\r\n" + 
			"   '#CREATE_TIME#',\r\n" + 
			"   '#UPDATE_NAME#',\r\n" + 
			"   '#UPDATE_TIME#',\r\n" + 
			"   '#DELETE_NAME#',\r\n" + 
			"   '#DELETE_TIME#',\r\n" + 
			"   '#DELIVERY_NO#',\r\n" + 
			"   '#VALIDFLAG#',\r\n" + 
			"   '#ORD_PK#',\r\n" + 
			"   '#ORD_LN_PK#',\r\n" + 
			"   '#ORD_LN_DLY_PK#',\r\n" + 
			"   '#LOADVEHICLE_FLAG#',\r\n" + 
			"   '#PRT_FLAG#',\r\n" + 
			"   '#VSTEL#',\r\n" + 
			"   '#VSTEL_DESC#',\r\n" + 
			"   '#MOVE_LOAD_FLAG#',\r\n" + 
			"   '#SEND_NUM#',\r\n" + 
			"   '#ACT_FIX_NUM#',\r\n" + 
			"   '#ACT_FIX_LEN#',\r\n" + 
			"   '#RETURN_FLAG#',\r\n" + 
			"   '#BOUND_NUM#',\r\n" + 
			"   '#FINISHPRO_MOLD#',\r\n" + 
			"   '#IN_MOLD#',\r\n" + 
			"   '#ZBS_ID#',\r\n" + 
			"   '#ACT_LEN#',\r\n" + 
			"   '#JG_ZBS_ID#',\r\n" + 
			"   '#YEAR_SEQ#',\r\n" + 
			"   '#RECEIVE_FLAG#',\r\n" + 
			"   '#PACK_NO#',\r\n" + 
			"   '#IN_TYPE#',\r\n" + 
			"   '#BILL_BATCH_NO#')\r\n" + 
			"";
 public static String updateYdmZcBillc = "UPDATE YDM_ZC_BILL_C\r\n" +
 		"   set BILL_SQE          = '#BILL_SQE#',\r\n" + 
 		"       BILL_NO           = '#BILL_NO#',\r\n" + 
 		"       ORDER_NO          = '#ORDER_NO#',\r\n" + 
 		"       ORDER_SEQ         = '#ORDER_SEQ#',\r\n" + 
 		"       MAT_NO            = '#MAT_NO#',\r\n" + 
 		"       LOT_NO            = '#LOT_NO#',\r\n" + 
 		"       JUDGE_STOVE_NO    = '#JUDGE_STOVE_NO#',\r\n" + 
 		"       BATCH_NO          = '#BATCH_NO#',\r\n" + 
 		"       GROUP_NO          = '#GROUP_NO#',\r\n" + 
 		"       STOVE_NO          = '#STOVE_NO#',\r\n" + 
 		"       MATERIAL_NO       = '#MATERIAL_NO#',\r\n" + 
 		"       MATERIAL_NAME     = '#MATERIAL_NAME#',\r\n" + 
 		"       PRODUCCODE        = '#PRODUCCODE#',\r\n" + 
 		"       PRODUCNAME        = '#PRODUCNAME#',\r\n" + 
 		"       STD_CODE          = '#STD_CODE#',\r\n" + 
 		"       STD_NAME          = '#STD_NAME#',\r\n" + 
 		"       GRADECODE         = '#GRADECODE#',\r\n" + 
 		"       GRADENAME         = '#GRADENAME#',\r\n" + 
 		"       STEELCODE         = '#STEELCODE#',\r\n" + 
 		"       STEELNAME         = '#STEELNAME#',\r\n" + 
 		"       STD_STYLE         = '#STD_STYLE#',\r\n" + 
 		"       STD_STYLE_DESC    = '#STD_STYLE_DESC#',\r\n" + 
 		"       SPEC_CODE         = '#SPEC_CODE#',\r\n" + 
 		"       SPEC_NAME         = '#SPEC_NAME#',\r\n" + 
 		"       MODEL_CODE        = '#MODEL_CODE#',\r\n" + 
 		"       MODEL_DESC        = '#MODEL_DESC#',\r\n" + 
 		"       PLINE_CODE        = '#PLINE_CODE#',\r\n" + 
 		"       PLINE_NAME        = '#PLINE_NAME#',\r\n" + 
 		"       ACT_DIMATER       = '#ACT_DIMATER#',\r\n" + 
 		"       ACT_HEIGHT        = '#ACT_HEIGHT#',\r\n" + 
 		"       ACT_LEN_TEMP      = '#ACT_LEN_TEMP#',\r\n" + 
 		"       ACT_LEN_MIN       = '#ACT_LEN_MIN#',\r\n" + 
 		"       ACT_LEN_MAX       = '#ACT_LEN_MAX#',\r\n" + 
 		"       ACT_COUNT         = '#ACT_COUNT#',\r\n" + 
 		"       ACT_WEIGHT        = '#ACT_WEIGHT#',\r\n" + 
 		"       ACT_THEORY_WEIGHT = '#ACT_THEORY_WEIGHT#',\r\n" + 
 		"       JUDGE_RESULT_CODE = '#JUDGE_RESULT_CODE#',\r\n" + 
 		"       PRO_BC            = '#PRO_BC#',\r\n" + 
 		"       PRO_BZ            = '#PRO_BZ#',\r\n" + 
 		"       RPO_TIME          = '#RPO_TIME#',\r\n" + 
 		"       EDIT_FLAG         = '#EDIT_FLAG#',\r\n" + 
 		"       STORAGE_NO        = '#STORAGE_NO#',\r\n" + 
 		"       LOCATION_NO       = '#LOCATION_NO#',\r\n" + 
 		"       MEMO              = '#MEMO#',\r\n" + 
 		"       CREATE_NAME       = '#CREATE_NAME#',\r\n" + 
 		"       CREATE_TIME       = '#CREATE_TIME#',\r\n" + 
 		"       UPDATE_NAME       = '#UPDATE_NAME#',\r\n" + 
 		"       UPDATE_TIME       = '#UPDATE_TIME#',\r\n" + 
 		"       DELETE_NAME       = '#DELETE_NAME#',\r\n" + 
 		"       DELETE_TIME       = '#DELETE_TIME#',\r\n" + 
 		"       DELIVERY_NO       = '#DELIVERY_NO#',\r\n" + 
 		"       VALIDFLAG         = '#VALIDFLAG#',\r\n" + 
 		"       ORD_PK            = '#ORD_PK#',\r\n" + 
 		"       ORD_LN_PK         = '#ORD_LN_PK#',\r\n" + 
 		"       ORD_LN_DLY_PK     = '#ORD_LN_DLY_PK#',\r\n" + 
 		"       LOADVEHICLE_FLAG  = '#LOADVEHICLE_FLAG#',\r\n" + 
 		"       PRT_FLAG          = '#PRT_FLAG#',\r\n" + 
 		"       VSTEL             = '#VSTEL#',\r\n" + 
 		"       VSTEL_DESC        = '#VSTEL_DESC#',\r\n" + 
 		"       MOVE_LOAD_FLAG    = '#MOVE_LOAD_FLAG#',\r\n" + 
 		"       SEND_NUM          = '#SEND_NUM#',\r\n" + 
 		"       ACT_FIX_NUM       = '#ACT_FIX_NUM#',\r\n" + 
 		"       ACT_FIX_LEN       = '#ACT_FIX_LEN#',\r\n" + 
 		"       RETURN_FLAG       = '#RETURN_FLAG#',\r\n" + 
 		"       BOUND_NUM         = '#BOUND_NUM#',\r\n" + 
 		"       FINISHPRO_MOLD    = '#FINISHPRO_MOLD#',\r\n" + 
 		"       IN_MOLD           = '#IN_MOLD#',\r\n" + 
 		"       ZBS_ID            = '#ZBS_ID#',\r\n" + 
 		"       ACT_LEN           = '#ACT_LEN#',\r\n" + 
 		"       JG_ZBS_ID         = '#JG_ZBS_ID#',\r\n" + 
 		"       YEAR_SEQ          = '#YEAR_SEQ#',\r\n" + 
 		"       RECEIVE_FLAG      = '#RECEIVE_FLAG#',\r\n" + 
 		"       PACK_NO           = '#PACK_NO#',\r\n" + 
 		"       IN_TYPE           = '#IN_TYPE#',\r\n" + 
 		"       BILL_BATCH_NO     = '#BILL_BATCH_NO#'\r\n" + 
 		" WHERE BILL_SQE = '#BILL_SQE#'\r\n" + 
 		"";
 
       //现货合同更新材料表信息
		 public static String Liku ="DECLARE\r\n" +
		 		"  V_RESUME_SEQ MAT_ZC_TRACK.RESUME_SEQ%TYPE := NULL; --履历单号\r\n" + 
		 		"  V_ELIM_NUM   PROCESS_ORDER_M.ELIM_NUM%TYPE := NULL;\r\n" + 
		 		"  V_ELIM_WGT   PROCESS_ORDER_M.ELIM_WGT%TYPE := NULL;\r\n" + 
		 		"  V_ELIM_LEN   PROCESS_ORDER_M.ELIM_LEN%TYPE := NULL;\r\n" + 
		 		"  V_OCOUNT     NUMBER := 1;\r\n" + 
		 		"  V_TIME       MAT_ZC_TRACK.CREATE_TIME%TYPE := SYSDATE;\r\n" + 
		 		"BEGIN\r\n" + 
		 		"  --生成履历序号\r\n" + 
		 		"  SELECT LPAD(NVL(MAX(SUBSTR(T.RESUME_SEQ, 15)), 0) + 1, 10, 0) RESUME_SEQ\r\n" + 
		 		"    INTO V_OCOUNT\r\n" + 
		 		"    FROM MAT_ZC_TRACK T\r\n" + 
		 		"   WHERE T.RESUME_SEQ LIKE\r\n" + 
		 		"         TO_CHAR(SYSDATE, 'YYYYMMDD') || '________________';\r\n" + 
		 		"  FOR MYROW IN (SELECT T1.*, S.STORAGE_NO\r\n" + 
		 		"                  FROM MAT_ZC_M T1, YDM_ZC_BUTTRESS S\r\n" + 
		 		"                 WHERE T1.MAT_NO = S.MAT_NO\r\n" + 
		 		"                   AND T1.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'\r\n" + 
		 		"                   AND T1.BATCH_NO = '#BATCH_NO#'\r\n" + 
		 		"                   AND T1.BATCH_GROUD_NO = '#BATCH_GROUD_NO#'\r\n" + 
		 		"                   AND T1.PRODUCT_FLAG = '801402'\r\n" + 
		 		"                   AND T1.MAT_STATUS IN\r\n" + 
		 		"                       ('80150202', '80150203', '80150204', '80150205')\r\n" + 
		 		"                   AND T1.MAT_NO IN\r\n" + 
		 		"                       (SELECT T2.MAT_NO\r\n" + 
		 		"                          FROM YDM_ZC_BUTTRESS T2\r\n" + 
		 		"                         WHERE T2.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#')\r\n" + 
		 		"                   AND DECODE('#ACT_LEN_MIN#', '', 1, T1.ACT_LEN_MIN) =\r\n" + 
		 		"                       DECODE('#ACT_LEN_MIN#', '', 1, '#ACT_LEN_MIN#')\r\n" + 
		 		"                   AND DECODE('#ACT_LEN_MAX#', '', 1, T1.ACT_LEN_MAX) =\r\n" + 
		 		"                       DECODE('#ACT_LEN_MAX#', '', 1, '#ACT_LEN_MAX#')\r\n" + 
		 		"                   AND T1.MNG_LOCK_FLAG <> '1'\r\n" + 
		 		"                   AND T1.LOCK_FLAG <> '1'\r\n" + 
		 		"                   AND T1.BELONG_CODE = '#OLD_BELONG_CODE#'\r\n" + 
		 		"                   AND ROWNUM <= #NUM#) LOOP\r\n" + 
		 		"    V_RESUME_SEQ := TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS') ||\r\n" + 
		 		"                    LPAD(V_OCOUNT, 10, 0);\r\n" + 
		 		"    UPDATE MAT_ZC_M T1\r\n" + 
		 		"       SET T1.ORDER_NO     = '#ORDER_NO#',\r\n" + 
		 		"           T1.ORDER_SEQ   =\r\n" + 
		 		"           (SELECT ORDER_SEQ\r\n" + 
		 		"              FROM SLM_ORDER_LINE T\r\n" + 
		 		"             WHERE T.ORD_LN_PK = '#ORD_LN_PK#'),\r\n" + 
		 		"           T1.PRODUCT_FLAG = '801403',\r\n" + 
		 		"           T1.MAT_STATUS   = '80150301',\r\n" + 
		 		"           T1.ORD_PK       = '#ORD_PK#',\r\n" + 
		 		"           T1.ORD_LN_PK    = '#ORD_LN_PK#',\r\n" + 
		 		"           T1.BELONG_CODE  = '#BELONG_CODE#',\r\n" + 
		 		"           T1.BELONG_NAME  = '#BELONG_NAME#',\r\n" + 
		 		"           T1.LOCK_LIKU    = '0'\r\n" + 
		 		"     WHERE T1.MAT_NO = MYROW.MAT_NO;\r\n" + 
		 		"    INSERT INTO MAT_ZC_TRACK\r\n" + 
		 		"      (RESUME_SEQ,\r\n" + 
		 		"       EVENT_ID,\r\n" + 
		 		"       EVENT_DESC,\r\n" + 
		 		"       FORM_NAME,\r\n" + 
		 		"       CALL_FUNC_CODING,\r\n" + 
		 		"       KEYVALUE_1,\r\n" + 
		 		"       KEYVALUE_1_DESC,\r\n" + 
		 		"       KEYVALUE_2,\r\n" + 
		 		"       KEYVALUE_2_DESC2,\r\n" + 
		 		"       KEYVALUE_3,\r\n" + 
		 		"       KEYVALUE_3_DESC3,\r\n" + 
		 		"       KEYVALUE_4,\r\n" + 
		 		"       KEYVALUE_4_DESC4,\r\n" + 
		 		"       KEYVALUE_5,\r\n" + 
		 		"       KEYVALUE_5_DESC5,\r\n" + 
		 		"       KEYVALUE_6,\r\n" + 
		 		"       KEYVALUE_6_DESC6,\r\n" + 
		 		"       KEYVALUE_7,\r\n" + 
		 		"       KEYVALUE_7_DESC7,\r\n" + 
		 		"       MAT_NO,\r\n" + 
		 		"       PRODUCT_FLAG,\r\n" + 
		 		"       MAT_STATUS,\r\n" + 
		 		"       LOT_NO,\r\n" + 
		 		"       STOVE_NO,\r\n" + 
		 		"       JUDGE_STOVE_NO,\r\n" + 
		 		"       BATCH_NO,\r\n" + 
		 		"       BATCH_GROUD_NO,\r\n" + 
		 		"       MATERIAL_NO,\r\n" + 
		 		"       MATERIAL_NAME,\r\n" + 
		 		"       PRODUCCODE,\r\n" + 
		 		"       PRODUCNAME,\r\n" + 
		 		"       STEELCODE,\r\n" + 
		 		"       STEELNAME,\r\n" + 
		 		"       STD_CODE,\r\n" + 
		 		"       STD_NAME,\r\n" + 
		 		"       STD_STYLE,\r\n" + 
		 		"       STD_STYLE_DESC,\r\n" + 
		 		"       SPEC_CODE,\r\n" + 
		 		"       SPEC_NAME,\r\n" + 
		 		"       MODEL_CODE,\r\n" + 
		 		"       MODEL_DESC,\r\n" + 
		 		"       ACT_LEN,\r\n" + 
		 		"       ACT_LEN_MIN,\r\n" + 
		 		"       ACT_LEN_MAX,\r\n" + 
		 		"       ACT_COUNT,\r\n" + 
		 		"       ACT_WEIGHT,\r\n" + 
		 		"       ACT_THEORY_WEIGHT,\r\n" + 
		 		"       PRO_ORDER_NO,\r\n" + 
		 		"       PRO_ORDER_ID,\r\n" + 
		 		"       PRO_ORDER_NO1,\r\n" + 
		 		"       PRO_ORDER_ID1,\r\n" + 
		 		"       ORD_PK,\r\n" + 
		 		"       ORD_LN_PK,\r\n" + 
		 		"       ORD_LN_DLY_PK,\r\n" + 
		 		"       ORDER_NO,\r\n" + 
		 		"       ORDER_SEQ,\r\n" + 
		 		"       ORDER_SEQ_NO,\r\n" + 
		 		"       OLD_ORD_PK,\r\n" + 
		 		"       OLD_ORD_LN_PK,\r\n" + 
		 		"       OLD_ORD_LN_DLY_PK,\r\n" + 
		 		"       OLD_ORDER_NO,\r\n" + 
		 		"       OLD_ORDER_SEQ,\r\n" + 
		 		"       OLD_ORDER_SEQ_NO,\r\n" + 
		 		"       BELONG_CODE,\r\n" + 
		 		"       BELONG_NAME,\r\n" + 
		 		"       MEMO,\r\n" + 
		 		"       CREATE_NAME,\r\n" + 
		 		"       CREATE_TIME,\r\n" + 
		 		"       IN_MOLD,\r\n" + 
		 		"       SUPPLY_UNIT_CODE,\r\n" + 
		 		"       SUPPLY_UNIT)\r\n" + 
		 		"    VALUES\r\n" + 
		 		"      (V_RESUME_SEQ,\r\n" + 
		 		"       '900103',\r\n" + 
		 		"       '现货利库',\r\n" + 
		 		"       'Core.StlMes.Client.SaleOrder.frmOrderManager',\r\n" + 
		 		"       'doForceLiku',\r\n" + 
		 		"       'ArrayList<MatZcMEntity> paramList',\r\n" + 
		 		"       '物料主表关键字(group)实体类集合',\r\n" + 
		 		"       '',\r\n" + 
		 		"       '',\r\n" + 
		 		"       '',\r\n" + 
		 		"       '',\r\n" + 
		 		"       'String userName',\r\n" + 
		 		"       '操作人',\r\n" + 
		 		"       'String deptId',\r\n" + 
		 		"       '操作人部门ID',\r\n" + 
		 		"       '',\r\n" + 
		 		"       '',\r\n" + 
		 		"       '',\r\n" + 
		 		"       '',\r\n" + 
		 		"       MYROW.MAT_NO,\r\n" + 
		 		"       MYROW.PRODUCT_FLAG,\r\n" + 
		 		"       MYROW.MAT_STATUS,\r\n" + 
		 		"       MYROW.LOT_NO,\r\n" + 
		 		"       MYROW.STOVE_NO,\r\n" + 
		 		"       MYROW.JUDGE_STOVE_NO,\r\n" + 
		 		"       MYROW.BATCH_NO,\r\n" + 
		 		"       MYROW.BATCH_GROUD_NO,\r\n" + 
		 		"       MYROW.MATERIAL_NO,\r\n" + 
		 		"       MYROW.MATERIAL_NAME,\r\n" + 
		 		"       MYROW.PRODUCCODE,\r\n" + 
		 		"       MYROW.PRODUCNAME,\r\n" + 
		 		"       MYROW.STEELCODE,\r\n" + 
		 		"       MYROW.STEELNAME,\r\n" + 
		 		"       MYROW.STD_CODE,\r\n" + 
		 		"       MYROW.STD_NAME,\r\n" + 
		 		"       MYROW.STD_STYLE,\r\n" + 
		 		"       MYROW.STD_STYLE_DESC,\r\n" + 
		 		"       MYROW.SPEC_CODE,\r\n" + 
		 		"       MYROW.SPEC_NAME,\r\n" + 
		 		"       MYROW.MODEL_CODE,\r\n" + 
		 		"       MYROW.MODEL_DESC,\r\n" + 
		 		"       MYROW.ACT_LEN,\r\n" + 
		 		"       MYROW.ACT_LEN_MIN,\r\n" + 
		 		"       MYROW.ACT_LEN_MAX,\r\n" + 
		 		"       MYROW.ACT_COUNT,\r\n" + 
		 		"       MYROW.ACT_WEIGHT,\r\n" + 
		 		"       MYROW.ACT_THEORY_WEIGHT,\r\n" + 
		 		"       MYROW.PRO_ORDER_NO,\r\n" + 
		 		"       MYROW.PRO_ORDER_ID,\r\n" + 
		 		"       MYROW.PRO_ORDER_NO1,\r\n" + 
		 		"       MYROW.PRO_ORDER_ID1,\r\n" + 
		 		"       '#ORD_PK#',\r\n" + 
		 		"       '#ORD_LN_PK#',\r\n" + 
		 		"       MYROW.ORD_LN_DLY_PK,\r\n" + 
		 		"       '#ORDER_NO#',\r\n" + 
		 		"       (SELECT ORDER_SEQ\r\n" + 
		 		"          FROM SLM_ORDER_LINE T\r\n" + 
		 		"         WHERE T.ORD_LN_PK = '#ORD_LN_PK#'),\r\n" + 
		 		"       MYROW.ORDER_SEQ_NO,\r\n" + 
		 		"       MYROW.OLD_ORD_PK,\r\n" + 
		 		"       MYROW.OLD_ORD_LN_PK,\r\n" + 
		 		"       MYROW.OLD_ORD_LN_DLY_PK,\r\n" + 
		 		"       MYROW.OLD_ORDER_NO,\r\n" + 
		 		"       MYROW.OLD_ORDER_SEQ,\r\n" + 
		 		"       MYROW.OLD_ORDER_SEQ_NO,\r\n" + 
		 		"       MYROW.BELONG_CODE,\r\n" + 
		 		"       MYROW.BELONG_NAME,\r\n" + 
		 		"       '现货合同，系统写入',\r\n" + 
		 		"       'SYSTEM',\r\n" + 
		 		"       SYSDATE,\r\n" + 
		 		"       MYROW.IN_MOLD,\r\n" + 
		 		"       MYROW.SUPPLY_UNIT_CODE,\r\n" + 
		 		"       MYROW.SUPPLY_UNIT);\r\n" + 
		 		"    V_OCOUNT := V_OCOUNT + 1;\r\n" + 
		 		"  END LOOP;\r\n" + 
		 		"END;\r\n" + 
		 		"";
		 
/**
 * 插入工艺评审主表
 */
	public static String InsertCraftOrdDesign =
			" insert into CRAFT_ORD_DESIGN"
			+ " (ORD_LN_PK,CRAFT_SEQ,CRAFT_NO,DESGIN_KEY,LOCK_FLAG,VALIDFLAG,CREATE_NAME,CREATE_TIME,AUDIT_NAME,AUDIT_TIME, "
            + " APPROVAL_NAME,APPROVAL_TIME,QUALITY_FLAG,REASON,CRAFT_PATH,CRAFT_NO_V,CRAFT_SOURCE, "
            + " MEMO,AUDIT_NAME1,AUDIT_TIME1,APPROVAL_NAME1,APPROVAL_TIME1,CRAFT_FILE_LV2_D,CRAFT_FILE_LV2_E,CRAFT_FILE_LV2_F, "
            +" CRAFT_FILE_LV2_G,CRAFT_FILE_LV2_E_DESC,CRAFT_FILE_LV2_F_DESC,CRAFT_FILE_LV2_G_DESC, "
            + " CRAFT_FILE_LV2_H_DESC,MATERIAL_AUTO_CRAFT,BACKLOG_AUTO_CRAFT,CRAFT_CHANGE_MEMO, "
            + " FLAG_D,FLAG_E,FLAG_F,FLAG_G,FLAG_H,PIC_FD_CHECK,WIC_FD_CHECK,CIC_FD_CHECK,FLAG_JHD) "
            + " values(?,?,?,?,?,?,?,sysdate,?,sysdate,?,sysdate,?,?,?,?,?,?,?,sysdate,?,sysdate,?,?,?,?,?,?,?,?,?,?,?,"
            + " '1','0','0','0','0','0','0','0','0')";
			
 /**
	 * 插入质量设计主表
	 */
	public static String InsertCraftOrdDesignMsc =
			"insert into CRAFT_ORD_DESIGN_MSC"
			+ " (desgin_key,ord_pk,ord_ln_pk,cust_alpha_no,psc, "
         + " psc_desc,msc,msc_desc,msc_style,use_code,use_desc, "
         + " prd_cls,produccode,producname,std_code,std_name, "
         + " steelcode,steelname,std_style,std_style_desc,order_spec_code, "
         + " order_spec_desc,spec_code,spec_name,dimater,height,model_code, "
         + " model_desc,len_no,len_desc,len_unit,len_min,len_max,shrt_len_rato, "
         + " shortest,long_len_rato,longest,shrt_stove,avg_len_min,difrnc_len_max, "
         + " endlen_specstd,sigl_len,order_unit,order_qty,ord_ensu_totl_len, "
         + " prdct_wgt,delvry_range_tpe,delvry_range_min,delvry_range_max, "
         + " final_user,final_user_desc,outs_billet_fl,outs_stl_pipe_fl, "
         + " assel_fl,producer_fl,prdcr_no,prdcr_desc,mps_fl,mps_no,mps_desc, "
         + " delvry_bdate,delvry_edate,delvry_desc,trans_desc,add_ask_no, "
         + " order_add_desc,order_special_fl,order_special_head,order_special_path, "
         + " order_special_desc,zbs,order_price,trans_price,test_id,test_price, "
         + " out_price,balnce_price,be_order_ln_status,be_obj_sts_op,order_ln_status, "
         + " obj_sts_op,memo,prd_len,loss_rate,validflag,create_name,create_time, "
         + " ord_ln_pk_old,file_jpeg,judgeflag,order_seq) values (sys_guid(),?,?,?,?,?,?,?,?"
         + ",?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
         + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
         + "?,?,?,?,sysdate,?,?,?,?)";
	
	/**
	 * 插入质量设计-成分表
	 */
	public static String InsertCraftOrdDesignStdCic =
			" insert into CRAFT_ORD_DESIGN_STD_CIC "
			+ "(DESGIN_KEY,CIC,SPECL_FL,INDEX_SEQ,CHEM_CODE,CHEM_NAME,CHEM_TYPE,CHEM_FORMULA,ISCHECK,ISJUDGE,ISQUOTE,"
			+ " COMPLEX_TYPE,STDMIN_SIGN,STDMIN,STDMAX_SIGN,STDMAX,VALIDFLAG,CREATE_NAME,CREATE_TIME,MSC_PLINE,PROCESS_CODE, "
			+ " CRAFT_SOURCE,CIC_MEMO,JUAGEFLAG,STDTARGET ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-公差表
	 */
	public static String InsertCraftOrdDesignStdSic =
			" INSERT INTO CRAFT_ORD_DESIGN_STD_SIC "
			+ " (DESGIN_KEY,SIC,SPECL_FL,INDEX_SEQ,BIAS_CODE,BIAS_NAME,ISCHECK,STD_MIN_VAL,STD_MAX_VAL,STD_MIN_PERCENT,"
			+ " STD_MAX_PERCENT,STD_MIN_FORMULA,STD_MAX_FORMULA,STD_MIN_FORMULA_V,STD_MAX_FORMULA_V,MSC_PLINE,PROCESS_CODE,CREATE_NAME,CREATE_TIME,CRAFT_SOURCE, BIAS_CODE_Z, "
            + " BIAS_NAME_Z,ZMIN_SIGN,ZMIN,ZMAX_SIGN,ZMAX,BIAS_CODE_C,BIAS_NAME_C,CMIN_SIGN,CMIN,CMAX_SIGN,CMAX,BIAS_CODE_S, "
            + " BIAS_NAME_S,SMIN_SIGN,SMIN,SMAX_SIGN,SMAX) "
			+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-加工表
	 */
	public static String InsertCraftOrdDesignStdGic =
			" insert into CRAFT_ORD_DESIGN_STD_GIC "
			+ " (DESGIN_KEY,GIC,SPECL_FL,XH,PROCESS_CDOE,PROCESS_DESC,PROCESS_CDOE_C,PROCESS_DESC_C,STATION_CODE,STATION_DESC, "
			+ " VALUE_TEXT,VALUE_NUM,VALUE_MEMO,MSC_PLINE,PROCESS_CODE,CREATE_NAME,CREATE_TIME,CRAFT_SOURCE )"
			+ " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?)";
	/**
	 * 插入质量设计-理化表
	 */
	public static String InsertCraftOrdDesignStdPic =
			" insert into CRAFT_ORD_DESIGN_STD_PIC "
			+ " (DESGIN_KEY,PIC,USE_CODE,USE_DESC,SPECL_FL,INDEX_SEQ,PHY_CODE_MAX,PHY_NAME_MAX,PHY_CODE_MIN,PHY_NAME_MIN,"
			+ " PHY_CODE,PHY_NAME,ITEM_CODE_F,ITEM_NAME_F,ITEM_CODE_W,ITEM_NAME_W,ITEM_CODE_S,ITEM_NAME_S,GROUP_SEQ,ISCHECK,"
			+ " ISQUOTE,RESULT_COUNT,ISJUDGE,PHY_TYPE,PHY_FORMULA,STDMIN_SIGN,STDMIN,STDMAX_SIGN,STDMAX,JUDGE_BASIS,DELIVERYSTATE, "
            + " MODEL_CODE,MODEL_DESC,STDMEMO,SIZE_CODE,SIZE_NAME,SIZE_MIN_SIGN,SIZE_MIN,SIZE_MAX_SIGN,SIZE_MAX,SIZE_CODE2,SIZE_NAME2, "
            + " SIZE_MIN_SIGN2,SIZE_MIN2,SIZE_MAX_SIGN2,SIZE_MAX2,SPEC_JG,SPEC_JG_DESC,ADDCONDITION,ADDSTDCON_CODE,ADDSTD_MIN_SIGN, "
            + " ADDSTD_MIN,ADDSTD_MAX_SIGN,ADDSTD_MAX,ADDPERCENT,STDMIN_SIGN2,STDMIN2,STDMAX_SIGN2,STDMAX2,STD_CHOOSE,MSC_PLINE,PROCESS_CODE, "
            + " BILLET_SAMPLE,CREATE_NAME,CREATE_TIME,CRAFT_SOURCE,PIC_MEMO,FORMULA,MIN_F,MIN_F_SIGN,MAX_F,MAX_F_SIGN,PHY_MIN_SEQ,IS_PRODUCT_CHECK) "
            + " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
            + " ?,?,SYSDATE,?,?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-理化-取样要求
	 */
	public static String InsertCraftOrdDesignStdPicSmp =
			"insert into CRAFT_ORD_DESIGN_STD_PIC_SMP "
			+ " (DESGIN_KEY,PIC,SIC,PHY_CODE_MIN,PHY_NAME_MIN,STD_CODE,STD_NAME,LENGTH,DESC_LENGTH,RATE,DESC_RATE,DESC_COUNT,POSITION,DESC_POSITION, "
            + " SAMPLE_COUNT,MEMO,SAMPLE_STYLE,BATCH_CNT,WIDTH,BATCH_UNIT,EIC,PHY_DIR,SIZE_DESC,ITEM_CODE_F,ITEM_CODE_C,ITEM_CODE_W,SAMPLE_KEY, "
            + " SAMPLE_KEY_DESC,STD_CODE_TEST,STD_NAME_TEST,SPLINE_ITEM_CODE_S,SPLINE_ITEM_NAME_S,SPLINE_ITEM_CODE_F,SPLINE_ITEM_NAME_F,PROCESS_CODE, "
            + " PROCESS_DESC,MSC_PLINE,ATTACH_PERCENT,ATTACH_COUNT,TOP_STOVE,LOOP_VALUE,SSC_CONDITION,EXCLUDE_PHY_MIN,CRAFT_SOURCE,COMMON) VALUES (?"
            + ",?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-制程
	 */
	public static String InsertCraftOrdDesignMscPl =
			" insert into CRAFT_ORD_DESIGN_MSC_PL "
			+ " (DESGIN_KEY,MSC_PLINE,WHOLE_BACKLOG,WHOLE_BACKLOG_DESC,SET_FL,ORD_LN_PK,VALIDFLAG,AUTO_CRAFT)"
			+ " values (?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-制程钢种
	 */
	public static String InsertCraftOrdDesignMscPlGz =
			" insert into Craft_Ord_Design_Msc_Pl_Gz "
			+ " (DESGIN_KEY,MSC_PLINE,WHOLE_BACKLOG,WHOLE_BACKLOG_DESC,GRADECODE,GRADENAME,ASSORTMENT_CODE,ASSORTMENT_NAME,"
			+ " MANAGE_CATEGORY,PRIORITY) values (?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-制程工序适用产线
	 */
	public static String InsertCraftOrdDesignMscPlGxPrl =
			" insert into CRAFT_ORD_DESIGN_MSC_PL_GX_PRL "
			+ " (DESGIN_KEY,MSC_PLINE,BACKLOG_SEQ,PROCESS_CODE,PLINE_CODE,PLINE_NAME,WELL_CODE,WELL_NAME,WARN_FL,WARN_DESC,"
			+ " VALIDFLAG,IDENT_FLAG) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)";
	
	/**
	 * 插入质量设计-探伤表
	 */
	public static String InsertCraftOrdDesignStdDic =
			" insert into CRAFT_ORD_DESIGN_STD_DIC "
			+ " (DESGIN_KEY,DIC,USE_CODE,USE_DESC,SPECL_FL,XH,PHY_CODE,PHY_NAME, "
         + " POSITION_CODE,POSITION_DESC,STD_DESC,LV_CODE,LV_DESC,GROOVE_POS, "
         + " GROOVE_DIR,COVERAGE,RATE,DESC_RATE,DESC_VAL,GROUP_SEQ,MEMO,MIN_D, "
         + " MAX_D,MIN_H,MAX_H,MSC_PLINE,PROCESS_CODE,CREATE_NAME,CREATE_TIME, "
         + " CRAFT_SOURCE,DIC_MEMO) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?"
         + " ,?,?,?,?,?,?,sysdate,?,?)";
	/**
	 * 插入质量设计-附加要求
	 */
	public static String InsertCraftOrdDesignAddAsk =
			" insert into CRAFT_ORD_DESIGN_ADD_ASK "
			+ " (DESGIN_KEY,ASK_ITME,ASK_ITME_DESC,ASK_SUB_ITME,ASK_SUB_ITME_DESC,ASK_SUB_ITME_VAL,ASK_SUB_ITME_VAL_DESC,"
			+ " DESCRIPTION_ALL,DESCRIPTION_DIFF,PIC) VALUES (?,?,?,?,?,?,?,?,?,?) ";
	/**
	 * 插入质量设计-生产周期状态
	 */
	public static String InsertCraftOrdDesignStsPlPc =
			" insert into CRAFT_ORD_DESIGN_STS_PL_PC "
			+ " (DESGIN_KEY,ORD_LN_PK,ORD_LN_DLY_PK,MSC_PLINE,WHOLE_BACKLOG,WHOLE_BACKLOG_DESC,PRDCYC_MEET,VALIDFLAG,CREATE_NAME,CREATE_TIME)"
			+ " values (?,?,?,?,?,?,?,?,?,sysdate)";
	/**
	 * 插入质量设计-生产周期状态明细
	 */
	public static String InsertCraftOrdDesignStsPlPcLst =
			" insert into CRAFT_ORD_DESIGN_STS_PL_PC_LST "
			+ " (DESGIN_KEY,ORD_LN_PK,ORD_LN_DLY_PK,MSC_PLINE,WHOLE_BACKLOG,WHOLE_BACKLOG_DESC,PROCESS_CDOE,PROCESS_DESC,"
			+ " PRDCYC_MEET,VALIDFLAG,CREATE_NAME,CREATE_TIME) values (?,?,?,?,?,?,?,?,?,?,?,sysdate)";
	/**
	 * 插入质量设计-全制程工序点
	 */
	public static String InsertCraftOrdDesignStsPlSti =
			" insert into CRAFT_ORD_DESIGN_MSC_PL_STI "
			+ " (DESGIN_KEY,MSC_PLINE,WHOLE_BACKLOG,WHOLE_BACKLOG_DESC,BACKLOG_SEQ,PROCESS_CODE,PROCESS_DESC,PROCESS_SEQ, "
            + " PROCESS_CODE_C,PROCESS_DESC_C,STATION_ID,STATION_CODE,STATION_DESC,STATION_TYPE,CRAFTITEM_CODE,CRAFTITEM_DESC) "
            + " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-钢种及物料内控
	 */
	public static String InsertCraftOrdDesignMscPlPrc =
			" insert into CRAFT_ORD_DESIGN_MSC_PL_PRC "
			+ " (DESGIN_KEY,MSC_PLINE,WHOLE_BACKLOG,WHOLE_BACKLOG_DESC,BACKLOG_SEQ,PROCESS_CODE,PROCESS_DESC,PROCESS_SEQ, "
			+ " PROCESS_CODE_C,PROCESS_DESC_C,MINUTE_PRODUCT,MINUTE_PRODUCT_OUT,MINUTE_WAITE,MINUTE_WAITE_OUT,BATCH_WAITE, "
			+ " BATCH_WAITE_OUT,CIC,PIC,SIC,DIC,WIC,GIC,MEMO,PROCESS_FILE) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	/**
	 * 插入质量设计-交付标准表
	 */
	public static String InsertCraftOrdDesignStd =
			" insert into CRAFT_ORD_DESIGN_STD "
			+ " (DESGIN_KEY,CIC,PIC,SIC,DIC,WIC,GIC,SMELTING_CNT,PRODUCT_CNT,CIC_N,PIC_N, "
			+ " SIC_N,DIC_N,WIC_N,GIC_N,SMELTING_CNT_N,PRODUCT_CNT_N,CIC_BAIS,CIC_N_BAIS,RATE,RATE_N)"
			+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
	
	/**
	 * 插入质量设计-水压表
	 */
	public static String InsertCraftOrdDesignStdWic =
			" insert into CRAFT_ORD_DESIGN_STD_WIC "
			+ " (DESGIN_KEY,WIC,USE_CODE,USE_DESC,SPECL_FL,INDEX_SEQ,PRESSURE_Y,PRESSURE,"
			+ " FORMULA,SAVE_TIME,GET_MAXVALUE,GET_MINVALUE,RATIO_STD,RATIO_REPLACE,MAX_PRESS,"
			+ " MSC_PLINE,PROCESS_CODE,CREATE_NAME,CREATE_TIME,CRAFT_SOURCE,WIC_MEMO,ROUND_RULE, "
         + " MEMO,OUTPUT_STYLE,ZBS_OUTPUT_STYLE,PRESSURE_BAR) VALUES (?,?,?,?,?,?,?,?,?,?,?,?"
         + ",?,?,?,?,?,?,SYSDATE,?,?,?,?,?,?,?)";
	/**
	 * 插入接口日志表
	 */
	public static String InsertCxToMesLog =
			" insert into cx_to_mes_log "
			+ "  (SOCKET_NAME,SOCKET_PARMER,SOCKET_TIME,KEY,OPERATE_RESULT) "
			+ " values (?,?,sysdate,?,?)";
	
	/**
	 * 插入质量设计-水压首日检
	 */
	public static String InsertCraftOrdFdWic =
			" insert into CRAFT_ORD_FD_WIC"
			+ " (ORD_LN_PK,INDEX_SEQ,PRESSURE_Y,PRESSURE,FORMULA,SAVE_TIME,GET_MAXVALUE, "
         + " GET_MINVALUE,RATIO_STD,RATIO_REPLACE,MAX_PRESS,MSC_PLINE,PROCESS_CODE, "
         + "CREATE_NAME,CREATE_TIME,WIC_MEMO,ROUND_RULE,MEMO,ORD_SEQ,WIC,OUTPUT_STYLE)"
         + " VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?,?,?,?,?,?)";
	
	/**
	 * 插入质量设计-设计状态主表
	 */
	public static String InsertCraftOrdDesignStsTklg =
			" insert into CRAFT_ORD_DESIGN_STS_TKLG"
			+ " (DESGIN_KEY,ORD_LN_PK,DESIGN_STS,PRDCYC_MEET,VALIDFLAG,CREATE_NAME,CREATE_TIME)"
			+ " VALUES(?,?,?,?,?,?,SYSDATE)";
	
	public static String queryCRAFT_ORD_DESIGN_STS_TKLG_LST =
			"select A.DESGIN_KEY,A.ORD_LN_PK,A.SEQ_INDEX,A.LST_ITEM,A.DESIGN_STS,A.DESIGN_STS_RS, "
	                  + " A.DESIGN_STS_DESC,A.PSC,A.MSC,A.USE_CODE,A.FINAL_USER,A.GRADECODE,A.DESIGN_OBJ_KEY, "
	                  + " A.UNIT_CODE,A.UNIT_DESC,A.VALIDFLAG,A.CREATE_NAME,A.CREATE_TIME,A.UPDATE_NAME, "
	                  + " A.UPDATE_TIME,A.DELETE_NAME,A.DELETE_TIME from CRAFT_ORD_DESIGN_STS_TKLG_LST a where a.desgin_key = '3c57083cf8344cceb83d4455f2435c02'";
	
	/**
	 * 插入质量设计-设计状态从表
	 */
	public static String InsertCraftOrdDesignStsTklgLst =
			" insert into CRAFT_ORD_DESIGN_STS_TKLG_LST"
			+ " (DESGIN_KEY,ORD_LN_PK,SEQ_INDEX,LST_ITEM,DESIGN_STS,DESIGN_STS_RS,DESIGN_STS_DESC, "
         + " PSC,MSC,USE_CODE,FINAL_USER,GRADECODE,DESIGN_OBJ_KEY,UNIT_CODE,UNIT_DESC, "
         + " VALIDFLAG,CREATE_NAME,CREATE_TIME)"
         + " VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE)";
	
	/**
	 * 质量设计-成分首日检主表
	 */
	public static String InsertCraftOrdFdCic =
			" insert into Craft_Ord_Fd_Cic"
			+ "(ORD_LN_PK,CIC,INDEX_SEQ,CHEM_CODE,CHEM_NAME,CHEM_TYPE,CHEM_FORMULA,ISCHECK,ISJUDGE, "
         + " ISQUOTE,COMPLEX_TYPE,STDMIN_SIGN,STDMIN,STDMAX_SIGN,STDMAX,STDTARGET,STDMEMO, "
         + " ELE_CODE,ELE_NAME,ELE_MIN_SIGN,ELE_MIN,ELE_MAX_SIGN,ELE_MAX,VALIDFLAG,CREATE_NAME, "
         + " CREATE_TIME,REP_CODE,REP_NAME,REP_MIN_SIGN,REP_MIN,REP_MAX_SIGN,REP_MAX,REP_VAL, "
         + " MSC_PLINE,PROCESS_CODE,CIC_MEMO,ORD_SEQ)"
         + " VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,sysdate,?,?,?,?,?,?,?,?,?,?,?)";
	
	/**
	 * 质量设计-成分首日检从表
	 */
	public static String InsertCraftOrdFdCicCount =
			" insert into CRAFT_ORD_FD_CIC_COUNT"
			+ "(ORD_LN_PK,SMELTING_CNT_FD,PRODUCT_CNT_FD,RATE_FD,COMMON)"
			+ " values (?,?,?,?,?)";
	
	/**
	 * 质量设计-理化首日检主表
	 */
	public static String InsertCraftOrdFdPic =
			" insert into CRAFT_ORD_FD_PIC"
			+ " (ORD_LN_PK,INDEX_SEQ,PHY_CODE_MAX,PHY_NAME_MAX,PHY_CODE_MIN,PHY_NAME_MIN, "
         + " PHY_CODE,PHY_NAME,ITEM_CODE_F,ITEM_NAME_F,ITEM_CODE_W,ITEM_NAME_W,ITEM_CODE_S, "
         + " ITEM_NAME_S,ISCHECK,ISQUOTE,RESULT_COUNT,ISJUDGE,PHY_TYPE,PHY_FORMULA,STDMIN_SIGN, "
         + " STDMIN,STDMAX_SIGN,STDMAX,JUDGE_BASIS,STDMEMO,ADDCONDITION,ADDSTDCON_CODE, "
         + " ADDSTD_MIN_SIGN,ADDSTD_MIN,ADDSTD_MAX_SIGN,ADDSTD_MAX,ADDPERCENT,STDMIN_SIGN2, "
         + " STDMIN2,STDMAX_SIGN2,STDMAX2,STD_CHOOSE,MSC_PLINE,PROCESS_CODE,BILLET_SAMPLE, "
         + " CREATE_NAME,CREATE_TIME,ORD_SEQ,PIC,PIC_MEMO) "
         + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
         + " ?,?,?,?,?,?,?,sysdate,?,?,?)";
	
	/**
	 * 质量设计-理化首日检取样要求表
	 */
	public static String InsertCraftOrdFdPicSmp =
			" insert into CRAFT_ORD_FD_PIC_SMP"
			+ " (ORD_LN_PK,PIC,SIC,PHY_CODE_MIN,PHY_NAME_MIN,STD_CODE,STD_NAME,LENGTH,RATE,DESC_RATE, "
         + " DESC_COUNT,POSITION,DESC_POSITION,SAMPLE_COUNT,MEMO,BATCH_CNT,WIDTH,BATCH_UNIT, "
         + " EIC,PHY_DIR,SIZE_DESC,ITEM_CODE_F,ITEM_CODE_C,ITEM_CODE_W,SAMPLE_KEY,SAMPLE_KEY_DESC,"
         + " STD_CODE_TEST,STD_NAME_TEST,SPLINE_ITEM_CODE_S,SPLINE_ITEM_NAME_S,SPLINE_ITEM_CODE_F, "
         + " SPLINE_ITEM_NAME_F,PROCESS_CODE,PROCESS_DESC,MSC_PLINE,ATTACH_PERCENT,ATTACH_COUNT, "
         + " TOP_STOVE,LOOP_VALUE,SSC_CONDITION,EXCLUDE_PHY_MIN,SAMPLE_STYLE,ORD_SEQ,COMMON) "
         + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	
	/**
	 * 删除工艺评审
	 */
	public static String deleteCraftOrdDesign =
			" delete from CRAFT_ORD_DESIGN where  ord_ln_pk = ?";
	
	/**
	 * 删除质量设计-MSC（主记录）
	 */
	public static String deleteCraftOrdDesignMsc =
			" delete from CRAFT_ORD_DESIGN_MSC where  DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-制程
	 */
	
	public static String deleteCraftOrdDesignMscPl =
			" delete from CRAFT_ORD_DESIGN_MSC_PL where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-制程钢种
	 */
	
	public static String deleteCraftOrdDesignMscPlGz =
			" delete from CRAFT_ORD_DESIGN_MSC_PL_GZ where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-制程适用产线
	 */
	
	public static String deleteCraftOrdDesignMscPlGxPrl =
			" delete from CRAFT_ORD_DESIGN_MSC_PL_GX_PRL where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-钢种及物料
	 */
	
	public static String deleteCraftOrdDesignMscPlPrc =
			" delete from CRAFT_ORD_DESIGN_MSC_PL_PRC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-全程工序点
	 */
	
	public static String deleteCraftOrdDesignMscPlSti =
			" delete from CRAFT_ORD_DESIGN_MSC_PL_STI where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-交付标准
	 */
	
	public static String deleteCraftOrdDesignStd =
			" delete from CRAFT_ORD_DESIGN_STD where  DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-成品成分允许偏差
	 */
	
	public static String deleteCraftOrdDesginStdBiasC =
			" delete from CRAFT_ORD_DESIGN_STD_BIAS_C where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-成分
	 */
	
	public static String deleteCraftOrdDesignStdCic =
			" delete from CRAFT_ORD_DESIGN_STD_CIC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-探伤
	 */
	
	public static String deleteCraftOrdDesignStdDic =
			" delete from CRAFT_ORD_DESIGN_STD_DIC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-加工
	 */
	
	public static String deleteCraftOrdDesignStdGic =
			" delete from CRAFT_ORD_DESIGN_STD_GIC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-理化
	 */
	
	public static String deleteCraftOrdDesignStdPic =
			" delete from CRAFT_ORD_DESIGN_STD_PIC where  DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-理化-取样要求
	 */
	
	public static String deleteCraftOrdDesignStdPicSmp =
			" delete from CRAFT_ORD_DESIGN_STD_PIC_SMP where DESGIN_KEY = ?" ;
	
	/**
	 * 删除质量设计-公差
	 */
	
	public static String deleteCraftOrdDesignStdSic =
			" delete from CRAFT_ORD_DESIGN_STD_SIC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-水压
	 */
	
	public static String deleteCraftOrdDesignStdWic =
			" delete from CRAFT_ORD_DESIGN_STD_WIC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-制程-生产周期主表
	 */
	
	public static String deleteCraftOrdDesignStsPlPc =
			" delete from CRAFT_ORD_DESIGN_STS_PL_PC where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-制程-生产周期从表
	 */
	
	public static String deleteCraftOrdDesignStsPlPcLst =
			" delete from CRAFT_ORD_DESIGN_STS_PL_PC_LST where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-设计状态主表
	 */
	
	public static String deleteCraftOrdDesignStsTklg =
			" delete from CRAFT_ORD_DESIGN_STS_TKLG where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-设计状态从表
	 */
	
	public static String deleteCraftOrdDesignStsTklgLst =
			" delete from CRAFT_ORD_DESIGN_STS_TKLG_LST where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-成分首日检主表
	 */
	
	public static String deleteCraftOrdFdCic =
			" delete from CRAFT_ORD_FD_CIC where ORD_LN_PK = ?";
	
	/**
	 * 删除质量设计-成分首日检从表
	 */
	
	public static String deleteCraftOrdFdCicCount =
			" delete from CRAFT_ORD_FD_CIC_COUNT where ORD_LN_PK = ?";
	
	/**
	 * 删除质量设计-理化首日检主表
	 */
	
	public static String deleteCraftOrdFdPic =
			" delete from CRAFT_ORD_FD_PIC where ORD_LN_PK = ?";
	
	/**
	 * 删除质量设计-理化首日检从表
	 */
	
	public static String deleteCraftOrdFdPicSmp =
			" delete from CRAFT_ORD_FD_PIC_SMP where ORD_LN_PK = ?";
	
	/**
	 * 删除质量设计-水压首日检
	 */
	
	public static String deleteCraftOrdFdWic =
			" delete from CRAFT_ORD_FD_WIC where ORD_LN_PK = ?";
	
	/**
	 * 删除质量设计-BOM主表
	 */
	
	public static String deleteCraftOrdLineBom =
			" delete from CRAFT_ORD_LINE_BOM where DESGIN_KEY = ?";
	
	/**
	 * 删除质量设计-BOM清单
	 */
	
	public static String deleteSlmOrdDesignBom =
			" delete from SLM_ORD_DESIGN_BOM where BOM = ?";
	
	/**
	 * 删除质量设计-BOM电炉
	 */
	
	public static String deleteSlmOrdDesignBomA =
			" delete from SLM_ORD_DESIGN_BOM_A where BOM = ?";
	
	/**
	 * 删除质量设计-BOM铸造
	 */
	
	public static String deleteSlmOrdDesignBomB =
			" delete from SLM_ORD_DESIGN_BOM_B where BOM = ?";
	
	/**
	 * 删除质量设计-BOM锻造
	 */
	
	public static String deleteSlmOrdDesignBomC =
			" delete from SLM_ORD_DESIGN_BOM_C where BOM = ?";
	
	/**
	 * 删除质量设计-BOM轧管
	 */
	
	public static String deleteSlmOrdDesignBomD =
			" delete from SLM_ORD_DESIGN_BOM_D where BOM = ?";
	
	/**
	 * 删除质量设计-BOM墩拔扩
	 */
	
	public static String deleteSlmOrdDesignBomE =
			" delete from SLM_ORD_DESIGN_BOM_E where BOM = ?";
	
	/**
	 * 删除质量设计-BOM热处理
	 */
	
	public static String deleteSlmOrdDesignBomF =
			" delete from SLM_ORD_DESIGN_BOM_F where BOM = ?";
	
	/**
	 * 删除质量设计-BOM加工
	 */
	
	public static String deleteSlmOrdDesignBomK =
			" delete from SLM_ORD_DESIGN_BOM_K where BOM = ?";
	
	/**
	 * 删除质量设计-附加要求
	 */
	
	public static String deleteCraftOrdDesignAddAsk =
			" delete from CRAFT_ORD_DESIGN_ADD_ASK where DESGIN_KEY = ?";
	
	/**
	 * 查询工艺评审  主记录
	 */
	
	public static String getCraftMsc =
			" SELECT DESGIN_KEY, ORD_PK, ORD_LN_PK, ORDER_SEQ, CUST_ALPHA_NO, PSC, PSC_DESC, MSC, MSC_DESC, MSC_STYLE, USE_CODE, USE_DESC, PRD_CLS, PRODUCCODE, "
 + " PRODUCNAME, STD_CODE, STD_NAME, STEELCODE, STEELNAME, STD_STYLE, STD_STYLE_DESC, ORDER_SPEC_CODE, ORDER_SPEC_DESC, SPEC_CODE, SPEC_NAME, DIMATER, "
 + "  HEIGHT, MODEL_CODE, MODEL_DESC, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, SHRT_LEN_RATO, SHORTEST, LONG_LEN_RATO, LONGEST, SHRT_STOVE, AVG_LEN_MIN,  "
 + "  DIFRNC_LEN_MAX, ENDLEN_SPECSTD, SIGL_LEN, ORDER_UNIT, ORDER_QTY, ORD_ENSU_TOTL_LEN, PRDCT_WGT, DELVRY_RANGE_TPE, DELVRY_RANGE_MIN, DELVRY_RANGE_MAX, "
 + "   FINAL_USER, FINAL_USER_DESC, OUTS_BILLET_FL, OUTS_STL_PIPE_FL, ASSEL_FL, PRODUCER_FL, PRDCR_NO, PRDCR_DESC, MPS_FL, MPS_NO, MPS_DESC, DELVRY_BDATE, "
 + "    DELVRY_EDATE, DELVRY_DESC, TRANS_DESC, ADD_ASK_NO, ORDER_ADD_DESC, ORDER_SPECIAL_FL, ORDER_SPECIAL_HEAD, ORDER_SPECIAL_PATH, ORDER_SPECIAL_DESC, ZBS, "
 + "     ORDER_PRICE, TRANS_PRICE, TEST_ID, TEST_PRICE, OUT_PRICE, BALNCE_PRICE, BE_ORDER_LN_STATUS, BE_OBJ_STS_OP, ORDER_LN_STATUS, OBJ_STS_OP, MEMO, PRD_LEN, "
 + "      LOSS_RATE, VALIDFLAG, CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, DELETE_NAME, DELETE_TIME, ORD_LN_PK_OLD FROM CRAFT_ORD_DESIGN_MSC T WHERE T.DESGIN_KEY=?";
	
	/**
	 * 查询工艺评审设计 适用产线
	 */
	
	public static String getProline =
			"SELECT DESGIN_KEY, "
            + "   MSC_PLINE,  "
            + "    BACKLOG_SEQ,  "
            + "    PROCESS_CODE,  "
            + "    PLINE_CODE,  "
            + "    PLINE_NAME,  "
            + "    WELL_CODE,  "
            + "    WELL_NAME,  "
            + "    WARN_FL,  "
            + "    WARN_DESC  "
          + " FROM CRAFT_ORD_DESIGN_MSC_PL_GX_PRL T  "
         + " WHERE T.DESGIN_KEY = ?  "
          + "  AND T.MSC_PLINE = ?";
	
	/**
	 * 查询工艺评审 钢种
	 */
	
	public static String getGrade =
			"SELECT DESGIN_KEY, "
            +"       MSC_PLINE, "
            +"        WHOLE_BACKLOG, "
            +"        WHOLE_BACKLOG_DESC, "
            +"        GRADECODE, "
            +"        GRADENAME, "
            +"        ASSORTMENT_CODE, "
            +"        ASSORTMENT_NAME "
            +"   FROM CRAFT_ORD_DESIGN_MSC_PL_GZ T "
            +"  WHERE T.DESGIN_KEY = ? "
            +"    AND T.MSC_PLINE = ?";
	
	/**
	 * 查询工序信息
	 */
	public static String getOperation =
			"SELECT DESGIN_KEY, "
       + " MSC_PLINE, "
       + " WHOLE_BACKLOG, "
       + " WHOLE_BACKLOG_DESC, "
       + " BACKLOG_SEQ, "
       + " PROCESS_CODE, "
       + " PROCESS_DESC, "
       + " PROCESS_SEQ, "
       + " PROCESS_CODE_C, "
       + " PROCESS_DESC_C, "
       + " MINUTE_PRODUCT, "
       + " MINUTE_PRODUCT_OUT, "
       + " MINUTE_WAITE, "
       + " MINUTE_WAITE_OUT, "
       + " BATCH_WAITE, "
       + " BATCH_WAITE_OUT, "
       + " CIC, "
       + " PIC, "
       + " SIC, "
       + " DIC, "
       + " WIC, "
       + " GIC "
       + " FROM CRAFT_ORD_DESIGN_MSC_PL_PRC T "
       + " WHERE T.DESGIN_KEY = ? "
       + " AND T.MSC_PLINE = ? "
       + " AND T.PROCESS_CODE = ?";
	
	/**
	 * 查询工艺评审 制程
	 */
	public static String getProDuc =
			" SELECT DESGIN_KEY, MSC_PLINE, WHOLE_BACKLOG, WHOLE_BACKLOG_DESC, SET_FL "
            +"  FROM CRAFT_ORD_DESIGN_MSC_PL T "
            +"  WHERE T.DESGIN_KEY = ?";
	
	/**
	 * 查询工艺评审 轧管规格
	 */
	public static String getRollSpec =
			"SELECT DESGIN_KEY, "
            + "       MSC_PLINE, "
            + "        GRADECODE, "
            + "        GRADENAME, "
            + "        SPEC_CODE, "
            + "        SPEC_NAME, "
            + "        DIMATER, "
            + "        HEIGHT "
            + "   FROM CRAFT_ORD_DESIGN_MSC_GZ_GG T "
            + "  WHERE T.DESGIN_KEY = ? "
            + "    AND T.MSC_PLINE = ?";
	/**
	 * 查询工艺评审 锻造规格
	 */
	public static String getBiltSpec =
			" SELECT DESGIN_KEY, MSC_PLINE, SPEC_CODE, B_SPEC_CODE, B_SPEC_NAME "
            + "   FROM CRAFT_ORD_DESIGN_MSC_BILT T "
            + "   WHERE T.DESGIN_KEY = ? "
            + "     AND T.MSC_PLINE = ?";
	/**
	 * 查询工艺评审 铸造规格
	 */
	public static String getBiltCSpec =
			" SELECT DESGIN_KEY, "
            + "   MSC_PLINE, "
            + "    SPEC_CODE, "
            + "    B_SPEC_CODE, "
            + "    C_SPEC_CODE, "
            + "    C_SPEC_NAME "
         + "  FROM CRAFT_ORD_DESIGN_MSC_BILT_C T "
         + " WHERE T.DESGIN_KEY = ? "
         + "   AND T.MSC_PLINE = ?";
	/**
	 * 查询产品大类
	 */
	public static String getProductCode =
			"SELECT T.PRODUCCODE, "
            + "            T.PRODUCNAME, "
            + "            T.PRODUC_STYLE, "
            + "            T.PRODUC_DESC, "
            + "            T.HAVEJG, "
            + "            T.MEMO, "
            + "            T.PRODUC_JX, "
            + "            T.PRODUC_ENG, "
            + "            T.PRODUCCODE_OLD, "
            + "            T.PRODUC_TYPE, "
            + "            T.PRODUC_HEAD, "
            + "            I.BASENAME "
            + "       FROM COM_BASE_PRODUCT T "
            + "       JOIN COM_BASE_INFO I "
            + "         ON T.PRODUC_HEAD = I.BASECODE "
            + "      WHERE T.PRODUCCODE = ?";
	/**
	 * 释放库存
	 */
	public static String TakeOffLine =
			"UPDATE MAT_ZC_M T "
	 	 
   + " SET T.ORDER_NO      = '', "
   + "     T.ORDER_SEQ     = '', "
   + "     T.ORDER_SEQ_NO  = '', "
   + "     T.ORD_PK        = '', "
   + "     T.ORD_LN_PK     = '', "
   + "     T.ORD_LN_DLY_PK = '', "
   + "     T.PRODUCT_FLAG  = '801402', "
   + "     T.MAT_STATUS    = '80150202' "
   + "  WHERE T.ORD_LN_PK = ? "
   + "  AND T.PRODUCT_FLAG = '801403' "
   + "  AND T.MAT_STATUS = '80150301'";
	/**
	 * 插入采购协议管理
	 */
	public static String InsertComBasePurcahseAgreement =
			" insert into COM_BASE_PURCHASE_AGREEMENT "
			+ "(AGREEMENT_CODE,AGREEMENT_DESC,MEMO,CREATE_NAME,CREATE_TIME, "
            + " VALIDFLAG,STD_CODE_NK,STD_NAME_NK)"
            + " VALUES (?,?,?,?,SYSDATE,?,?,?)";
	/**
	 * 删除采购协议管理
	 */
	public static String DeleteComBasePurcahseAgreement =
			"delete from  COM_BASE_PURCHASE_AGREEMENT  where AGREEMENT_CODE = ?";
	
	/**
	 * 插入基础标准表
	 */
	public static String InsertComBaseStd =
			" insert into COM_BASE_STD "
			+ " (STD_CODE,STD_NAME,STDSTYLE,DEPARTMENT_CODE,DEPARTMENT_DESC, "
            + " UNIT_CODE,UNIT_DESC,CREATE_NAME,CREATE_TIME,VALIDFLAG,MEMO, "
            + " PROCESS_CODE,PROCESS_DESC,ACCEPT_BID,PURCHASE_STD,FORBIDDEN_ORDER)"
            + " VALUES (?,?,?,?,?,?,?,?,SYSDATE,?,?,?,?,?,?,?)";
	
	/**
	 * 删除基础标准表
	 */
	public static String DeleteComBaseStd =
			"delete from  COM_BASE_STD  where STD_CODE = ?";
	/**
	 * 插入化学元素标准索引表
	 */
	public static String InsertComMscStdCic =
			" insert into COM_MSC_STD_CIC "
			+ " (CIC,PSC,MSC,STDSTYLE,STD_CODE_NK,STD_NAME_NK,PROCESS_CODE,PROCESS_DESC, "
            + " GRADECODE,GRADENAME,STD_CODE,STD_NAME,CREATE_NAME,CREATE_TIME,"
            + " VALIDFLAG,MEMO,MODEL_CODE,MODEL_DESC, "
            + " PRODUC_HEAD,CODE_JG,STEELCODE_NK,STEELNAME_NK,MODEL_CODE_NK,MODEL_DESC_NK, "
            + " PRODUCCODE_NK,PRODUCNAME_NK,SMELTING_CNT,PRODUCT_CNT,MIN_D,MAX_D,MIN_H,MAX_H, "
            + " MIN_D_SIGN,MAX_D_SIGN,MIN_H_SIGN,MAX_H_SIGN,RATE) "
            + " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	
	/**
	 * 删除化学元素标准索引表
	 */
	public static String DeleteComMscStdCic =
			"delete from  COM_MSC_STD_CIC  where CIC = ?";
	
	/**
	 * 插入化学元素标准表
	 */
	public static String InsertComMscStdChem =
			" insert into COM_MSC_STD_CHEM "
			+ " (CIC,INDEX_SEQ,CHEM_CODE,CHEM_NAME,CHEM_TYPE,CHEM_FORMULA,ISCHECK,ISJUDGE,ISQUOTE,"
			+ " COMPLEX_TYPE,STDMIN_SIGN,STDMIN,STDMAX_SIGN,STDMAX,CREATE_NAME,CREATE_TIME,VALIDFLAG) "
			+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?)";
	
	/**
	 * 删除化学元素标准表
	 */
	public static String DeleteComMscStdChem =
			"delete from  COM_MSC_STD_CHEM  where CIC = ?";
	
	/**
	 * 插入材质标准索引表
	 */
	public static String InsertComMscStdPic =
			" insert into COM_MSC_STD_PIC "
			+ " (PIC,STDSTYLE,STD_CODE_NK,STD_NAME_NK,PROCESS_CDOE,PROCESS_DESC,CREATE_NAME,"
			+ " CREATE_TIME,VALIDFLAG,GRADECODE,GRADENAME,MEMO) VALUES (?,?,?,?,?,?,?,SYSDATE,?,?,?,?)";
	
	/**
	 * 删除材质标准索引表
	 */
	public static String DeleteComMscStdPic =
			"delete from  COM_MSC_STD_PIC  where STD_CODE_NK = ?";
	
	/**
	 * 插入材质标准表
	 */
	public static String InsertComMscStdPhy =
			" insert into COM_MSC_STD_PHY "
			+ " (PIC,INDEX_SEQ,PHY_CODE_MAX,PHY_NAME_MAX,PHY_CODE_MIN,PHY_NAME_MIN,PHY_CODE,PHY_NAME,"
			+ " ISCHECK,ISJUDGE,ISQUOTE,PHY_TYPE,STDMIN_SIGN,STDMIN,STDMAX_SIGN,STDMAX,JUDGE_BASIS,CREATE_NAME,"
			+ " CREATE_TIME,VALIDFLAG,BILLET_SAMPLE) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,?,?)";
	
	/**
	 * 删除材质标准表
	 */
	public static String DeleteComMscStdPhy =
			"delete from  COM_MSC_STD_PHY  where PIC = ?";
	
	/**
	 * 插入采购协议与供应商关系表
	 */
	public static String InsertComBasePurchaseProvider =
			" insert into COM_BASE_PURCHASE_PROVIDER "
			+ " (AGREEMENT_CODE,SUPP_CODE,SUPP_NAME) values (?,?,?)";
	
	/**
	 * 验证 工艺评审-合同行生产BOM
	 */
	public static String checkCraftOrdLineBom =
			" SELECT DESGIN_KEY, BOM "
  + " FROM CRAFT_ORD_LINE_BOM T "
 + " WHERE T.DESGIN_KEY = ? "
  + "  AND T.BOM = ?";
	
	/**
	 * 保存 工艺评审-合同行生产BOM
	 */
	public static String saveCraftOrdLineBom =
			"INSERT INTO CRAFT_ORD_LINE_BOM (DESGIN_KEY, BOM) VALUES (?, ?)";
	
	/**
	 * 保存 基础数据-加工投入产出-产线能力
	 */
	public static String saveBaseMaterialKPl =
			" INSERT INTO SLM_BASE_MATERIAL_K_PL "
  + " (IN_MATERIAL_NO, "
  + "  OUT_MATERIAL_NO, "
  + "  PLINE_CODE, "
  + "  PLINE_NAME, "
  + "  IN_MATERIAL_DESC, "
  + "  OUT_MATERIAL_DESC) "
+ " VALUES "
 + "  (?, ?, ?, ?, ?, ?)";
	
	/**
	 * 验证基础数据-加工投入产出-产线能力
	 */
	public static String checkBaseMaterialKPl =
			"SELECT COUNT(1) COUNT "
            + "  FROM SLM_BASE_MATERIAL_K_PL T "
            + "  WHERE T.IN_MATERIAL_NO = ? " 
            + "    AND T.OUT_MATERIAL_NO = ? "
            + "    AND T.PLINE_CODE = ?";
	/**
	 * 保存基础物料-加工
	 */
	public static String saveBaseMaterialK =
			"INSERT INTO SLM_BASE_MATERIAL_K "
            +"            (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 验证基础物料-加工是否存在相同记录
	 */
	public static String checkBaseMaterialK =
			" SELECT COUNT(*) COUNT "
            + "      FROM SLM_BASE_MATERIAL_K T "
            + "      WHERE T.IN_MATERIAL_NO = ? "
            + "        AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 保存BOM-加工
	 */
	public static String saveBomK =
			" INSERT INTO SLM_ORD_DESIGN_BOM_K "
            + "          (BOM, "
            + "            IN_MATERIAL_NO, "
            + "            IN_MATERIAL_DESC, "
            + "            OUT_MATERIAL_NO, "
            + "            OUT_MATERIAL_DESC, "
            + "            GROUP_NUM, "
            + "            MARK) "
            + "     VALUES "
            + "          (?, ?, ?, ?, ?,?,?)";
	/**
	 * 
	 */
	public static String checkBomK =
			" SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_K T "
 + " WHERE T.BOM = ? "
   + " AND T.IN_MATERIAL_NO = ? "
   + " AND T.OUT_MATERIAL_NO = ? "
   + " AND T.GROUP_NUM=?";
	
	/**
	 * 查询备料码信息
	 */
	public static String getBLInfo =
			"SELECT PSC_BL, "
       +" PRODUCCODE, "
       +" PRODUCNAME, "
       +" STD_CODE, "
       +" STD_NAME, "
       +" STEELCODE, "
       +" STEELNAME, "
       +" STD_STYLE, "
       +" STD_STYLE_DESC, "
       +" MODEL_CODE, "
       +" MODEL_DESC, "
       +" MIN_D, "
       +" MIN_H, "
       +" USE_CODE, "
       +" USE_DESC, "
       +" CREATE_NAME, "
       +" CREATE_TIME, "
       +" UPDATE_NAME, "
       +" UPDATE_TIME, "
       +" DELETE_NAME, "
       +" DELETE_TIME, "
       +" VALIDFLAG, "
       +" MEMO, "
       +" MIN_L, "
       +" MAX_L, "
       +" FILE_JPG "
       +" FROM COM_MSC_BL T "
       +" WHERE T.PSC_BL = ?";
	/**
	 * 查询备料码
	 */
	public static String getBLCodeCraft =
			" SELECT "
       +" T.DESGIN_KEY, "
       +" T.GROUP_NUM, "
       +" T.PSC_BL, "
       +" T.DESGIN_KEY_BL "
 +" FROM Craft_ORD_DESIGN_MSC_BL T "
 +" WHERE "
+" T.DESGIN_KEY =?";
	
	/**
	 * 判断BOM是否存在
	 */
	public static String checkBomCommon =
			"SELECT P.BOM "
  +" FROM (SELECT MATERIAL_NO, "
  +"              MATERIAL_DESC, "
  +"              BOM, "
  +"              BOM_TYP, "
  +"              MSC_PLINE, "
  +"              PROCESS_CODE_CS, "
  +"              WHOLE_BACKLOG, "
  +"              WHOLE_BACKLOG_DESC, "
  +"              MSC, "
  +"              MSC_DESC, "
  +"              GRADECODE, "
  +"              GRADENAME, "
  +"              NVL(SPEC_CODE_C, '/') SPEC_CODE_C, "
  +"              SPEC_NAME_C, "
  +"              NVL(SPEC_CODE_R, '/') SPEC_CODE_R, "
  +"              SPEC_NAME_R, "
  +"              NVL(SPEC_CODE_D, '/') SPEC_CODE_D, "
  +"              SPEC_NAME_D, "
  +"              NVL(SPEC_CODE_Z, '/') SPEC_CODE_Z, "
  +"              SPEC_NAME_Z "
  +"         FROM SLM_ORD_DESIGN_BOM T "
  +"        WHERE T.MATERIAL_NO = ? "
  +"          AND T.MSC_PLINE = ? "
  +"          AND T.WHOLE_BACKLOG = ? "
  +"          AND T.MSC = ? "
  +"          AND T.GRADECODE = ?) P "
 +" WHERE P.SPEC_CODE_C = ? "
 +"   AND P.SPEC_CODE_R = ? "
 +"   AND P.SPEC_CODE_D = ? "
 +"   AND P.SPEC_CODE_Z = ? "
 +"   AND P.PROCESS_CODE_CS=? "
 +"   AND P.WHOLE_BACKLOG=?";
	/**
	 * 保存BOM-轧管
	 */
	public static String saveBomD =
			" INSERT INTO SLM_ORD_DESIGN_BOM_D "
            + "           (BOM, "
            + "             IN_MATERIAL_NO, "
            + "             IN_MATERIAL_DESC, "
            + "             OUT_MATERIAL_NO, "
            + "             OUT_MATERIAL_DESC) "
            + "      VALUES "
            + "             (?, ?, ?, ?, ?)";
	/**
	 * 保存BOM-锻造
	 */
	public static String saveBomC =
			" INSERT INTO SLM_ORD_DESIGN_BOM_C "
            + "           (BOM, "
            + "             IN_MATERIAL_NO, "
            + "             IN_MATERIAL_DESC, "
            + "             OUT_MATERIAL_NO, "
            + "             OUT_MATERIAL_DESC) "
            + "      VALUES "
            + "             (?, ?, ?, ?, ?)";
	/**
	 * 保存BOM-铸造
	 */
	public static String saveBomB =
			" INSERT INTO SLM_ORD_DESIGN_BOM_B "
		            + "           (BOM, "
		            + "             IN_MATERIAL_NO, "
		            + "             IN_MATERIAL_DESC, "
		            + "             OUT_MATERIAL_NO, "
		            + "             OUT_MATERIAL_DESC) "
		            + "      VALUES "
		            + "             (?, ?, ?, ?, ?)";
	/**
	 * 保存BOM-镦拨扩
	 */
	public static String saveBomE =
			" INSERT INTO SLM_ORD_DESIGN_BOM_E "
		            + "           (BOM, "
		            + "             IN_MATERIAL_NO, "
		            + "             IN_MATERIAL_DESC, "
		            + "             OUT_MATERIAL_NO, "
		            + "             OUT_MATERIAL_DESC) "
		            + "      VALUES "
		            + "             (?, ?, ?, ?, ?)";
	/**
	 * 保存BOM-热处理
	 */
	public static String saveBomF =
			" INSERT INTO SLM_ORD_DESIGN_BOM_F "
		            + "           (BOM, "
		            + "             IN_MATERIAL_NO, "
		            + "             IN_MATERIAL_DESC, "
		            + "             OUT_MATERIAL_NO, "
		            + "             OUT_MATERIAL_DESC) "
		            + "      VALUES "
		            + "             (?, ?, ?, ?, ?)";
	/**
	 * 保存BOM电炉
	 */
	public static String saveBomA =
			" INSERT INTO SLM_ORD_DESIGN_BOM_A "
		            + "           (BOM, "
		            + "             IN_MATERIAL_NO, "
		            + "             IN_MATERIAL_DESC, "
		            + "             OUT_MATERIAL_NO, "
		            + "             OUT_MATERIAL_DESC) "
		            + "      VALUES "
		            + "             (?, ?, ?, ?, ?)";
	/**
	 * 保存BOM清单
	 */
	public static String saveBom =
			"INSERT INTO SLM_ORD_DESIGN_BOM( "
        +" MATERIAL_NO, "
        +" MATERIAL_DESC, "
        +" BOM, "
        +" BOM_TYP, "
        +" MSC_PLINE, "
        +" WHOLE_BACKLOG, "
        +" WHOLE_BACKLOG_DESC, "
        +" MSC, "
        +" MSC_DESC, "
        +" GRADECODE, "
        +" GRADENAME, "
        +" SPEC_CODE_C, "
        +" SPEC_NAME_C, "
        +" SPEC_CODE_R, "
        +" SPEC_NAME_R, "
        +" SPEC_CODE_D, "
        +" SPEC_NAME_D, "
        +" SPEC_CODE_Z, "
        +" SPEC_NAME_Z, "
        +" A_IN_MATERIAL_NO, "
        +" A_IN_MATERIAL_DESC, "
        +" A_OUT_MATERIAL_NO, "
        +" A_OUT_MATERIAL_DESC, "
        +" B_IN_MATERIAL_NO, "
        +" B_IN_MATERIAL_DESC, "
        +" B_OUT_MATERIAL_NO, "
        +" B_OUT_MATERIAL_DESC, "
        +" C_IN_MATERIAL_NO, "
        +" C_IN_MATERIAL_DESC, "
        +" C_OUT_MATERIAL_NO, "
        +" C_OUT_MATERIAL_DESC, "
        +" D_IN_MATERIAL_NO, "
        +" D_IN_MATERIAL_DESC, "
        +" D_OUT_MATERIAL_NO, "
        +" D_OUT_MATERIAL_DESC, "
        +" E_IN_MATERIAL_NO, "
        +" E_IN_MATERIAL_DESC, "
        +" E_OUT_MATERIAL_NO, "
        +" E_OUT_MATERIAL_DESC, "
        +" F_IN_MATERIAL_NO, "
        +" F_IN_MATERIAL_DESC, "
        +" F_OUT_MATERIAL_NO, "
        +" F_OUT_MATERIAL_DESC, "
        +" J_IN_MATERIAL_NO, "
        +" J_IN_MATERIAL_DESC, "
        +" J_OUT_MATERIAL_NO, "
        +" J_OUT_MATERIAL_DESC, "
        +" I_IN_MATERIAL_NO, "
        +" I_IN_MATERIAL_DESC, "
        +" I_OUT_MATERIAL_NO, "
        +" I_OUT_MATERIAL_DESC, "
        +" PROCESS_CODE_CS) "
 +" VALUES(  "
        +" '#MATERIAL_NO#', "
        +" '#MATERIAL_DESC#', "
        +"  SYS_GUID(), "
        +" '#BOM_TYP#', "
        +" '#MSC_PLINE#', "
        +" '#WHOLE_BACKLOG#', "
        +" '#WHOLE_BACKLOG_DESC#', "
       +"  '#MSC#', "
        +" '#MSC_DESC#', "
        +" '#GRADECODE#', "
        +" '#GRADENAME#', "
        +" '#SPEC_CODE_C#', "
        +" '#SPEC_NAME_C#', "
        +" '#SPEC_CODE_R#', "
        +" '#SPEC_NAME_R#', "
        +" '#SPEC_CODE_D#', "
        +" '#SPEC_NAME_D#', "
        +" '#SPEC_CODE_Z#', "
        +" '#SPEC_NAME_Z#', "
        +" '#A_IN_MATERIAL_NO#', "
        +" '#A_IN_MATERIAL_DESC#', "
        +" '#A_OUT_MATERIAL_NO#', "
        +" '#A_OUT_MATERIAL_DESC#', "
        +" '#B_IN_MATERIAL_NO#', "
        +" '#B_IN_MATERIAL_DESC#', "
        +" '#B_OUT_MATERIAL_NO#', "
        +" '#B_OUT_MATERIAL_DESC#', "
        +" '#C_IN_MATERIAL_NO#', "
        +" '#C_IN_MATERIAL_DESC#', "
        +" '#C_OUT_MATERIAL_NO#', "
        +" '#C_OUT_MATERIAL_DESC#', "
        +" '#D_IN_MATERIAL_NO#', "
        +" '#D_IN_MATERIAL_DESC#', "
        +" '#D_OUT_MATERIAL_NO#', "
        +" '#D_OUT_MATERIAL_DESC#', "
        +" '#E_IN_MATERIAL_NO#', "
        +" '#E_IN_MATERIAL_DESC#', "
        +" '#E_OUT_MATERIAL_NO#', "
        +" '#E_OUT_MATERIAL_DESC#', "
        +" '#F_IN_MATERIAL_NO#', "
        +" '#F_IN_MATERIAL_DESC#', "
        +" '#F_OUT_MATERIAL_NO#', "
        +" '#F_OUT_MATERIAL_DESC#', "
        +" '#J_IN_MATERIAL_NO#', "
        +" '#J_IN_MATERIAL_DESC#', "
        +" '#J_OUT_MATERIAL_NO#', "
        +" '#J_OUT_MATERIAL_DESC#', "
        +" '#I_IN_MATERIAL_NO#', "
        +" '#I_IN_MATERIAL_DESC#', "
        +" '#I_OUT_MATERIAL_NO#', "
        +" '#I_OUT_MATERIAL_DESC#', "
        +" '#PROCESS_CODE_CS#')";
	/**
	 * 保存基础物料-电炉
	 */
	public static String saveBaseMaterialA =
			"INSERT INTO SLM_BASE_MATERIAL_A "
            +"           (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 保存基础物料-铸造
	 */
	public static String saveBaseMaterialB =
			"INSERT INTO SLM_BASE_MATERIAL_B "
            +"           (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 保存基础物料-锻造
	 */
	public static String saveBaseMaterialC =
			"INSERT INTO SLM_BASE_MATERIAL_C "
            +"           (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 保存基础物料-轧管
	 */
	public static String saveBaseMaterialD =
			"INSERT INTO SLM_BASE_MATERIAL_D "
            +"           (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 保存基础物料-墩拔扩
	 */
	public static String saveBaseMaterialE =
			"INSERT INTO SLM_BASE_MATERIAL_E "
            +"           (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 保存基础物料-热处理
	 */
	public static String saveBaseMaterialF =
			"INSERT INTO SLM_BASE_MATERIAL_F "
            +"           (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"             VALUES "
            +"            (?, ?, ?, ?)";
	/**
	 * 验证基础物料-电炉是否存在相同记录
	 */
	public static String checkBaseMaterialA =
			" SELECT COUNT(*) COUNT "
                  +" FROM SLM_BASE_MATERIAL_A T "
                 +" WHERE T.IN_MATERIAL_NO = ? "
                  +"  AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 验证基础物料-铸造是否存在相同记录
	 */
	public static String checkBaseMaterialB =
			" SELECT COUNT(*) COUNT "
                  +" FROM SLM_BASE_MATERIAL_B T "
                 +" WHERE T.IN_MATERIAL_NO = ? "
                  +"  AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 验证基础物料-锻造是否存在相同记录
	 */
	public static String checkBaseMaterialC =
			" SELECT COUNT(*) COUNT "
                  +" FROM SLM_BASE_MATERIAL_C T "
                 +" WHERE T.IN_MATERIAL_NO = ? "
                  +"  AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 验证基础物料-轧管是否存在相同记录
	 */
	public static String checkBaseMaterialD =
			" SELECT COUNT(*) COUNT "
                  +" FROM SLM_BASE_MATERIAL_D T "
                 +" WHERE T.IN_MATERIAL_NO = ? "
                  +"  AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 验证基础物料-墩拔扩是否存在相同记录
	 */
	public static String checkBaseMaterialE =
			" SELECT COUNT(*) COUNT "
                  +" FROM SLM_BASE_MATERIAL_E T "
                 +" WHERE T.IN_MATERIAL_NO = ? "
                  +"  AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 验证基础物料-热处理是否存在相同记录
	 */
	public static String checkBaseMaterialF =
			" SELECT COUNT(*) COUNT "
                  +" FROM SLM_BASE_MATERIAL_F T "
                 +" WHERE T.IN_MATERIAL_NO = ? "
                  +"  AND T.OUT_MATERIAL_NO = ?";
	public static String checkBomA =
			"SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_A T "
  + " WHERE T.BOM = ? "
  + "  AND T.IN_MATERIAL_NO = ? "
  + "  AND T.OUT_MATERIAL_NO = ?";
	public static String checkBomB =
			"SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_B T "
  + " WHERE T.BOM = ? "
  + "  AND T.IN_MATERIAL_NO = ? "
  + "  AND T.OUT_MATERIAL_NO = ?";
	public static String checkBomC =
			"SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_C T "
  + " WHERE T.BOM = ? "
  + "  AND T.IN_MATERIAL_NO = ? "
  + "  AND T.OUT_MATERIAL_NO = ?";
	public static String checkBomD =
			"SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_D T "
  + " WHERE T.BOM = ? "
  + "  AND T.IN_MATERIAL_NO = ? "
  + "  AND T.OUT_MATERIAL_NO = ?";
	public static String checkBomE =
			"SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_E T "
  + " WHERE T.BOM = ? "
  + "  AND T.IN_MATERIAL_NO = ? "
  + "  AND T.OUT_MATERIAL_NO = ?";
	public static String checkBomF =
			"SELECT COUNT(1) COUNT "
  + " FROM SLM_ORD_DESIGN_BOM_F T "
  + " WHERE T.BOM = ? "
  + "  AND T.IN_MATERIAL_NO = ? "
  + "  AND T.OUT_MATERIAL_NO = ?";
	/**
	 * 验证基础物料编码是否存在相同记录
	 */
	public static String checkBaseMaterial =
			"SELECT COUNT(*) COUNT FROM SLM_BASE_MATERIAL T WHERE T.MATERIAL_NO = ?";
	/**
	 * 验证基础数据-电炉投入产出-产线能力
	 */
	public static String checkBaseMaterialAPl =
			" SELECT COUNT(1) COUNT "
            +"  FROM SLM_BASE_MATERIAL_A_PL T "
            +"  WHERE T.IN_MATERIAL_NO = ? "
            +"    AND T.OUT_MATERIAL_NO = ? "
            +"    AND T.PLINE_CODE = ?";
	/**
	 * 验证基础数据-铸造投入产出-产线能力
	 */
	public static String checkBaseMaterialBPl =
			" SELECT COUNT(1) COUNT "
            +"  FROM SLM_BASE_MATERIAL_B_PL T "
            +"  WHERE T.IN_MATERIAL_NO = ? "
            +"    AND T.OUT_MATERIAL_NO = ? "
            +"    AND T.PLINE_CODE = ?";
	/**
	 * 验证基础数据-锻造投入产出-产线能力
	 */
	public static String checkBaseMaterialCPl =
			" SELECT COUNT(1) COUNT "
            +"  FROM SLM_BASE_MATERIAL_C_PL T "
            +"  WHERE T.IN_MATERIAL_NO = ? "
            +"    AND T.OUT_MATERIAL_NO = ? "
            +"    AND T.PLINE_CODE = ?";
	/**
	 * 验证基础数据-轧管投入产出-产线能力
	 */
	public static String checkBaseMaterialDPl =
			" SELECT COUNT(1) COUNT "
            +"  FROM SLM_BASE_MATERIAL_D_PL T "
            +"  WHERE T.IN_MATERIAL_NO = ? "
            +"    AND T.OUT_MATERIAL_NO = ? "
            +"    AND T.PLINE_CODE = ?";
	/**
	 * 验证基础数据-墩拔扩投入产出-产线能力
	 */
	public static String checkBaseMaterialEPl =
			" SELECT COUNT(1) COUNT "
            +"  FROM SLM_BASE_MATERIAL_E_PL T "
            +"  WHERE T.IN_MATERIAL_NO = ? "
            +"    AND T.OUT_MATERIAL_NO = ? "
            +"    AND T.PLINE_CODE = ?";
	/**
	 * 验证基础数据-热处理投入产出-产线能力
	 */
	public static String checkBaseMaterialFPl =
			" SELECT COUNT(1) COUNT "
            +"  FROM SLM_BASE_MATERIAL_F_PL T "
            +"  WHERE T.IN_MATERIAL_NO = ? "
            +"    AND T.OUT_MATERIAL_NO = ? "
            +"    AND T.PLINE_CODE = ?";
	/**
	 * 保存 基础数据-电炉投入产出-产线能力
	 */
	public static String saveBaseMaterialAPl =
			"INSERT INTO SLM_BASE_MATERIAL_A_PL "
            +"       (IN_MATERIAL_NO, "
            +"         OUT_MATERIAL_NO, "
            +"         PLINE_CODE, "
            +"         PLINE_NAME) "
            +"  VALUES "
            +"        (?, ?, ?, ?)";
	/**
	 * 保存 基础数据-铸造投入产出-产线能力
	 */
	public static String saveBaseMaterialBPl =
			"INSERT INTO SLM_BASE_MATERIAL_B_PL "
            +"       (IN_MATERIAL_NO, "
            +"         OUT_MATERIAL_NO, "
            +"         PLINE_CODE, "
            +"         PLINE_NAME) "
            +"  VALUES "
            +"        (?, ?, ?, ?)";
	/**
	 * 保存 基础数据-锻造投入产出-产线能力
	 */
	public static String saveBaseMaterialCPl =
			"INSERT INTO SLM_BASE_MATERIAL_C_PL "
            +"       (IN_MATERIAL_NO, "
            +"         OUT_MATERIAL_NO, "
            +"         PLINE_CODE, "
            +"         PLINE_NAME) "
            +"  VALUES "
            +"        (?, ?, ?, ?)";
	/**
	 * 保存 基础数据-轧管投入产出-产线能力
	 */
	public static String saveBaseMaterialDPl =
			"INSERT INTO SLM_BASE_MATERIAL_D_PL "
            +"       (IN_MATERIAL_NO, "
            +"         OUT_MATERIAL_NO, "
            +"         PLINE_CODE, "
            +"         PLINE_NAME) "
            +"  VALUES "
            +"        (?, ?, ?, ?)";
	/**
	 * 保存 基础数据-墩拔扩投入产出-产线能力
	 */
	public static String saveBaseMaterialEPl =
			"INSERT INTO SLM_BASE_MATERIAL_E_PL "
            +"       (IN_MATERIAL_NO, "
            +"         OUT_MATERIAL_NO, "
            +"         PLINE_CODE, "
            +"         PLINE_NAME) "
            +"  VALUES "
            +"        (?, ?, ?, ?)";
	/**
	 * 保存 基础数据-热处理投入产出-产线能力
	 */
	public static String saveBaseMaterialFPl =
			"INSERT INTO SLM_BASE_MATERIAL_F_PL "
            +"       (IN_MATERIAL_NO, "
            +"         OUT_MATERIAL_NO, "
            +"         PLINE_CODE, "
            +"         PLINE_NAME) "
            +"  VALUES "
            +"        (?, ?, ?, ?)";
	/**
	 * 保存基础数据-加工
	 */
	public static String saveBaseMaterialI =
			"INSERT INTO SLM_BASE_MATERIAL_I "
            +"           (IN_MATERIAL_SET, OUT_MATERIAL_NO, OUT_MATERIAL_DESC) "
            +"      VALUES "
            +"            (?, ?, ?)";
	/**
	 * 修改BOM清单
	 */
	public static String updateBom =
			" UPDATE SLM_ORD_DESIGN_BOM T "
   + " SET T.MATERIAL_NO         = '#MATERIAL_NO#', "
   + "     T.MATERIAL_DESC       = '#MATERIAL_DESC#', "
   + "     T.BOM_TYP             = '#BOM_TYP#', "
   + "     T.MSC_PLINE           = '#MSC_PLINE#', "
   + "     T.WHOLE_BACKLOG       = '#WHOLE_BACKLOG#', "
   + "     T.WHOLE_BACKLOG_DESC  = '#WHOLE_BACKLOG_DESC#', "
   + "     T.MSC                 = '#MSC#', "
   + "     T.MSC_DESC            = '#MSC_DESC#', "
   + "     T.GRADECODE           = '#GRADECODE#', "
   + "     T.GRADENAME           = '#GRADENAME#', "
   + "     T.SPEC_CODE_C         = '#SPEC_CODE_C#', "
   + "     T.SPEC_NAME_C         = '#SPEC_NAME_C#', "
   + "     T.SPEC_CODE_R         = '#SPEC_CODE_R#', "
   + "     T.SPEC_NAME_R         = '#SPEC_NAME_R#', "
   + "     T.SPEC_CODE_D         = '#SPEC_CODE_D#', "
   + "     T.SPEC_NAME_D         = '#SPEC_NAME_D#', "
   + "     T.SPEC_CODE_Z         = '#SPEC_CODE_Z#', "
   + "     T.SPEC_NAME_Z         = '#SPEC_NAME_Z#', "
   + "     T.A_IN_MATERIAL_NO    = '#A_IN_MATERIAL_NO#', "
   + "     T.A_IN_MATERIAL_DESC  = '#A_IN_MATERIAL_DESC#', "
   + "     T.A_OUT_MATERIAL_NO   = '#A_OUT_MATERIAL_NO#', "
    + "    T.A_OUT_MATERIAL_DESC = '#A_OUT_MATERIAL_DESC#', "
   + "     T.B_IN_MATERIAL_NO    = '#B_IN_MATERIAL_NO#', "
   + "     T.B_IN_MATERIAL_DESC  = '#B_IN_MATERIAL_DESC#', "
   + "     T.B_OUT_MATERIAL_NO   = '#B_OUT_MATERIAL_NO#', "
   + "     T.B_OUT_MATERIAL_DESC = '#B_OUT_MATERIAL_DESC#', "
   + "     T.C_IN_MATERIAL_NO    = '#C_IN_MATERIAL_NO#', "
   + "     T.C_IN_MATERIAL_DESC  = '#C_IN_MATERIAL_DESC#', "
   + "     T.C_OUT_MATERIAL_NO   = '#C_OUT_MATERIAL_NO#', "
   + "     T.C_OUT_MATERIAL_DESC = '#C_OUT_MATERIAL_DESC#', "
   + "     T.D_IN_MATERIAL_NO    = '#D_IN_MATERIAL_NO#', "
   + "     T.D_IN_MATERIAL_DESC  = '#D_IN_MATERIAL_DESC#', "
   + "     T.D_OUT_MATERIAL_NO   = '#D_OUT_MATERIAL_NO#', "
   + "     T.D_OUT_MATERIAL_DESC = '#D_OUT_MATERIAL_DESC#', "
   + "     T.E_IN_MATERIAL_NO    = '#E_IN_MATERIAL_NO#', "
   + "     T.E_IN_MATERIAL_DESC  = '#E_IN_MATERIAL_DESC#', "
   + "     T.E_OUT_MATERIAL_NO   = '#E_OUT_MATERIAL_NO#', "
   + "     T.E_OUT_MATERIAL_DESC = '#E_OUT_MATERIAL_DESC#', "
   + "     T.F_IN_MATERIAL_NO    = '#F_IN_MATERIAL_NO#', "
   + "     T.F_IN_MATERIAL_DESC  = '#F_IN_MATERIAL_DESC#', "
    + "    T.F_OUT_MATERIAL_NO   = '#F_OUT_MATERIAL_NO#', "
   + "     T.F_OUT_MATERIAL_DESC = '#F_OUT_MATERIAL_DESC#', "
   + "     T.J_IN_MATERIAL_NO    = '#J_IN_MATERIAL_NO#', "
    + "    T.J_IN_MATERIAL_DESC  = '#J_IN_MATERIAL_DESC#', "
    + "    T.J_OUT_MATERIAL_NO   = '#J_OUT_MATERIAL_NO#', "
   + "     T.J_OUT_MATERIAL_DESC = '#J_OUT_MATERIAL_DESC#', "
   + "     T.I_IN_MATERIAL_NO    = '#I_IN_MATERIAL_NO#', "
    + "    T.I_IN_MATERIAL_DESC  = '#I_IN_MATERIAL_DESC#', "
    + "    T.I_OUT_MATERIAL_NO   = '#I_OUT_MATERIAL_NO#', "
    + "    T.I_OUT_MATERIAL_DESC = '#I_OUT_MATERIAL_DESC#', "
    + "    T.PROCESS_CODE_CS     = '#PROCESS_CODE_CS#' "
    + " WHERE  T.BOM = '#BOM#'	";
	/**
	 * 保存基础物料
	 */
	public static String saveBaseMaterial =
			"INSERT INTO SLM_BASE_MATERIAL( "
        +" MATERIAL_NO, "
        +" MATERIAL_DESC, "
        +" PRODUCCODE, "
        +" PRODUCNAME, "
        +" PRODUC_JX, "
        +" PRODUC_ENG, "
        +" STD_STYLE, "
        +" STD_STYLE_DESC, "
        +" STEELCODE, "
        +" STEELNAME, "
        +" GRADECODE, "
        +" GRADENAME, "
        +" DIMATER, "
        +" HEIGHT, "
        +" SPEC_CODE, "
        +" SPEC_NAME, "
        +" MODEL_CODE, "
        +" MODEL_DESC, "
        +" OUTSRC_ALLOW, "
        +" FIRST_PRDC, "
        +" CREATE_NAME, "
        +" CREATE_TIME, "
        +" UPDATE_NAME, "
        +" UPDATE_TIME, "
        +" DELETE_NAME, "
        +" DELETE_TIME) "
 +" VALUES(  "
        +" '#MATERIAL_NO#', "
        +" '#MATERIAL_DESC#', "
        +" '#PRODUCCODE#', "
        +" '#PRODUCNAME#', "
        +" '#PRODUC_JX#', "
        +" '#PRODUC_ENG#', "
        +" '#STD_STYLE#', "
        +" '#STD_STYLE_DESC#', "
       +"  '#STEELCODE#', "
        +" '#STEELNAME#', "
       +"  '#GRADECODE#', "
        +" '#GRADENAME#', "
        +" '#DIMATER#', "
        +" '#HEIGHT#', "
        +" '#SPEC_CODE#', "
        +" '#SPEC_NAME#', "
        +" '#MODEL_CODE#', "
        +" '#MODEL_DESC#', "
        +" '#OUTSRC_ALLOW#', "
        +" '#FIRST_PRDC#', "
        +" NULL, "
        +" SYSDATE, "
        +" NULL, "
        +" NULL, "
        +" NULL, "
        +" NULL)";
	/**
	 * 验证备料码的规格在基础规格表里是否存在
	 */
	/*public static String getBaseSpec = 
			"SELECT T.SPEC_CODE, T.SPEC_NAME "
  +" FROM COM_BASE_SPEC T "
 +" WHERE T.DIMATER = TO_NUMBER(?) "
  +"  AND T.HEIGHT = TO_NUMBER(?) "
  +"  AND T.MSC_STYLE = 'A' "
  +"  AND T.VALIDFLAG = '1'";*/
	/**
	 * 通过产品码与用途码查询冶金规范码
	 */
	public static String getMscByPscAndUseCode =
			"SELECT T1.MSC,T1.MSC_DESC,T1.MSC_STYLE "
  +" FROM COM_MSC T1, COM_PSC_R_MSC T2 "
 +" WHERE T1.MSC = T2.MSC "
 +"   AND T2.PSC = ? "
 +"   AND T1.USE_CODE = ? "
 +"   AND T2.VALIDFLAG = '1' "
  +"  AND T1.VALIDFLAG != 'D'";
	/**
	 * 通过备料码的四项标准查询产品码
	 */
	public static String getPsc =
			"SELECT PSC, "
       +" PSC_DESC, "
       +" PRODUCCODE, "
       +" PRODUCNAME, "
       +" STD_CODE, "
       +" STD_NAME, "
       +" STEELCODE, "
       +" STEELNAME, "
       +" STD_STYLE, "
       +" STD_STYLE_DESC, "
       +" NEW_PROC_CODE, "
       +" NEW_PROC_DESC, "
       +" DEPARTMENT_CODE, "
       +" DEPARTMENT_DESC, "
       +" UNIT_CODE, "
       +" AUTOJUDGE, "
       +" UNIT_DESC, "
       +" CREATE_NAME, "
       +" CREATE_TIME, "
       +" UPDATE_NAME, "
       +" UPDATE_TIME, "
       +" DELETE_NAME, "
       +" DELETE_TIME, "
       +" VALIDFLAG, "
       +" MEMO, "
       +" PSC_OLD, "
       +" PRODUC_HEAD, "
       +" PRODUC_TYPE, "
       +" PRODUC_STYLE, "
       +" PRODUC_DESC "
       +" FROM COM_PSC T "
       +" WHERE T.PRODUCCODE = ? "
       +" AND T.STD_CODE = ? "
       +" AND T.STEELCODE = ? "
       +" AND NVL(T.STD_STYLE,'/') = NVL(?,'/') "
       +" AND T.VALIDFLAG = '1'";
	/**
	 * 验证产线
	 */
	public static String checkPlineSpec =
			"SELECT COUNT(1) COUNT "
  +" FROM COM_MSC_PLINE_R_SPEC T "
 +" WHERE T.PLINE_CODE = ? "
   +" AND T.SPEC_CODE = ? "
   +" AND TO_NUMBER(T.MIN_D) <= TO_NUMBER(?) "
   +" AND TO_NUMBER(T.MAX_D) >= TO_NUMBER(?) "
   +" AND TO_NUMBER(T.MIN_H) <= TO_NUMBER(?) "
   +" AND TO_NUMBER(T.MAX_H) >= TO_NUMBER(?) "
  +"  AND T.VALIDFLAG = '1'";
	/**
	 * 通过规格代码查询外径壁厚
	 */
	public static String getSpecDH =
			"SELECT T.DIMATER,T.HEIGHT FROM COM_BASE_SPEC T WHERE T.SPEC_CODE=?";
	/**
	 * 查询工序
	 */
	public static String getOperation1 =
			"SELECT INDEX_SEQ, "
       +" MSC, "
       +" MSC_PLINE, "
       +" BACKLOG_SEQ, "
       +" PROCESS_CODE, "
       +" PROCESS_DESC, "
       +" MINUTE_PRODUCT, "
       +" MINUTE_WAITE, "
       +" CREATE_NAME, "
       +" CREATE_TIME, "
       +" UPDATE_NAME, "
       +" UPDATE_TIME, "
       +" DELETE_NAME, "
       +" DELETE_TIME, "
       +" VALIDFLAG, "
       +" MEMO, "
       +" PROCESS_SEQ, "
       +" CIC, "
       +" PIC, "
       +" SIC, "
       +" DIC, "
       +" WIC, "
       +" PROCESS_CODE_C, "
       +" PROCESS_DESC_C, "
       +" GIC, "
       +" MEMO, "
       +" MSC_PLINE_OLD, "
       +" MINUTE_PRODUCT_OUT, "
       +" MINUTE_WAITE_OUT, "
       +" BATCH_WAITE, "
       +" BATCH_WAITE_OUT "
  +" FROM COM_MSC_PROCESS T "
 +" WHERE T.MSC = ? "
   +" AND T.MSC_PLINE = ? "
   +" AND T.PROCESS_CODE = ? "
   +" AND T.VALIDFLAG = '1'";
	/**
	 * 规格管理 查询轧管规格
	 */
	public static String getRollSpec1 =
			"SELECT PLINE_CODE, "
            +"    PLINE_NAME, "
            +"    INDEX_SEQ, "
            +"    GRADECODE, "
            +"    GRADENAME, "
            +"    MIN_D, "
            +"    MIN_H, "
            +"    MAX_D, "
            +"    MAX_H "
          +" FROM COM_MSC_ROLL_R_UPSET A "
         +" WHERE A.PLINE_CODE = ? "
          +"  AND TO_NUMBER(A.MAX_D) = TO_NUMBER(?) "
          +"  AND TO_NUMBER(A.MAX_H) = TO_NUMBER(?) "
          +"  AND A.VALIDFLAG = 1";
	/**
	 * 查询基础规格根据外径、壁厚
	 */
	public static String getBaseSpec =
			"SELECT SPEC_CODE, SPEC_NAME, DIMATER, HEIGHT, WEIGHT, MSC_STYLE "
  +" FROM COM_BASE_SPEC T "
  +" WHERE TO_NUMBER(T.DIMATER) = TO_NUMBER(?) "
  +"   AND TO_NUMBER(T.HEIGHT) = TO_NUMBER(?) "
  +"   AND T.MSC_STYLE='A' "
  +"   AND T.VALIDFLAG = 1";
	/**
	 * 查询锻造规格
	 */
	public static String getBiltSpec1 =
			"SELECT DISTINCT T.SPEC_CODE, T.SPEC_NAME "
  + " FROM COM_MSC_PLINE_R_SPEC T,COM_BASE_PLINE T1 "
  + " WHERE T.PLINE_CODE IN "
  + "      (SELECT Q.PLINE_CODE "
  + "         FROM COM_BASE_PLINE Q "
  + "        WHERE Q.PROCESS_CODE = 'D' "
  + "          and instr(q.pline_name,'外购')=0) "
  + "  AND TO_NUMBER(T.MIN_D) <= TO_NUMBER(?) "
  + "  AND TO_NUMBER(T.MAX_D) >= TO_NUMBER(?) "
  + "  AND TO_NUMBER(T.MIN_H) <= TO_NUMBER(?) "
  + "  AND TO_NUMBER(T.MAX_H) >= TO_NUMBER(?) "
  + "  AND T.VALIDFLAG = 1 "
  + "  and T.SPEC_CODE is not null "
  + "  AND T1.PLINE_CODE=T.PLINE_CODE";
	/**
	 * 查询锻造规格(外购)
	 */
	public static String getBiltSpecOut =
			"SELECT DISTINCT SPEC_CODE, SPEC_NAME "
  +" FROM COM_MSC_PLINE_R_SPEC T "
 +" WHERE T.PLINE_CODE IN "
 +"       (SELECT Q.PLINE_CODE "
 +"          FROM COM_BASE_PLINE Q "
 +"         WHERE Q.PROCESS_CODE = 'D' "
 +"           and instr(q.pline_name,'外购')>0) "
 +"   AND TO_NUMBER(T.MIN_D) <= TO_NUMBER(?) "
 +"   AND TO_NUMBER(T.MAX_D) >= TO_NUMBER(?) "
 +"   AND TO_NUMBER(T.MIN_H) <= TO_NUMBER(?) "
 +"   AND TO_NUMBER(T.MAX_H) >= TO_NUMBER(?) "
 +"   AND T.VALIDFLAG = 1";
	/**
	 * 通过工序查询适用产线
	 */
	public static String getProLineByProcessCode =
			"SELECT PLINE_CODE, "
       +" PLINE_NAME, "
       +" PASS_CODE, "
       +" PASS_NAME, "
       +" MODEL_CODE, "
       +" MODEL_DESC, "
       +" INDEX_SEQ, "
       +" MIN_D, "
       +" MAX_D, "
       +" MIN_H, "
       +" MAX_H, "
       +" SPEC_JG, "
       +" SPEC_JG_DESC, "
       +" WELL_CODE, "
       +" WELL_NAME, "
       +" CREATE_NAME, "
       +" CREATE_TIME, "
       +" UPDATE_NAME, "
       +" UPDATE_TIME, "
       +" DELETE_NAME, "
       +" DELETE_TIME, "
       +" VALIDFLAG, "
       +" MEMO, "
       +" SPEC_CODE, "
       +" SPEC_NAME, "
       +" MODEL_STYLE, "
       +" PROCESS_CDOE_C, "
       +" PROCESS_DESC_C, "
       +" PROCESS_STYLE "
  +" FROM COM_MSC_PLINE_R_SPEC A "
 +" WHERE A.PLINE_CODE IN (SELECT B.PLINE_CODE "
 +"                          FROM COM_BASE_PLINE B "
 +"                         WHERE B.PROCESS_CODE = ? "
 +"                          AND B.VALIDFLAG = '1') "
 +"   AND A.VALIDFLAG = '1'";
	/**
	 * 查询铸造连铸坯规格
	 */
	public static String getBiltCSpecA =
			"SELECT ID_, "
  +" SPEC_CODE_FORG, "
  +" SPEC_NAME_FORG, "
  +" SPEC_CODE_INGOT, "
  +" SPEC_NAME_INGOT, "
  +" SPEC_CODE, "
  +" SPEC_NAME "
+" FROM COM_MSC_CAST_R_FORG A "
+" WHERE A.SPEC_CODE_FORG = ? "
+" and TRIM(a.SPEC_CODE_INGOT) IS NULL "
+" AND A.VALIDFLAG = 1";
	/**
	 * 查询铸造钢锭规格
	 */
	public static String getBiltCSpecB =
			"SELECT ID_, "
  +" SPEC_CODE_FORG, "
  +" SPEC_NAME_FORG, "
  +" SPEC_CODE_INGOT, "
  +" SPEC_NAME_INGOT, "
  +" SPEC_CODE, "
  +" SPEC_NAME "
+" FROM COM_MSC_CAST_R_FORG A "
+" WHERE A.SPEC_CODE_FORG = ? "
+" AND TRIM(A.SPEC_CODE) IS NULL "
+" AND A.VALIDFLAG = 1";
	
	/**
	 * 插入化学元素基础表
	 */
	public static String InsertComBaseChem =
			" insert into COM_BASE_CHEM "
			+ "(CHEM_CODE,CHEM_NAME,CHEM_TYPE,CHEM_FORMULA,CREATE_NAME, "
            + " CREATE_TIME,VALIDFLAG,ROUNDING_DIGITS,CHEM_CODE_OLD,CHEM_SEQ) "
            + " values (?,?,?,?,?,sysdate,?,?,?,?)";
	/**
	 * 修改化学元素基础表
	 */
	public static String UpdateComBaseChem =
			" update COM_BASE_CHEM set CHEM_NAME = ?,CHEM_TYPE = ?,CHEM_FORMULA = ?,UPDATE_NAME = ?,UPDATE_TIME = sysdate,ROUNDING_DIGITS = ?,CHEM_SEQ = ? where CHEM_CODE = ?";
	
	/**
	 * 删除化学元素基础表
	 */
	public static String DeleteComBaseChem =
			" update COM_BASE_CHEM set VALIDFLAG = '0',DELETE_TIME = sysdate,DELETE_NAME = ? where CHEM_CODE = ?";
	/**
	 * 插入钢种基础表
	 */
	public static String InsertComBaseGrade =
			" insert into COM_BASE_GRADE "
			+ "(GRADECODE,GRADENAME,ASSORTMENT_CODE,ASSORTMENT_NAME,COEFFICIENT,GRADECODE_NEW,CREATE_NAME,CREATE_TIME)"
			+ " values (?,?,?,?,?,?,?,sysdate)";
	/**
	 * 修改钢种基础表
	 */
	public static String UpdateComBaseGrade =
			" update into COM_BASE_GRADE set  GRADENAME = ?,ASSORTMENT_CODE = ?,ASSORTMENT_NAME = ?,UPDATE_NAME = ?,UPDATE_TIME = sysdate where gradecode = ?";
	/**
	 * 删除钢种基础表
	 */
	public static String DeleteComBaseGrade =
			" update COM_BASE_GRADE set VALIDFLAG = '0',DELETE_TIME = sysdate,DELETE_NAME = ? where gradecode = ?";
	/**
	 * 插入钢级基础表
	 */
	public static String InsertComBaseSteel =
			" insert into COM_BASE_STEEL "
			+ " (STEELCODE,STEELNAME,STEELSTYLE,CREATE_NAME,CREATE_TIME,VALIDFLAG,STEELCODE_NEW)"
			+ " VALUES(?,?,?,?,SYSDATE,?,?)";
	/**
	 * 修改钢级基础表
	 */
	public static String UpdateComBaseInfo =
			" update COM_BASE_STEEL set STEELNAME = ?,UPDATE_NAME = ?,UPDATE_TIME = SYSDATE WHERE STEELCODE = ?"; 
	/**
	 * 删除钢级基础表
	 */
	public static String DeleteComBaseSteel =
			" update COM_BASE_STEEL set VALIDFLAG = '0',DELETE_TIME = sysdate,DELETE_NAME = ? where STEELCODE = ?";
	/**
	 * 插入品名基础表
	 */
	public static String InsertComBaseProduct =
			" insert into COM_BASE_PRODUCT "
			+ " (PRODUCCODE,PRODUCNAME,PRODUC_STYLE,PRODUC_DESC,CREATE_NAME,CREATE_TIME,PRODUC_HEAD,PRODUC_TYPE,PRODUCCODE_NEW) "
			+ " values (?,?,?,?,?,sysdate,?,?,?)";
	/**
	 * 修改品名基础表
	 */
	public static String UpdateComBaseProduct =
			" update COM_BASE_PRODUCT set PRODUCNAME = ?,PRODUC_STYLE = ?,PRODUC_DESC = ?,UPDATE_NAME = ?,UPDATE_TIME = sysdate,PRODUC_HEAD = ?,PRODUC_TYPE = ? where PRODUCCODE = ?";
	/**
	 * 删除品名基础表
	 */
	public static String DeleteComBaseProduct =
			" update COM_BASE_PRODUCT set VALIDFLAG = '0',DELETE_TIME = sysdate,DELETE_NAME = ? where PRODUCCODE = ?";
	/**
	 * 插入扣型基础表
	 */
	public static String InsertComBaseModel =
			" insert into COM_BASE_MODEL "
			+ " (MODEL_CODE,MODEL_DESC,HAVEJG,CREATE_NAME,CREATE_TIME,VALIDFLAG,MODEL_CODE_NEW) "
			+ " values (?,?,?,?,sysdate,?,?)";
	/**
	 * 修改扣型基础表
	 */
	public static String UpdateComBaseModel =
			" update COM_BASE_MODEL set MODEL_DESC = ?,UPDATE_NAME = ?,UPDATE_TIME = sysdate where MODEL_CODE = ?";
	/**
	 * 删除扣型基础表
	 */
	public static String DeleteComBaseModel =
			" update COM_BASE_MODEL set VALIDFLAG = '0',DELETE_TIME = sysdate,DELETE_NAME = ? where MODEL_CODE = ?";
	
	/**
	 * 插入委外合同 tzh24.5.28
	 */
	public static String InsertCxMesWwht =
			"insert into cx_mes_wwht"
			+ " (ID,STATUS,CREATE_DATE) values (?,?,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'))";
	
	/**
	 * 修改委外合同 tzh24.5.28
	 */
	public static String UpdateCxMesWwht =
			"update cx_mes_wwht set STATUS =? ,update_date = to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') where id = ?";
	
	/**
	 * 插入废副料预报 tzh24.6.14
	 */
	public static String InsertCxMesJl =
			"insert into cx_mes_jl"
			+ " (con_no,con_line_no,cus_code,cus_name,material_code,material_name,plan_wgt,bill_status,bill_no,create_date) values (?,?,?,?,?,?,?,?,?,sysdate)";
	
	/**
	 * 插入废副料出库撤回接口tzh 24.8.20
	 */
	public static String InsertCxMesJlCh =
			"insert into cx_mes_weight_mat"
			+ " (result_no,remark,createdBy,createdByCode,createdTime) values (?,?,?,?,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'))";
	
	/**
	 * 修改废副料预报 tzh24.6.14
	 */
	public static String UpdateCxMesJl =
			"update cx_mes_jl set bill_status =? ,update_date = sysdate where bill_no = ?";
	
	/**
	 * 插入废副料内部领用 tzh24.6.19
	 */
	public static String InsertCxMesJlly =
			"insert into cx_mes_jl_ly"
			+ " (material_code,material_name,form_name,form_time,op_flag,dept_name,requisition_num,requisition_line_num,requisition_qty,meter_type,form_code,create_date) "
			+" values (?,?,?,?,?,?,?,?,?,?,?,sysdate)";
	
	/**
	 * 查询材料信息
	 */
	public static String getMatZcTH = "SELECT T.MAT_NO,\r\n" +
			"		T.LOT_NO,\r\n" + 
			"		T.STOVE_NO,\r\n" + 
			"		T.JUDGE_STOVE_NO,\r\n" + 
			"		T.BATCH_NO,\r\n" + 
			"		T.BATCH_GROUD_NO,\r\n" + 
			"		T.MATERIAL_NO,\r\n" + 
			"		T.MATERIAL_NAME,\r\n" + 
			"		T.PRODUCCODE,\r\n" + 
			"		T.PRODUCNAME,\r\n" + 
			"		T.STEELCODE,\r\n" + 
			"		T.STEELNAME,\r\n" + 
			"		T.GRADECODE,\r\n" + 
			"		T.GRADENAME,\r\n" + 
			"		T.SPEC_CODE,\r\n" + 
			"		T.SPEC_NAME,\r\n" + 
			"		T.MODEL_CODE,\r\n" + 
			"		T.MODEL_DESC,\r\n" + 
			"		T.STD_CODE,\r\n" + 
			"		T.STD_NAME,\r\n" + 
			"		T.STD_STYLE,\r\n" + 
			"		T.STD_STYLE_DESC,\r\n" + 
			"		T.ORDER_NO,\r\n" + 
			"		T.ORDER_SEQ,\r\n" + 
			"		T.ORDER_SEQ_NO,\r\n" + 
			"		T.PLINE_CODE,\r\n" + 
			"		T.PLINE_NAME,\r\n" + 
			"		T.ACT_DIMATER,\r\n" + 
			"		T.ACT_HEIGHT,\r\n" + 
			"		T.ACT_LEN,\r\n" + 
			"		T.ACT_LEN_MIN,\r\n" + 
			"		T.ACT_LEN_MAX,\r\n" + 
			"		T.ACT_COUNT,\r\n" + 
			"		T.ACT_WEIGHT,\r\n" + 
			"		T.ACT_THEORY_WEIGHT,\r\n" + 
			"		T.JUDGE_RESULT_CODE,\r\n" + 
			"		T.PRO_BC,\r\n" + 
			"		T.PRO_BZ,\r\n" + 
			"		T.RPO_TIME,\r\n" + 
			"		T.ORD_PK,\r\n" + 
			"		T.ORD_LN_PK,\r\n" + 
			"		T.ORD_LN_DLY_PK,\r\n" + 
			"		T.FINISHPRO_MOLD,\r\n" + 
			"		T.IN_MOLD,\r\n" + 
			"		T.ZBS_FLAG,\r\n" + 
			"		T.ZBS_ID,\r\n" + 
			"		T.JG_ZBS_ID\r\n" + 
			"		FROM MAT_ZC_M T, YDM_ZC_BUTTRESS T1\r\n" + 
			"		WHERE T.MAT_NO = T1.MAT_NO\r\n" + 
			"		AND T.LOCK_FLAG = '0'\r\n" + 
			"		AND T.MNG_LOCK_FLAG = '0'\r\n" + 
			"		AND T.LOCK_LIKU = '0'\r\n" + 
			"		AND (T.JUDGE_RESULT_CODE IS NULL OR\r\n" + 
			"		T.JUDGE_RESULT_CODE IN ('40740701', '40740709'))\r\n" + 
			"		AND T.ORD_LN_DLY_PK = '#ORD_LN_DLY_PK#'\r\n" + 
			"		AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'\r\n" + 
			"		AND NVL(T.BATCH_NO, '/') = NVL('#BATCH_NO#', '/')\r\n" + 
			"		AND T.BATCH_GROUD_NO = '#BATCH_GROUD_NO#'\r\n" + 
			"		AND T.MAT_STATUS = '80150301'\r\n" + 
			"		AND T1.STORAGE_NO = '#STORAGE_NO#'\r\n" + 
			"		AND NVL(T.STD_CODE, '/') = NVL('#STD_CODE#', '/')\r\n" + 
			"		AND NVL(T.MEMO, '/') = NVL('#MEMO#', '/')\r\n" + 
			"		AND NVL(T.PLINE_CODE, '/') = NVL('#PLINE_CODE#', '/')\r\n" + 
			//"		AND NVL((SELECT COM.BASENAME FROM COM_BASE_INFO COM WHERE COM.BASECODE=T.IN_MOLD), '/') = NVL('#IN_MOLD#', '/')\r\n" + 
			"		AND NVL(T1.LOCATION_NO, '/') = NVL('#LOCATION_NO#', '/')";
	
	public static String getInventoryCanInfoTH = "SELECT *\r\n" +
			"  FROM (SELECT T.MAT_NO,\r\n" + 
			"               T.LOT_NO,\r\n" + 
			"               T.STOVE_NO,\r\n" + 
			"               T.JUDGE_STOVE_NO,\r\n" + 
			"               T.BATCH_NO,\r\n" + 
			"               T.BATCH_GROUD_NO,\r\n" + 
			"               T.MATERIAL_NO,\r\n" + 
			"               T.MATERIAL_NAME,\r\n" + 
			"               T.PRODUCCODE,\r\n" + 
			"               T.PRODUCNAME,\r\n" + 
			"               T.STEELCODE,\r\n" + 
			"               T.STEELNAME,\r\n" + 
			"               T.GRADECODE,\r\n" + 
			"               T.GRADENAME,\r\n" + 
			"               T.SPEC_CODE,\r\n" + 
			"               T.SPEC_NAME,\r\n" + 
			"               T.MODEL_CODE,\r\n" + 
			"               T.MODEL_DESC,\r\n" + 
			"               T.STD_CODE,\r\n" + 
			"               T.STD_NAME,\r\n" + 
			"               T.STD_STYLE,\r\n" + 
			"               T.STD_STYLE_DESC,\r\n" + 
			"               T.ORDER_NO,\r\n" + 
			"               T.ORDER_SEQ,\r\n" + 
			"               T.ORDER_SEQ_NO,\r\n" + 
			"               T.PLINE_CODE,\r\n" + 
			"               T.PLINE_NAME,\r\n" + 
			"               T.ACT_DIMATER,\r\n" + 
			"               T.ACT_HEIGHT,\r\n" + 
			"               T.ACT_LEN,\r\n" + 
			"               T.ACT_LEN_MIN,\r\n" + 
			"               T.ACT_LEN_MAX,\r\n" + 
			"               T.ACT_COUNT,\r\n" + 
			"               T.ACT_WEIGHT,\r\n" + 
			"               T.ACT_THEORY_WEIGHT,\r\n" + 
			"               T.JUDGE_RESULT_CODE,\r\n" + 
			"               T.PRO_BC,\r\n" + 
			"               T.PRO_BZ,\r\n" + 
			"               T.RPO_TIME,\r\n" + 
			"               T.ORD_PK,\r\n" + 
			"               T.ORD_LN_PK,\r\n" + 
			"               T.ORD_LN_DLY_PK,\r\n" + 
			"               T.FINISHPRO_MOLD,\r\n" + 
			"               T.IN_MOLD,\r\n" + 
			"               T.IN_TYPE,\r\n" + 
			"               T.ZBS_FLAG,\r\n" + 
			"               T.ZBS_ID,\r\n" + 
			"               T.JG_ZBS_ID\r\n" + 
			"          FROM MAT_ZC_M T, YDM_ZC_BUTTRESS T1\r\n" + 
			" WHERE T.MAT_NO = T1.MAT_NO\r\n" + 
			" AND T.LOCK_FLAG='0'\r\n" + 
			" AND T.MNG_LOCK_FLAG='0'\r\n" + 
			" AND T.LOCK_LIKU='0'\r\n" + 
			" AND (T.JUDGE_RESULT_CODE IS NULL OR T.JUDGE_RESULT_CODE IN ('40740701','40740709'))\r\n" + 
			"   AND T.ORD_LN_DLY_PK='#ORD_LN_DLY_PK#'\r\n" + 
			"   AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'\r\n" + 
			"   AND NVL(T.BATCH_NO,'/') = NVL('#BATCH_NO#','/')\r\n" + 
			"   AND T.BATCH_GROUD_NO='#BATCH_GROUD_NO#'\r\n" + 
			"   AND T.MAT_STATUS = '80150301'\r\n" + 
			"   AND T1.STORAGE_NO = '#STORAGE_NO#'\r\n" + 
			"   AND NVL(T.STD_CODE,'/')=NVL('#STD_CODE#','/')\r\n" + 
			"   AND NVL(T.STD_NAME,'/')=NVL('#STD_NAME#','/')\r\n" + 
			"   AND NVL(T.MEMO,'/') = NVL('#MEMO#','/')\r\n" + 
			"   AND NVL(T.PLINE_CODE,'/') = NVL('#PLINE_CODE#','/')\r\n" + 
			"   AND NVL(T.IN_MOLD, '/') = NVL('#IN_MOLD#', '/')\r\n" + 
			//"   AND NVL(T1.LOCATION_NO,'/')=NVL('#LOCATION_NO#','/')\r\n" + 
			" ORDER BY T.MAT_NO  )\r\n" + 
			" WHERE ROWNUM<?";
	//修改提单材料表长度
	public static String updateBillSendNum =
			" UPDATE YDM_ZC_BILL_C T SET T.SEND_NUM =TO_NUMBER(?)  WHERE T.BILL_NO=? AND T.MAT_NO=?";
	//修改出库材料表实发数
	public static String updateOutSendNum =
			" UPDATE Ydm_Zc_Outlist T "
		    + "    SET T.SEND_NUM = TO_NUMBER(?) "
		    + "  WHERE T.MAT_NO = ? "
		    + "    AND T.OUTSTOCK_TYPE_CODE = '800805' ";
	//修改装车材料表实发数
	public static String updateLoadNum =
			"UPDATE YDM_ZC_LOADVEHICLE_MAT T SET T.SEND_NUM =TO_NUMBER(?)  WHERE T.BILL_NO=? AND T.MAT_NO=?";
	//修改装车从表交货行对应的提单序号
	public static String updateLoadMatSeq =
			"DECLARE "
 +"  V_FLAG YDM_ZC_BILL_M.LOADVEHICLE_TYPE%TYPE := NULL; "
+" BEGIN "
+"   SELECT T.LOADVEHICLE_TYPE "
+"     INTO V_FLAG "
+"     FROM YDM_ZC_BILL_M T "
+"    WHERE T.BILL_NO = ? "
+"      AND ROWNUM = 1; "
+"   IF (V_FLAG = '2') THEN "
+"     UPDATE YDM_ZC_LOADVEHICLE_MAT T "
+"        SET T.VALIDFLAG = '3' "
+"      WHERE T.BILL_NO = ?; "
+"   END IF; "
+" UPDATE YDM_ZC_LOADVEHICLE_MAT T SET T.BILL_NO_SEQ=? WHERE T.BILL_NO=? AND T.ORD_LN_DLY_PK=?; "
+" END;";
	//关闭提单改变物料表
	public static String updateMagment =
			"UPDATE MAT_ZC_M M "
+"    SET M.MAT_STATUS = '80150301',M.LOCK_BILL_FLAG = '0' "
+"  WHERE M.MAT_STATUS = '80150302' "
+"    AND M.MAT_NO IN((SELECT T.MAT_NO "
+"                       FROM YDM_ZC_BILL_C T "
+"                      WHERE T.BILL_NO = ? "
+"                        AND T.EDIT_FLAG = '0' "
+"                        AND T.LOADVEHICLE_FLAG = '0' "
+"                        AND T.VALIDFLAG = '1' "
+"                        AND M.MAT_NO=T.MAT_NO))";
	//修改提单主表实际量
	public static String updatebillM =
		"UPDATE YDM_ZC_BILL_M T "
+"    SET T.ACT_NUM      = NVL((SELECT SUM(T1.ACT_COUNT) "
+"                               FROM YDM_ZC_LOADVEHICLE_MAT T1 "
+"                              WHERE T1.BILL_NO = T.BILL_NO "
+"                                AND T.RETURN_FLAG = '0'), "
+"                             0), "
+"        T.ACT_WT       = NVL((SELECT SUM(CASE "
+"                                          WHEN T1.PONDER_NO IS NOT NULL THEN "
+"                                           T1.PONDER_GROSS_WT "
+"                                          ELSE "
+"                                           (CASE "
+"                                             WHEN L.ORDER_UNIT = '吨' THEN "
+"                                              T1.SEND_NUM "
+"                                             ELSE "
+"                                              T1.ACT_WEIGHT "
+"                                           END) "
+"                                        END) "
+"                               FROM YDM_ZC_LOADVEHICLE_MAT T1, "
+"                                    SLM_ORDER_LINE         L "
+"                              WHERE T1.ORD_LN_PK = L.ORD_LN_PK "
+"                                AND T1.BILL_NO = T.BILL_NO "
+"                                AND T1.RETURN_FLAG = '0'), "
+"                             0), "
+"        T.ACT_TOTL_LEN = NVL((SELECT SUM(T1.ACT_LEN) "
+"                               FROM YDM_ZC_LOADVEHICLE_MAT T1 "
+"                              WHERE T1.BILL_NO = T.BILL_NO "
+"                                AND T.RETURN_FLAG = '0'), "
+"                             0) "
+"  WHERE T.BILL_NO = ?";
	//查询提单号信息
	public static String getBiltNoInfoByBillNo =
		"SELECT T.BILL_NO, T.BILL_STATUS, T.LOADVEHICLE_TYPE,T.ISPRECLOSE,T.BILL_TICKET_STATUS,T.OUTSTOCK_TICKET_STATUS,T.TRANSMNY_TICKET_STATUS,T.ORDER_NO,T.ORDER_SEQ,T.CUSTOMER_NM,T.DELETE_NAME,T.DELETE_TIME "
  +" FROM YDM_ZC_BILL_M T "
 +" WHERE T.BILL_NO = ? "
 +"   AND T.VALIDFLAG = '1' "
 +" GROUP BY T.BILL_NO, T.BILL_STATUS, T.LOADVEHICLE_TYPE,T.ISPRECLOSE,T.BILL_TICKET_STATUS,T.OUTSTOCK_TICKET_STATUS,T.TRANSMNY_TICKET_STATUS,T.ORDER_NO,T.ORDER_SEQ,T.CUSTOMER_NM,T.DELETE_NAME,T.DELETE_TIME";
	//查询是否存在未确认的装车单
	public static String getLoadvehicle =
		"SELECT COUNT(1)ACOUNT FROM YDM_ZC_LOADVEHICLE T WHERE T.BILL_NO = ? AND T.AFFIRM_FLAG = '0'";
	//根据提单号查询炉信息
	public static String getJustStoveInfoByBillNo =
		"SELECT T.BILL_NO, "
       +" T.JUDGE_STOVE_NO, "
       +" T.BATCH_NO, "
       +" T.GROUP_NO, "
       +" T.PRODUCCODE, "
       +" T.PRODUCNAME, "
       +" T.STD_CODE, "
       +" T.STD_NAME, "
       +" T.GRADECODE, "
       +" T.GRADENAME, "
       +" 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, "
       +" T.ACT_LEN_MIN, "
       +" T.ACT_LEN_MAX, "
       +" T.ORD_LN_PK "
  +" FROM YDM_ZC_BILL_C T "
 +" WHERE T.BILL_NO = ? "
   +" AND T.VALIDFLAG = '1' "
   +" AND T.RETURN_FLAG='0' "
 +" GROUP BY T.BILL_NO, "
          +" T.JUDGE_STOVE_NO, "
          +" T.BATCH_NO, "
          +" T.GROUP_NO, "
          +" T.PRODUCCODE, "
          +" T.PRODUCNAME, "
          +" T.STD_CODE, "
          +" T.STD_NAME, "
          +" T.GRADECODE, "
          +" T.GRADENAME, "
          +" 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, "
          +" T.ACT_LEN_MIN, "
          +" T.ACT_LEN_MAX, "
          +" T.ORD_LN_PK";
	
	//查询提单下的理货单
	public static String getTallysheet =
			"SELECT COUNT(1) COUNT "
  +" FROM YDM_ZC_TALLYSHEET_M T "
 +" WHERE T.BILL_NO = ? "
 +"   AND T.VALIDFLAG = '1' "
 +"   AND T.LOADVEHICLE_FLAG = '0'";
	
	//查询未装完车的理货单
	public static String getTallysheetC =
		"SELECT COUNT(1) COUNT "
		+" FROM YDM_ZC_TALLYSHEET_M T "
		+" WHERE T.BILL_NO = ? "
		+" AND T.VALIDFLAG = '1' "
		+" AND T.LOADVEHICLE_FLAG = '1'";
	//查询未理货未装车提单
	public static String queryYdmZcBillC =
		" SELECT T.ORD_PK,T.ORD_LN_PK,T.ORD_LN_DLY_PK,SUM(NVL(T.ACT_COUNT,0)) AS "
		+" ACT_COUNT,SUM(NVL(T.ACT_WEIGHT,0)) AS ACT_WEIGHT,SUM(NVL(T.ACT_LEN,0)) "
		+" AS ACT_LEN "
		+" FROM YDM_ZC_BILL_C T "
		+" WHERE T.BILL_NO = ? "
		+" AND T.EDIT_FLAG = '0' "
		+" AND T.LOADVEHICLE_FLAG = '0' "
		+" AND T.VALIDFLAG='1' "
		+" GROUP BY T.ORD_PK,T.ORD_LN_PK,T.ORD_LN_DLY_PK";
	
	//关闭提单从表
	public static String updateYdmZcBillC =
		"DELETE YDM_ZC_BILL_C "
 +" WHERE LOADVEHICLE_FLAG = '0' "
 +"   AND EDIT_FLAG='0' "
 +"   AND VALIDFLAG = '1' "
 +"   AND BILL_NO = ? "
 +"   AND ORD_LN_DLY_PK=?";
	
	//关闭提单主表
	public static String updateYdmZcBillM =
		"UPDATE YDM_ZC_BILL_M T "
   +" SET T.BILL_STATUS = '4', "
   +"     T.PLAN_NUM     = TO_NUMBER(NVL(T.PLAN_NUM,0)) - TO_NUMBER(?),  "
   +"     T.PLAN_WT = TO_NUMBER(NVL(T.PLAN_WT,0)) - TO_NUMBER(?), "
   +"     T.PLAN_TOTL_LEN = TO_NUMBER(NVL(T.PLAN_TOTL_LEN,0)) - TO_NUMBER(?),  "
   +"     T.DELETE_NAME=?, "
   +"     T.DELETE_TIME=TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') "
   +"     WHERE T.BILL_NO = ? "
   +"     AND T.ORD_LN_DLY_PK = ? " 
   +"     AND T.VALIDFLAG ='1'";
	
	//关闭提单主表
	public static String updateYdmZcBillM2 =
		"update YDM_ZC_BILL_M T "
   +" SET T.BILL_STATUS = '4', "
   +" T.DELETE_NAME=?, "
   +" T.DELETE_TIME=TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') "
 +" WHERE T.BILL_NO = ? "
   +" AND T.VALIDFLAG = '1'";
	
	//提单关闭时通过发货量查询提单从表已发材料号
	public static String querySendNUM =
		"SELECT T.MAT_NO "
  +" FROM YDM_ZC_LOADVEHICLE_MAT T "
 +" WHERE T.BILL_NO = ? "
 +"   AND T.ORD_LN_DLY_PK = ? "
 +"   AND T.JUDGE_STOVE_NO = ? "
 +"   AND T.BATCH_NO = ? "
 +"   AND T.GROUP_NO = ? "
 +"   AND NVL(T.STD_CODE,'/') = NVL(?,'/') "
+" ORDER BY T.MAT_NO ASC";
	
	//关闭虚拟提单
	public static String updateYdmZcBillM1 =
		"update YDM_ZC_BILL_M T "
		+" SET "
		+" T.BILL_STATUS = '4', "
	    +" T.DELETE_NAME=?, "
	    +" T.DELETE_TIME =TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') "
		+" WHERE T.BILL_NO = ? "
		+" AND T.VALIDFLAG = '1'";
	
	//新增提单从表
	public static String addBillCInfo = "INSERT INTO YDM_ZC_BILL_C (PRT_FLAG, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, BILL_SQE, \r\n" +
			"BILL_NO, ORDER_NO, ORDER_SEQ, MAT_NO, LOT_NO, JUDGE_STOVE_NO, BATCH_NO, \r\n" + 
			"GROUP_NO, STOVE_NO, MATERIAL_NO, MATERIAL_NAME, PRODUCCODE, PRODUCNAME, \r\n" + 
			"STD_CODE, STD_NAME, GRADECODE, GRADENAME, STEELCODE, STEELNAME, STD_STYLE, \r\n" + 
			"STD_STYLE_DESC, SPEC_CODE, SPEC_NAME, MODEL_CODE, MODEL_DESC, PLINE_CODE, \r\n" + 
			"PLINE_NAME, ACT_DIMATER, ACT_HEIGHT, ACT_LEN, ACT_LEN_MIN, ACT_LEN_MAX, \r\n" + 
			"ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, JUDGE_RESULT_CODE, PRO_BC, PRO_BZ, \r\n" + 
			"RPO_TIME, STORAGE_NO, LOCATION_NO, CREATE_NAME, CREATE_TIME, DELIVERY_NO,\r\n" + 
			"VSTEL,VSTEL_DESC,SEND_NUM,BOUND_NUM,FINISHPRO_MOLD,IN_MOLD,ZBS_ID,JG_ZBS_ID,MEMO,IN_TYPE,RECEIVE_FLAG)\r\n" + 
			"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, \r\n" + 
			"?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, TO_DATE(?,'YYYY-MM-DD \r\n" + 
			"HH24:MI:SS'), (SELECT T.STORAGE_NO FROM YDM_ZC_BUTTRESS T WHERE T.MAT_NO=?), \r\n" + 
			"(SELECT T.LOCATION_NO FROM YDM_ZC_BUTTRESS T WHERE T.MAT_NO=?), ?, \r\n" + 
			"TO_DATE(?,'YYYY- MM-DD HH24:MI:SS'), ?,?,?,TO_NUMBER(?),TO_NUMBER(?),?,?,?,?,?,?,'0')";
	
	//查询合同物料信息
	public static String getOrdNoInfoByOrdLnPk = "SELECT T3.PRODUCCODE,\r\n" +
			"       T3.PRODUCNAME,\r\n" + 
			"       T3.STD_CODE,\r\n" + 
			"       T3.STD_NAME,\r\n" + 
			"       T3.STEELCODE,\r\n" + 
			"       T3.STEELNAME,\r\n" + 
			"       T3.STD_STYLE,\r\n" + 
			"       T3.STD_STYLE_DESC,\r\n" + 
			"       T3.SPEC_CODE,\r\n" + 
			"       T3.SPEC_NAME,\r\n" + 
			"       T3.DIMATER,\r\n" + 
			"       T3.HEIGHT,\r\n" + 
			"       T3.MODEL_CODE,\r\n" + 
			"       T3.MODEL_DESC,\r\n" + 
			"       T3.LEN_NO,\r\n" + 
			"       T3.LEN_DESC,\r\n" + 
			"       T3.LEN_UNIT,\r\n" + 
			"       T3.LEN_MIN,\r\n" + 
			"       T3.LEN_MAX,\r\n" + 
			"       T2.STLMT_UNIT_NO,\r\n" + 
			"       T2.STLMT_UNIT_NM,\r\n" + 
			"       T1.AGENCY_FL,\r\n" + 
			"       T1.PICKUP_FLAG,\r\n" + 
			"       T2.FST_DRAWEE_UNIT,\r\n" + 
			"       T1.RECEIV_ADDR,\r\n" + 
			"       T1.DELVRY_ADDR,\r\n" + 
			"       T1.EXTRA_FLAG,\r\n" + 
			"       T3.PRD_CLS\r\n" + 
			"  FROM SLM_ORDER_LINE_DELIVERY T1, SLM_ORDER_HEAD T2, SLM_ORDER_LINE T3\r\n" + 
			" WHERE T1.ORD_PK = T2.ORD_PK\r\n" + 
			"   AND T1.ORD_LN_PK = T3.ORD_LN_PK\r\n" + 
			"   AND T1.ORD_LN_DLY_PK =?\r\n" + 
			"   AND T1.VALIDFLAG = '1'\r\n" + 
			"   AND T2.VALIDFLAG = '1'\r\n" + 
			"   AND T3.VALIDFLAG = '1'";
	
	//获取主键
	public static String GetBom =
		"select sys_guid() BOM from dual";
	
	public static String InsertCraftOrdLineBom =
		"INSERT INTO CRAFT_ORD_LINE_BOM (DESGIN_KEY,BOM) values (?,?)";
	public static String InsertPlnSaleOrd =
			"INSERT INTO PLN_SALEORD "
            +" (ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, ORDER_NO, ORDER_SEQ, "
            +"  DELIVERY_NO, PRD_CLS, PRODUCCODE, PRODUCNAME, STD_CODE, "
            +"  STD_NAME,STEELCODE,STEELNAME,SPEC_CODE,SPEC_NAME,OUTDIAMETER, WALLTHICK, LEN_NO, LENGTHMIN, LENGTHMAX, "
            +"  LENGTHDISC, MODEL_CODE, MODEL_DESC, ORDER_UNIT, ORDER_QTY, "
            +"  ORDERWEIGHT, ORDERNUM, TOTLENGTH, DELVRY_RANGE_TPE, "
            +"  DELVRY_RANGE_MIN, DELVRY_RANGE_MAX, BUYER_ID, BUYER_NAME, "
            +"  ORDER_SPECIAL_DESC, ADD_ASK_NO, ORDER_ADD_DESC, "
            +"  ORDERFROM, FINAL_USER, FINAL_USER_DESC, "
			+"  DELVRY_EDATE, "
            +"  ORDERCONTACT, MONITORDEMAND, PSC, MSC, "
            +"  JZ_FILE_IF_ALL, PRDCR_NO, MATERIAL_NO, MATERIAL_DESC, "
            +"  SHRT_LEN_RATO, SHORTEST, LONG_LEN_RATO, LONGEST, SIGL_LEN, "
            +"  CREATE_NAME, CREATE_TIME,LEN_UNIT,OUTS_BILLET_FL,USE_CODE, "
            +"  USE_DESC,ENDLEN_SPECSTD,AVG_LEN_MIN,SHRT_STOVE,DIFRNC_LEN_MAX, "
            +"  STD_STYLE_DESC,OUTS_STL_PIPE_FL,ROLL_MONTH,ROLL_WELL_MONTH, "
            +"  DELVRY_QTY,CHARGE_NUM,CHARGE_WGT,CHARGE_LEN,ELIM_NUM,ELIM_WGT,ELIM_LEN,TOTLENGTH_UNIT, "
            +"  SUPPLY_UNIT_CODE,SUPPLY_UNIT,DELVRY_ADDR,TYPE_FLAG,CONFIRM_XS "
             
            +" ) "
     +" VALUES (?, ?, ?, ?, ?, "
             +" ?, ?, ?, ?, ?, "
            +"  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
            +"  ?, ?, ?, ?, ?, "
            +"  ?, ?, ?, ?, "
            +"  ?, ?, ?, ?, "
            +"  ?, ?, ?, "
            +"  ?, ?, ?,  "
            +"  TO_DATE (?, 'YYYY-MM-DD hh24:mi:ss'), "
            +"  ?, ?, ?, ?, "
            +"  ?, ?, ?, ?, "
            +"  ?, ?, ?, ?, ?, "
            +"  ?, SYSDATE,?,?,?,?, "
            +"  ?,?,?,?,?,?,?,?, "
            +"  ?,?,?,?,?,?,?,?, "
            +"  ?,?,?,?,'1' "
            +" )";
	public static String UpdateProcessOrderApp =
			"UPDATE  PROCESS_ORDER_M  "
	 	+" SET APP_NUM = ROUND(?,3), "
	 	+"     APP_UNIT = ? "
	 	+" WHERE ORD_LN_DLY_PK = ?";
	/**
	 * 合同行下的交货行状态
	 */
	public static String GetOrderDeliveryStatus =
			"SELECT 1 FROM SLM_ORDER_LINE_DELIVERY "
			 +" WHERE ORD_LN_PK = ? AND DELIVERY_STATUS !='12020402' "
			 +" AND TRIM(VALIDFLAG) = '1'";
	
	public static String UpdatePlnSaleOrdEndDly =
			" UPDATE PLN_SALEORD T "
	    +" SET T.IS_END_DLY = '1' "
	    +" WHERE T.ORD_LN_DLY_PK = (SELECT  MAX(A.ORD_LN_DLY_PK) FROM SLM_ORDER_LINE_DELIVERY A "
	                               +" WHERE A.ORD_LN_PK = ? AND A.VALIDFLAG = '1' )";
	/**
	 * 合同行状态修改
	 */
	public static String UpdateOrderLineStatus =
			"UPDATE SLM_ORDER_LINE "
	   	+" SET BE_ORDER_LN_STATUS = ORDER_LN_STATUS, "
	   	+"    ORDER_LN_STATUS = ? "
	   	+" WHERE  ORD_LN_PK = ? "
	   	+" AND  VALIDFLAG = '1'";
	/**
	 * 合同头下的合同行状态
	 */
	public static String GetOrderHeadStatus =
			"SELECT 1 FROM SLM_ORDER_LINE "
			+"  WHERE ORD_PK = ? AND ORDER_LN_STATUS !='12020402'"
			+"  AND TRIM(VALIDFLAG) = '1'";
	
	/**
	 * 交货行批量修改
	 */
	public static String UpdateOrderHeadStatusRep =
			"UPDATE SLM_ORDER_HEAD  "
	 	+" SET BE_ORDER_STS = ORDER_STS, "
	 	+"     ORDER_STS    = ?, "
	 	+"     ORDER_STS_DESC = ? "
	 	+"  WHERE ORD_PK = ? "
	 	+"  AND VALIDFLAG = '1'";
	
	/**
	 * 一条交货行行状态修改
	 */
	public static String UpdateDeliveryLineStatus =
			"UPDATE SLM_ORDER_LINE_DELIVERY "
	  +"  SET BE_DELIVERY_STATUS = DELIVERY_STATUS, "
	  +"      DELIVERY_STATUS = ? "
	  +"      WHERE ORD_LN_DLY_PK = ? "
	  +"      AND VALIDFLAG = '1'";
	/**
	 * 获取评审明细表
	 */
	public static String getCrmOrderInfo1 =
			"SELECT   H.ORD_PK, "
		+" L.ORD_LN_PK, "
		+" D.ORD_LN_DLY_PK, "
		+" H.ORDER_NO, "
		+" L.ORDER_SEQ, "
		+" D.DELIVERY_NO, "
		+" H.CUSTM_ORDER_NO, "
		+" H.ORDER_TYP, "
		+" H.ORDER_TYP_DESC, "
		+" C.REGION_NO, "
		+" (SELECT T.REGION_NM FROM SEL_ADMIN_REGION T WHERE T.REGION_NO=C.REGION_NO) REGION_NAME, "
		+" H.SALE_ORG, "
		+" H.SALE_ORG_DESC, "
		+" H.SALE_AREA_NO, "
		+" H.SALE_AREA_DESC, "
		+" H.CUSTOMER_NO, "
		+" H.CUSTOMER_NM, "
		+" H.CREATE_NAME, "
		+" D.RECEIV_NO, "
		+" D.RECEIV_NM, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.PRICE_FL) PRICE_FL, "
		+" D.DELVRY_QTY ORDER_QTY, "
		+" L.BALNCE_PRICE, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.CURRENCY) CURRENCY, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.MNY_ASK_TYP) MNY_ASK_TYP, "
		+" H.CONTAIN_TAX, "
		+" D.ORDER_UNIT, "
		+" L.PRODUCCODE, "
		+" L.PRODUCNAME, "
		+" L.STD_CODE, "
		+" L.STD_NAME, "
		+" L.STEELCODE, "
		+" L.STEELNAME, "
		+" L.STD_STYLE, "
		+" L.STD_STYLE_DESC, "
		+" L.MODEL_CODE, "
		+" L.MODEL_DESC, "
		+" L.ORDER_SPEC_CODE, "
		+" L.ORDER_SPEC_DESC, "
		+" L.SPEC_CODE, "
		+" L.SPEC_NAME, "
		+" L.DIMATER, "
		+" L.HEIGHT, "
		+" L.LEN_NO, "
		+" L.LEN_DESC, "
		+" L.LEN_UNIT, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=L.OUTS_BILLET_FL) OUTS_BILLET_FL, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=L.OUTS_STL_PIPE_FL) OUTS_STL_PIPE_FL, "
		+" H.MNY_ASK_DESC, "
		+" L.ISLOCK, "
		+" L.PRDCR_DESC, "
		+" L.MPS_DESC, "
		+" H.STLMT_UNIT_NO, "
		+" H.STLMT_UNIT_NM, "
		+" L.DELVRY_RANGE_TPE, "
		+" L.DELVRY_RANGE_MIN, "
		+" L.DELVRY_RANGE_MAX, "
		+" L.ADD_ASK_NO, "
		+" L.ORDER_ADD_DESC, "
		+" L.ORDER_SPECIAL_DESC, "
		+" D.DELIVERY_STATUS ORDER_STS, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=D.DELIVERY_STATUS) ORDER_STS_DESC, "
		+" L.ORDER_LN_STATUS ORDER_LN_STS, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=L.ORDER_LN_STATUS) ORDER_LN_STS_DESC, "
		+" H.SUPPLY_UNIT SUPPLY_UNIT_CODE, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.SUPPLY_UNIT) SUPPLY_UNIT, "
		+" D.WGT_ESTMT, "
		+" to_char(D.DELVRY_EDATE,'YYYY-MM-DD') DELVRY_EDATE, "
		+" to_char(H.EFFECT_TIME,'YYYY-MM-DD') EFFECT_TIME, "
		+" to_char((SELECT T.CREATE_TIME FROM PLN_SALEORD T WHERE T.ORD_LN_DLY_PK=D.ORD_LN_DLY_PK),'YYYY-MM-DD') TIBAO_TIME, "
		+" P.PORDERSTATUS, "
		+" L.BALNCE_PRICE_STS, "
		+" DECODE(l.KEEP_TYPE,'0','保单价','1','保总价') KEEP_TYPE, "
		+" (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=H.FST_DRAWEE_UNIT) FST_DRAWEE_UNIT, "
		+" H.ORDER_STS ORDER_HEAD_STS, "
		+" H.ORDER_STS_DESC ORDER_HEAD_STS_DESC "
		+" FROM 	SLM_ORDER_HEAD H "
		+" LEFT join SLM_ORDER_LINE L on H.ORD_PK = L.ORD_PK "
		+" LEFT JOIN SLM_BASE_CUSTOMER C ON H.CUSTOMER_NO = C.CUSTOMER_NO "
		+" LEFT JOIN SLM_ORDER_LINE_DELIVERY D ON L.ORD_LN_PK = D.ORD_LN_PK "
		+" LEFT JOIN PLN_SALEORD P ON D.ORD_LN_DLY_PK = P.ORD_LN_DLY_PK "
		+" WHERE 1 = 1";
	
	public static String insertCrmOrder =
			"INSERT INTO CRM_SLM_ORDER "
  +" (	ORD_PK, "
	+" ORD_LN_PK, "
	+" ORD_LN_DLY_PK, "
	+" ORDER_NO, "
	+" ORDER_SEQ, "
	+" DELIVERY_NO, "
	+" CUSTM_ORDER_NO, "
	+" ORDER_TYP, "
	+" ORDER_TYP_DESC, "
	+" REGION_NO, "
	+" REGION_NAME, "
	+" SALE_ORG, "
	+" SALE_ORG_DESC, "
	+" SALE_AREA_NO, "
	+" SALE_AREA_DESC, "
	+" CUSTOMER_NO, "
	+" CUSTOMER_NM, "
	+" RECEIV_NO, "
	+" RECEIV_NM, "
	+" PRICE_FL, "
	+" ORDER_QTY, "
	+" BALNCE_PRICE, "
	+" CURRENCY, "
	+" MNY_ASK_TYP, "
	+" CONTAIN_TAX, "
	+" ORDER_UNIT, "
	+" PRODUCCODE, "
	+" PRODUCNAME, "
	+" STD_CODE, "
	+" STD_NAME, "
	+" STEELCODE, "
	+" STEELNAME, "
	+" STD_STYLE, "
	+" STD_STYLE_DESC, "
	+" MODEL_CODE, "
	+" MODEL_DESC, "
	+" ORDER_SPEC_CODE, "
	+" ORDER_SPEC_DESC, "
	+" SPEC_CODE, "
	+" SPEC_NAME, "
	+" DIMATER, "
	+" HEIGHT, "
	+" LEN_NO, "
	+" LEN_DESC, "
	+" LEN_UNIT, "
	+" OUTS_BILLET_FL, "
	+" OUTS_STL_PIPE_FL, "
	+" MNY_ASK_DESC, "
	+" ISLOCK, "
	+" PRDCR_DESC, "
	+" MPS_DESC, "
	+" STLMT_UNIT_NO, "
	+" STLMT_UNIT_NM, "
	+" DELVRY_RANGE_TPE, "
	+" DELVRY_RANGE_MIN, "
	+" DELVRY_RANGE_MAX, "
	+" ADD_ASK_NO, "
	+" ORDER_ADD_DESC, "
	+" ORDER_SPECIAL_DESC, "
	+" ORDER_STS, "
	+" ORDER_STS_DESC, "
	+" ORDER_LN_STS, "
	+" ORDER_LN_STS_DESC, "
	+" SUPPLY_UNIT_CODE, "
	+" SUPPLY_UNIT, "
	+" WGT_ESTMT, "
	+" DELVRY_EDATE, "
	+" EFFECT_TIME, "
	+" TIBAO_TIME, "
	+" DATA_STATUS, "
	+" CREATE_TIME, "
	+" CREATE_NAME, "
	+" FST_DRAWEE_UNIT, "
	+" BALNCE_PRICE_STS, "
	+" DATA_FLAG, "
	+" KEEP_TYPE, "
	+" ORDER_HEAD_STS, "
    +" ORDER_HEAD_STS_DESC) "
+" VALUES "
  +" ( "
    +" '#ORD_PK#', "
	+" '#ORD_LN_PK#', "
	+" '#ORD_LN_DLY_PK#', "
	+" '#ORDER_NO#', "
	+" '#ORDER_SEQ#', "
	+" '#DELIVERY_NO#', "
	+" '#CUSTM_ORDER_NO#', "
	+" '#ORDER_TYP#', "
	+" '#ORDER_TYP_DESC#', "
	+" '#REGION_NO#', "
	+" '#REGION_NAME#', "
	+" '#SALE_ORG#', "
	+" '#SALE_ORG_DESC#', "
	+" '#SALE_AREA_NO#', "
	+" '#SALE_AREA_DESC#', "
	+" '#CUSTOMER_NO#', "
	+" '#CUSTOMER_NM#', "
	+" '#RECEIV_NO#', "
	+" '#RECEIV_NM#', "
	+" '#PRICE_FL#', "
	+" '#ORDER_QTY#', "
	+" '#BALNCE_PRICE#', "
	+" '#CURRENCY#', "
	+" '#MNY_ASK_TYP#', "
	+" '#CONTAIN_TAX#', "
	+" '#ORDER_UNIT#', "
	+" '#PRODUCCODE#', "
	+" '#PRODUCNAME#', "
	+" '#STD_CODE#', "
	+" '#STD_NAME#', "
	+" '#STEELCODE#', "
	+" '#STEELNAME#', "
	+" '#STD_STYLE#', "
	+" '#STD_STYLE_DESC#', "
	+" '#MODEL_CODE#', "
	+" '#MODEL_DESC#', "
	+" '#ORDER_SPEC_CODE#', "
	+" '#ORDER_SPEC_DESC#', "
	+" '#SPEC_CODE#', "
	+" '#SPEC_NAME#', "
	+" '#DIMATER#', "
	+" '#HEIGHT#', "
	+" '#LEN_NO#', "
	+" '#LEN_DESC#', "
	+" '#LEN_UNIT#', "
	+" '#OUTS_BILLET_FL#', "
	+" '#OUTS_STL_PIPE_FL#', "
	+" '#MNY_ASK_DESC#', "
	+" '#ISLOCK#', "
	+" '#PRDCR_DESC#', "
	+" '#MPS_DESC#', "
	+" '#STLMT_UNIT_NO#', "
	+" '#STLMT_UNIT_NM#', "
	+" '#DELVRY_RANGE_TPE#', "
	+" '#DELVRY_RANGE_MIN#', "
	+" '#DELVRY_RANGE_MAX#', "
	+" '#ADD_ASK_NO#', "
	+" '#ORDER_ADD_DESC#', "
	+" '#ORDER_SPECIAL_DESC#', "
	+" '#ORDER_STS#', "
	+" '#ORDER_STS_DESC#', "
	+" '#ORDER_LN_STS#', "
	+" '#ORDER_LN_STS_DESC#', "
	+" '#SUPPLY_UNIT_CODE#', "
	+" '#SUPPLY_UNIT#', "
	+" '#WGT_ESTMT#', "
	+" TO_DATE('#DELVRY_EDATE#','YYYY-MM-DD'), "
	+" TO_DATE('#EFFECT_TIME#','YYYY-MM-DD'), "
	+" TO_DATE('#TIBAO_TIME#','YYYY-MM-DD'), "
	+" '#DATA_STATUS#', "
	+" SYSDATE, "
	+" '#CREATE_NAME#', "
	+" '#FST_DRAWEE_UNIT#', "
	+" '#BALNCE_PRICE_STS#', "
	+" '#DATA_FLAG#', "
	+" '#KEEP_TYPE#', "
	+" '#ORDER_HEAD_STS#', "
    +" '#ORDER_HEAD_STS_DESC#' "
+" )	";
	
	public static String queryProcessOrderM =
			"SELECT "
        +" T.ORD_LN_DLY_PK, "
        +" T.DELVRY_QTY, "
        +" T.ORDER_UNIT, "
        +" T.ENSU_TOTL_LEN, "
        +" T.APP_NUM, "
        +" T.APP_UNIT, "
        +" T.PSS_NUM, "
        +" T.PSS_WGT, "
        +" T.PAY_NUM, "
        +" T.PAY_LEN, "
        +" T.PAY_WGT, "
        +" T.NEG_PAY_NUM, "
        +" T.NEG_PAY_LEN, "
        +" T.NEG_PAY_WGT, "
        +" T.OUT_NUM, "
        +" T.OUT_WGT, "
        +" T.OUT_LEN, "
        +" T.NEG_OUT_NUM, "
        +" T.NEG_OUT_WGT, "
        +" T.NEG_OUT_LEN, "
        +" T.ELIM_NUM, "
        +" T.ELIM_WGT, "
        +" T.ELIM_LEN, "
        +" T.CHARGE_NUM, "
        +" T.CHARGE_WGT, "
        +" T.CHARGE_LEN, "
        +" T.SOK_WGT, "
        +" T.INV_NUM, "
        +" T.INV_WGT, "
        +" T.INV_LEN, "
        +" T.ONV_NUM, "
        +" T.ONV_WGT, "
        +" T.ONV_LEN, "
        +" T.EVENT_ID, "
        +" T.EVENT_DESC, "
        +" T.FORM_NAME, "
        +" T.CALL_FUNC_CODING, "
        +" TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME, "
        +" T.ACCOUNT_NUM, "
        +" T.ACCOUNT_WGT, "
        +" T.ACCOUNT_LEN, "
        +" TO_CHAR(T.EFFECT_TIME, 'YYYY-MM-DD HH24:MI:SS') EFFECT_TIME, "
        +" D.WGT_ESTMT "
        +" FROM PROCESS_ORDER_M T,SLM_ORDER_LINE_DELIVERY D "
       +"  WHERE "
        +" T.ORD_LN_DLY_PK = D.ORD_LN_DLY_PK";
	
	public static String insertCrmOrderProduce =
			"INSERT INTO CRM_ORDER_PRODUCE( "
        +" ORD_LN_DLY_PK, "
        +" CREATE_NAME, "
        +" CREATE_TIME, "
        +" APP_NUM, "
        +" APP_UNIT, "
        +" PSS_NUM, "
        +" PSS_WGT, "
        +" WGT_ESTMT, "
        +" LG_NUM, "
        +" LG_WGT, "
        +" LG_TIME, "
        +" D_PLINE_CODE, "
        +" D_PLINE_NAME, "
        +" PASS_CODE, "
        +" PASS_NAME, "
        +" PLAN_TIME_B, "
        +" EXE_STATUS, "
        +" GRADECODE, "
        +" GRADENAME, "
        +" DIAMETER_GP, "
        +" ZG_NUM, "
        +" ZG_WGT, "
        +" PLAN_TIME_DBK, "
        +" DBK_NUM, "
        +" DBK_WGT, "
        +" PLAN_TIME_RCL, "
        +" RCL_NUM, "
        +" RCL_WGT, "
       +"  PLAN_TIME_JGX, "
        +" JGX_NUM, "
        +" JGX_WGT, "
        +" PRODUCT_NUM, "
        +" PRODUCT_WGT, "
        +" PRODUCT_LEN, "
        +" DATA_STATUS) "
       +"  VALUES( "
       +"  '#ORD_LN_DLY_PK#', "
       +"  '#CREATE_NAME#', "
       +"  SYSDATE, "
       +"  '#APP_NUM#', "
       +"  '#APP_UNIT#', "
       +"  '#PSS_NUM#', "
       +"  '#PSS_WGT#', "
       +"  '#WGT_ESTMT#', "
       +"  '#LG_NUM#', "
       +"  '#LG_WGT#', "
       +"  '#LG_TIME#', "
       +"  '#D_PLINE_CODE#', "
       +"  '#D_PLINE_NAME#', "
       +"  '#PASS_CODE#', "
       +"  '#PASS_NAME#', "
       +"  TO_DATE(substr('#PLAN_TIME_B#', 0, 19),'YYYY-MM-DD HH24:mi:ss'), "
       +"  '#EXE_STATUS#', "
       +"  '#GRADECODE#', "
       +"  '#GRADENAME#', "
       +"  '#DIAMETER_GP#', "
       +"  '#ZG_NUM#', "
       +"  '#ZG_WGT#', "
       +"  TO_DATE(substr('#PLAN_TIME_DBK#', 0, 19),'YYYY-MM-DD HH24:mi:ss'), "
       +"  '#DBK_NUM#', "
       +"  '#DBK_WGT#', "
       +"  TO_DATE(substr('#PLAN_TIME_RCL#', 0, 19),'YYYY-MM-DD HH24:mi:ss'), "
       +"  '#RCL_NUM#', "
       +"  '#RCL_WGT#', "
       +"  TO_DATE(substr('#PLAN_TIME_JGX#', 0, 19),'YYYY-MM-DD HH24:mi:ss'), "
       +"  '#JGX_NUM#', "
       +"  '#JGX_WGT#', "
       +"  '#PRODUCT_NUM#', "
       +"  '#PRODUCT_WGT#', "
       +"  '#PRODUCT_LEN#', "
       +"  '#DATA_STATUS#')";
	
	public static String SelectOrderLineDeliveryStatus =
			"SELECT DELIVERY_STATUS "
	     +" FROM SLM_ORDER_LINE_DELIVERY "
	     +" WHERE ORD_LN_DLY_PK = ? "
	     +" AND VALIDFLAG = '1'";
	
	public static String GetPLNSaleOrderStatus =
			"SELECT PORDERSTATUS FROM PLN_SALEORD "
			 +" WHERE ORD_PK = ? AND ORD_LN_PK = ? "
			 +" AND ORD_LN_DLY_PK = ?  ";
	public static String DeletePlnSaleOrdLine =
			"DELETE FROM PLN_SALEORD  "
			+" WHERE ORD_PK=? "
			+" AND ORD_LN_PK=? "
			+" AND ORD_LN_DLY_PK=?";
	
	public static String ClearProcessOrderApp =
			"UPDATE  PROCESS_ORDER_M  "
	 	+" SET APP_NUM = 0, "
	 	+"     APP_UNIT = '' "
	 	+" WHERE ORD_LN_DLY_PK = ?";
	public static String GetDeliveryBeStatusWithOrdLnDlyPk =
			"SELECT  BE_DELIVERY_STATUS FROM SLM_ORDER_LINE_DELIVERY "
	 +" WHERE ORD_LN_DLY_PK = ? AND VALIDFLAG = '1'";
	public static String UpdateDeliveryLineOneStatus =
			"UPDATE SLM_ORDER_LINE_DELIVERY "
     +" SET DELIVERY_STATUS = BE_DELIVERY_STATUS, "
     +"    BE_DELIVERY_STATUS = ? "
     +" WHERE ORD_LN_DLY_PK = ? "
     +" AND VALIDFLAG = '1'";
	
	public static String GetDeliveryOrderStatus =
			"SELECT 1 FROM SLM_ORDER_LINE_DELIVERY "
			+" WHERE ORD_LN_PK = ?   "
			+"  AND DELIVERY_STATUS ='12020402'  "
			+"  AND VALIDFLAG = '1'";
	public static String GetDeliveryOrderStatusWithOrdPk =
			"SELECT 1 FROM SLM_ORDER_LINE_DELIVERY "
			+" WHERE ORD_PK = ? " 
			+"  AND DELIVERY_STATUS ='12020402' " 
			+"  AND VALIDFLAG = '1'";
	public static String UpdateOrderHeadOneStatus =
			"UPDATE SLM_ORDER_HEAD "
       +" SET ORDER_STS = ?,  "
       +" ORDER_STS_DESC   = ? "
       +" WHERE ORD_PK = ? "
       +" AND VALIDFLAG = '1'";
	public static String UpdateHeadStatusWithOrdLnDlyPk =
			"UPDATE SLM_ORDER_HEAD "
     +" SET ORDER_STS = ?, "
     +"   ORDER_STS_DESC =  "
     +"   (SELECT BASENAME FROM COM_BASE_INFO  "
     +"   WHERE BASECODE=? AND VALIDFLAG='1') "
     +" WHERE ORD_PK = ? "
     +" AND VALIDFLAG = '1'";
	
	public static String DeleteCraftSamplingTotal =
			"DELETE FROM CRAFT_SAMPLING_M WHERE ORD_LN_PK = ?";
	
	public static String InsertCraftSamplingTotal =
			"INSERT INTO CRAFT_SAMPLING_M "
  +" (ORD_LN_PK, "
  +" CRAFT_SEQ,  "
  +"  CRAFT_NO, "
  +"  PROCESS_CODE, "
  +"  BATCH_NUM, "
  +"  BATCH_NO, "
  +"  SAMPLE_LENGTH, "
  +"  POSITION, "
  +"  DESC_POSITION, "
  +"  SAMPLE_COUNT, "
  +"  REMARK, "
  +"  PHY_NAME_GROUP, "
  +"  PHY_CODE_GROUP, "
  +"  STOVE_NUM) "
+" VALUES "
+"   (?, "
+"   ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?)";
	public static String DeleteCraftSamplingDetail =
			"DELETE  FROM CRAFT_SAMPLING_DETAIL WHERE ORD_LN_PK = ?";
	
	public static String InsertCraftSamplingDetail =
			"INSERT INTO CRAFT_SAMPLING_DETAIL "
  +" (ORD_LN_PK, "
  +" CRAFT_SEQ, "
  +" CRAFT_NO, "
 +"   PROCESS_CODE, "
 +"   TYPE, "
 +"   SPLINE_NO, "
 +"   PHY_CODE_MIN, "
 +"   PHY_NAME_MIN, "
 +"   RATE, "
 +"   DESC_RATE, "
 +"   BATCH_UNIT, "
 +"   BATCH_CNT, "
 +"   BATCH_CNT_M, "
 +"   DESC_COUNT, "
 +"   SAMPLE_COUNT, "
 +"   POSITION, "
 +"   DESC_POSITION, "
 +"   LENGTH, "
 +"   WIDTH, "
 +"   SAMPLE_STYLE, "
 +"   SAMPLE_STYLE_DESC, "
 +"   PHY_CODE_GROUP, "
 +"   PHY_NAME_GROUP, "
 +"   ATTACH_PERCENT, "
 +"   ATTACH_COUNT, "
 +"   TOP_STOVE, "
 +"   LOOP_VALUE, "
 +"   PIC) "
+" VALUES "
+"   (?, "
+"   ?, "
+"   ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"     ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
+"    ?, "
 +"   ?, "
+"    ?, "
+"     ?)";
	public static String getCraftPicSmpGroup =
	  " SELECT ? CRAFT_NO,"
	  + " ? PROCESS_CODE, "
	  + " '0' TYPE, "
	  + "    '/' SPLINE_NO, "
      + "  'HX' PHY_CODE_MIN, "
      + "   '成分' PHY_NAME_MIN, "
      + "    NVL(NVL(RATE_N,T.RATE),'408603') RATE, "
      + "    (SELECT BASENAME FROM COM_BASE_INFO WHERE BASECODE =  NVL(NVL(RATE_N,T.RATE),'408603')) DESC_RATE, "
     + "    '/' BATCH_UNIT, "
      + "    '' BATCH_CNT, "
     
     + "    NVL(NVL(PRODUCT_CNT_N,T.PRODUCT_CNT),2)  DESC_COUNT, "
     + "   TO_NUMBER('') SAMPLE_COUNT, "
     + "    '401203' POSITION, "
      + "   'A端或B端' DESC_POSITION, "
      + "   DECODE((SELECT COUNT(1) "
      + " FROM CRAFT_ORD_DESIGN_STD_CIC T "
 + " WHERE T.DESGIN_KEY = ? "
  + "  AND ( CHEM_NAME = 'H' OR CHEM_NAME = 'O' ) "
  + "  AND SPECL_FL  IN ('0','1')),0,'50','100') LENGTH, "
  + "  TO_NUMBER(DECODE((SELECT COUNT(1) "
  + " FROM CRAFT_ORD_DESIGN_STD_CIC T "
 + " WHERE T.DESGIN_KEY = ? "
  + "  AND T.MSC_PLINE ='000001' "
  + "  AND T.PROCESS_CODE = ? "
  + "  AND ( CHEM_NAME = 'H' OR CHEM_NAME = 'O' ) "
  + "  AND SPECL_FL  IN ('1','0') "
  + "  ),0,'50','100')) WIDTH, "
  + "        A.BASECODE SAMPLE_STYLE, "
  + "       A.BASENAME SAMPLE_STYLE_DESC, "
  + "      '/'  PHY_CODE_GROUP, "
  + "      '/'  PHY_NAME_GROUP, "
  + "      '' ATTACH_PERCENT, "
  + "      ''  ATTACH_COUNT, "
  + "      ''  TOP_STOVE, "
   + "     ''  LOOP_VALUE, "
    +" ? ORD_LN_PK,"   
 + "   '1' craft_seq, "
 + "      '' PIC "
 + "   FROM CRAFT_ORD_DESIGN_STD T "
 + "   LEFT JOIN COM_BASE_INFO A ON A.BASECODE =  '408101' "
 + " WHERE T.DESGIN_KEY = ? "
 + " AND EXISTS ( "
+ " SELECT 1 "
+ "        FROM CRAFT_ORD_DESIGN_STD_CIC T "
 + "      WHERE T.DESGIN_KEY =? "
    		  + "         AND T.PROCESS_CODE =  ? "
 + "        AND EXISTS "
  + "     (SELECT 1 "
   + "             FROM CRAFT_ORD_DESIGN A, PLN_SALEORD B, PLN_SALEORD_PROC C "
   + "            WHERE A.DESGIN_KEY = T.DESGIN_KEY "
   + "              AND A.ORD_LN_PK = B.ORD_LN_PK "
   + "              AND B.ORD_LN_DLY_PK = C.ORD_LN_DLY_PK "
    + "             AND C.INDEX_SEQ = T.MSC_PLINE "
    + "             AND C.PLN_DIVIDE_ID = "
    + "                 (SELECT MAX(D.PLN_DIVIDE_ID) "
   + "                     FROM PLN_SALEORD_PROC D "
   + "                    WHERE D.ORD_LN_DLY_PK = C.ORD_LN_DLY_PK))) "
 + "  UNION ALL"
			+" SELECT ? craft_no, "
       +" MAX(T.PROCESS_CODE) PROCESS_CODE, "
       +" MAX(CASE "
       +"       WHEN T.CRAFT_SOURCE = '0' THEN "
       +"        '0' "
       +"       WHEN T.CRAFT_SOURCE = '2' THEN "
       +"        '1' "
       +"     END) TYPE, "
       +" '/' SPLNE_NO, "
       +" MAX(T.PHY_CODE_MIN) PHY_CODE_MIN, "
       +" MAX(T.PHY_NAME_MIN) PHY_NAME_MIN, "
       +" MAX(T.RATE) RATE, "
       +" MAX(T.Desc_Rate) Desc_Rate, "
       +" max(t.batch_unit) batch_unit, "
       +" to_char(max(t.batch_cnt)) batch_cnt, "
       +" max(t.desc_count) desc_count, "
       +" SUM(T.SAMPLE_COUNT) SAMPLE_COUNT, "
       +" max(t.position) position, "
       +" MAX(T.DESC_POSITION) DESC_POSITION, "
       +" MAX(T.LENGTH) LENGTH, "
       +" MAX(T.WIDTH) WIDTH, "
       +" max(a.basecode) SAMPLE_STYLE, "
       +" MAX(A.BASENAME) SAMPLE_STYLE_DESC, "
       +" (select to_char(wmsys.wm_concat(distinct x.phy_code)) "
       +"    from craft_ord_design_std_pic x "
       +"   where x.desgin_key = ? "
       +"     and x.process_code = ? "
       +"     AND X.PHY_CODE_MIN = T.PHY_CODE_MIN) phy_code_group, "
       +" (select to_char(wmsys.wm_concat(distinct x.phy_NAME)) "
       +"    from craft_ord_design_std_pic x "
       +"   where x.desgin_key = ? "
       +"     and x.process_code = ? "
       +"     AND X.PHY_CODE_MIN = T.PHY_CODE_MIN) phy_NAME_group, "
       +" to_char(max(t.attach_percent)) attach_percent, "
       +" to_char(max(t.attach_count)) attach_count, "
       +" to_char(max(t.top_stove)) top_stove, "
       +" to_char(max(t.loop_value)) loop_value, "
       +" ? ord_ln_pk, "
       +" '1' craft_seq, "
       +" max(t.pic) pic "
  +" FROM CRAFT_ORD_DESIGN_STD_PIC_SMP T "
  +" LEFT JOIN COM_BASE_INFO A "
  +"   ON A.BASECODE = T.SAMPLE_STYLE "
 +" WHERE T.DESGIN_KEY = ? "
 +"   AND T.PROCESS_CODE = ? "
 + " AND CRAFT_SOURCE = '0'"
 +"   AND EXISTS "
 +" (SELECT 1 "
 +"          FROM CRAFT_ORD_DESIGN D, PLN_SALEORD E, PLN_SALEORD_PROC F "
 +"         WHERE D.DESGIN_KEY = T.DESGIN_KEY "
 +"           AND D.ORD_LN_PK = E.ORD_LN_PK "
 +"           AND E.ORD_LN_DLY_PK = F.ORD_LN_DLY_PK "
 +"           AND F.INDEX_SEQ = T.MSC_PLINE "
 +"           AND F.PLN_DIVIDE_ID = "
 +"               (SELECT MAX(F.PLN_DIVIDE_ID) "
 +"                  FROM PLN_SALEORD_PROC G "
 +"                 WHERE G.ORD_LN_DLY_PK = F.ORD_LN_DLY_PK)) "
 +" GROUP BY T.PHY_CODE_MIN";
	public static String getCraftPicSmpGroup1 =
			"select ? craft_no,"
			+ "? PROCESS_CODE,"
			+ "'1' batch_num,"
			+ "'1' batch_no,"
			+ "sum(length) sample_length,"
			+ "max(position) position,"
			+ "max(DESC_POSITION) DESC_POSITION,"
			+ "sum(SAMPLE_COUNT) SAMPLE_COUNT,"
			+ "'' remark,"
			+" max((select to_char(wmsys.wm_concat(distinct x.Phy_Code_Min)) "
		       +"    from craft_ord_design_std_pic x "
		       +"   where x.desgin_key = ? "
		       +"     and x.process_code = ? )) phy_code_group, "
		       +" max((select to_char(wmsys.wm_concat(distinct x.Phy_name_Min)) "
		       +"    from craft_ord_design_std_pic x "
		       +"   where x.desgin_key = ? "
		       +"     and x.process_code = ? )) phy_NAME_group, "
		       +" '' stove_num,"
		       + "? ord_ln_pk,"
		       + "'1' craft_seq,"
		       + "'' batch_seq "
		       + " from Craft_Sampling_Detail where ord_ln_pk = ?";
	
	public static String getCraftPicSmpGroup2 =
			"select ? craft_no,"
			+ "? PROCESS_CODE,"
			+ "'1' batch_num,"
			+ "'1' batch_no,"
			+ "sum(length) sample_length,"
			+ "max(position) position,"
			+ "max(DESC_POSITION) DESC_POSITION,"
			+ "sum(SAMPLE_COUNT) SAMPLE_COUNT,"
			+ "'' remark,"
			+" max((select to_char(wmsys.wm_concat(distinct x.Phy_Code_Min)) "
		       +"    from craft_ord_design_std_pic x "
		       +"   where x.desgin_key = ? "
		       +"     and x.process_code = ? "
		       + "    and x.phy_code_min in (select phy_code_min from Craft_Sampling_Detail where ord_ln_pk = ? and rate = ?))) phy_code_group, "
		       +" max((select to_char(wmsys.wm_concat(distinct x.Phy_name_Min)) "
		       +"    from craft_ord_design_std_pic x "
		       +"   where x.desgin_key = ? "
		       +"     and x.process_code = ? "
		       + " and x.phy_code_min in (select phy_code_min from Craft_Sampling_Detail where ord_ln_pk = ? and rate = ?))) phy_NAME_group, "
		       +" '' stove_num,"
		       + "? ord_ln_pk,"
		       + "'1' craft_seq,"
		       + "'' batch_seq "
		       + " from Craft_Sampling_Detail where ord_ln_pk = ? ";
	
	/**
	 * 删除合同行
	 */
	
	public static String deleteSlmOrderLine =
			" delete from slm_order_line where ord_ln_pk = ?";
	
	/**
	 * 删除合同交货行
	 */
	
	public static String deleteSlmOrderLineDelivery =
			" delete from slm_order_line_delivery where ord_ln_pk = ?";
}

