<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="接箍码和备料码">
       <query id="IMscJGBLDao.getJGByDAndH" desc="查询接箍码 外径、壁厚">  
             <![CDATA[ 
           SELECT P.CODE_JG
  FROM (SELECT A.CODE_JG,
               NVL(B.MIN_H_CP, '0') MIN_H_CP,
               NVL(B.MAX_H_CP, '10000') MAX_H_CP,
               NVL(B.MIN_D_JG, '0') MIN_D_JG,
               NVL(B.MAX_D_JG, '10000') MAX_D_JG
          FROM COM_MSC_R_JG A, COM_MSC_JG B
         WHERE A.CODE_JG = B.CODE_JG
           AND A.MSC = ?
           AND A.STEELCODE = ?
           AND A.STOCK_STYLE = 'A'
           AND A.VALIDFLAG = '1'
           AND B.VALIDFLAG = '1') P
 WHERE TO_NUMBER(P.MIN_H_CP) <= TO_NUMBER(?)
   AND TO_NUMBER(P.MAX_H_CP) >= TO_NUMBER(?)
   AND TO_NUMBER(P.MIN_D_JG) <= TO_NUMBER(?)
   AND TO_NUMBER(P.MAX_D_JG) >= TO_NUMBER(?)
                     ]]>
	   </query>
	   
	   <query id="IMscJGBLDao.getMscBL" desc="查询备料码">  
             <![CDATA[ 
            SELECT T.CODE_JG,
                   T.GROUP_NUM
              FROM COM_MSC_R_JG T
             WHERE T.MSC = ? 
               AND T.STOCK_STYLE = 'B'
               AND T.VALIDFLAG = 1
                     ]]>
	   </query>
	   
	   <query id="IMscJGBLDao.saveMscJG" desc="保存接箍码">  
             <![CDATA[ 
             INSERT INTO SLM_ORD_DESIGN_MSC_JG (DESGIN_KEY, CODE_JG) VALUES (?, ?)
                     ]]>
	   </query>
	   
	   <query id="IMscJGBLDao.saveMscBL" desc="保存备料码">  
             <![CDATA[ 
             INSERT INTO SLM_ORD_DESIGN_MSC_BL
                        (DESGIN_KEY, GROUP_NUM, PSC_BL)
                  VALUES
                        (?, ?, ?) 
                     ]]>
	   </query>
	   
	    <query id="IMscJGBLDao.saveMscJGBL" desc="保存接箍与备料关系">  
             <![CDATA[ 
            INSERT INTO SLM_ORD_DESIGN_MSC_JG_BL
                       (DESGIN_KEY, CODE_JG, PSC_BL)
                 VALUES
                       (?, ?, ?)
                     ]]>
	   </query>
	   
	    <query id="IMscJGBLDao.getMscJGBL" desc="查询接箍与备料关系">  
             <![CDATA[ 
            SELECT T.CODE_JG, T.PSC_BL
              FROM COM_MSC_JG_R_BL T
             WHERE T.CODE_JG = ?
               AND T.VALIDFLAG = 1
                     ]]>
	   </query>
	   
	    <query id="IMscJGBLDao.getMscJGByJGCode" desc="查询接箍码信息">  
             <![CDATA[ 
           SELECT CODE_JG,
       SPEC_JG,
       SPEC_JG_DESC,
       PRODUCCODE_JG,
       PRODUCCODE_JG_DESC,
       STEELCODE_JG,
       STEELCODE_JG_DESC,
       MODEL_CODE,
       MODEL_DESC,
       STYLE_JG,
       MIN_D,
       MIN_H,
       DIAMETER_JG,
       HEIGHT_JG,
       LENGTH_JG,
       WEIGHT_JG,
       DIAMETER,
       ALPHA,
       DIAMETER_PL,
       HEIGHT_PL,
       LENGTH_MIN,
       LENGTH_MAX,
       PRODUCCODE,
       PRODUCNAME,
       MIN_H_CP,
       MAX_H_CP,
       MIN_D_CP,
       MAX_D_CP,
       STD_CODE,
       STD_NAME,
       CHECK_J_VAL,
       STD_STYLE,
       STD_STYLE_DESC,
       TAPER,
       MIN_D_JG,
       MAX_D_JG
  FROM COM_MSC_JG T
 WHERE T.CODE_JG = ?
   AND T.VALIDFLAG = 1
                     ]]>
	   </query>
	   
	   <query id="IMscJGBLDao.getBLByBLCode" desc="查询备料码信息">  
             <![CDATA[ 
          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,
       MIN_L,
       MAX_L,
       FILE_JPG
  FROM COM_MSC_BL T
 WHERE T.PSC_BL = ?
   AND T.VALIDFLAG = 1
                     ]]>
	   </query>
	   
</queryMap>