<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="BOM清单生成">

	<query id="IBomJGDao.getJGInfo" 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,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       VALIDFLAG,
       MEMO,
       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 = ?
		]]>
	</query>

	<query id="IBomJGDao.getJGBLInfo" desc=" 查询接箍码的备料信息 ">
		<![CDATA[
		SELECT A.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 A, COM_MSC_JG_R_BL B
 WHERE A.PSC_BL = B.PSC_BL
   AND B.CODE_JG = ?
		]]>
	</query>

	<query id="IBomJGDao.saveJGBom" desc="保存接箍物料编码">
		<![CDATA[
		INSERT INTO SLM_ORD_DESIGN_BOM
                   (MATERIAL_NO, MATERIAL_DESC, BOM, BOM_TYP)
                    VALUES
                   (?, ?, SYS_GUID(), ?)		
		]]>
	</query>

	<query id="IBomJGDao.getJGBom" desc="查询接箍物料编码">
		<![CDATA[
		SELECT T.BOM, T.MATERIAL_NO, T.MATERIAL_DESC
          FROM SLM_ORD_DESIGN_BOM T
         WHERE T.MATERIAL_NO = ?
		]]>
	</query>

	<query id="IBomJGDao.saveBomJ" desc="保存接箍">
		<![CDATA[
        INSERT INTO SLM_ORD_DESIGN_BOM_J
                   (BOM,BOM_JG, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
             VALUES
                   (?, ?, ?, ?)        
		]]>
	</query>

	<query id="IBomJGDao.saveBomG" desc="保存接箍加工">
		<![CDATA[
       INSERT INTO SLM_ORD_DESIGN_BOM_G
                  (BOM,
                   BOM_JG,
                   IN_MATERIAL_NO,
                   IN_MATERIAL_DESC,
                   MID_MATERIAL_NO,
                   MID_MATERIAL_DESC,
                   OUT_MATERIAL_NO,
                   OUT_MATERIAL_DESC)
            VALUES
                  (?, ?, ?, ?, ?, ?, ?, ?)
		]]>
	</query>

	<query id="IBomJGDao.getJGCodeQuality" desc="查询质量设计接箍码">
		<![CDATA[
       SELECT CODE_JG FROM SLM_ORD_DESIGN_MSC_JG T WHERE T.DESGIN_KEY = ?
		]]>
	</query>

	<query id="IBomJGDao.getJGCodeCraft" desc="查询工艺接箍码">
		<![CDATA[
       SELECT CODE_JG FROM CRAFT_ORD_DESIGN_MSC_JG T WHERE T.DESGIN_KEY = ?
		]]>
	</query>


	<query id="IBomJGDao.checkJGCode" desc="验证质量设计-BOM-接箍是否重复">
		<![CDATA[
      SELECT COUNT(*) COUNT
        FROM SLM_ORD_DESIGN_BOM_J T
       WHERE T.BOM = ?
         AND T.BOM_JG = ?
         AND T.OUT_MATERIAL_NO = ?
		]]>
	</query>

	<query id="IBomJGDao.checkCodeI" desc="验证质量设计-BOM-加工环节是否重复">
		<![CDATA[
      SELECT COUNT(*)  COUNT
  FROM SLM_ORD_DESIGN_BOM_I T
 WHERE T.BOM = ?
   AND T.IN_MATERIAL_NO = ?
   AND T.OUT_MATERIAL_NO = ?
		]]>
	</query>

	<query id="IBomJGDao.checkCodeG" desc="验证质量设计-BOM-接箍加工是否重复">
		<![CDATA[
      SELECT COUNT(*) COUNT
  FROM SLM_ORD_DESIGN_BOM_G T
 WHERE T.BOM = ?
   AND T.BOM_JG = ?
   AND T.IN_MATERIAL_NO = ?
   AND T.OUT_MATERIAL_NO = ?
      
		]]>
	</query>


</queryMap>	