<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="制程">

	<query id="IProDucDao.getProDuc" desc="查询有效制程">
         <![CDATA[
       SELECT A.MSC, A.MSC_PLINE, A.WHOLE_BACKLOG, A.WHOLE_BACKLOG_DESC, A.AUTO_CRAFT
         FROM COM_MSC_BACKLOG A
        WHERE A.MSC = ?
          AND A.VALIDFLAG != 0
         ]]>
	</query>

	<query id="IProDucDao.saveProDuc" desc="保存制程">
         <![CDATA[
    INSERT INTO SLM_ORD_DESIGN_MSC_PL
               (DESGIN_KEY,
                MSC_PLINE,
                WHOLE_BACKLOG,
                WHOLE_BACKLOG_DESC,
                SET_FL,
                WARN_DESC,
                ORD_LN_PK,
                AUTO_CRAFT)
         VALUES
               (?, ?, ?, ?, ?, ?,?, ?)
         ]]>
	</query>

	<query id="IProDucDao.getDesignChem" desc="查询质量设计成分标准条数">
         <![CDATA[
    SELECT COUNT(*) AS COUNT
      FROM SLM_ORD_DESIGN_STD_CIC T
     WHERE T.DESGIN_KEY = ?
       AND T.VALIDFLAG = 1
         ]]>
	</query>

	<query id="IProDucDao.getDesignPhy" desc="查询质量设计理化标准条数">
         <![CDATA[
    SELECT COUNT(*) AS COUNT
      FROM SLM_ORD_DESIGN_STD_PIC T
     WHERE T.DESGIN_KEY = ?
         ]]>
	</query>


	<query id="IProDucDao.getDesignSpec" desc="查询质量设计公差标准条数">
         <![CDATA[
    SELECT COUNT(*) AS COUNT
      FROM SLM_ORD_DESIGN_STD_SIC T
     WHERE T.DESGIN_KEY = ?
         ]]>
	</query>

	<query id="IProDucDao.getDesignDete" desc="查询质量设计探伤标准条数">
         <![CDATA[
    SELECT COUNT(*) AS COUNT
      FROM SLM_ORD_DESIGN_STD_DIC T
     WHERE T.DESGIN_KEY = ?
         ]]>
	</query>

	<query id="IProDucDao.getDesignWater" desc="查询质量设计水压标准条数">
         <![CDATA[
    SELECT COUNT(*) AS COUNT
      FROM SLM_ORD_DESIGN_STD_WIC T
     WHERE T.DESGIN_KEY = ?
         ]]>
	</query>

	<query id="IProDucDao.getDesignGic" desc="查询质量设计加工标准条数">
         <![CDATA[
    SELECT COUNT(*) AS COUNT
      FROM SLM_ORD_DESIGN_STD_GIC T
     WHERE T.DESGIN_KEY = ?
         ]]>
	</query>

	<query id="IProDucDao.getAddAskNoStation" desc="查询附加要求工艺点类型">
         <![CDATA[
     SELECT D.STATION_CODE,D.STATION_DESC,B.ASK_SUB_ITME_DESC
  FROM (SELECT DISTINCT A.ASK_SUB_ITME,A.ASK_SUB_ITME_DESC
          FROM SLM_ORDER_ADD_ASK A
         WHERE A.ADD_ASK_NO =?
           AND A.VALIDFLAG = 1) B,
       COM_BASE_ASK_R_STATION C,
       COM_BASE_STATION D
 WHERE C.VALIDFLAG = '1'
   AND D.VALIDFLAG = '1'
   AND B.ASK_SUB_ITME = C.ASK_ITEM_NO
   AND C.STATION_CODE = D.STATION_CODE
         ]]>
	</query>

	<query id="IProDucDao.getSpecStyle" desc="查询合同产品规格类型">
         <![CDATA[
       SELECT T.MSC_STYLE
         FROM COM_BASE_SPEC T
        WHERE T.SPEC_CODE = ?
          AND T.VALIDFLAG = 1     
         ]]>
	</query>

	<query id="IProDucDao.getMscPlSetFl" desc="查询设定制程 ">
         <![CDATA[
  SELECT DESGIN_KEY,
       T1.MSC_PLINE,
       T1.WHOLE_BACKLOG,
       T1.WHOLE_BACKLOG_DESC,
       SET_FL,
       WARN_DESC,
       ORD_LN_PK
  FROM SLM_ORD_DESIGN_MSC_PL T, COM_MSC_BACKLOG T1
 WHERE 
   T.MSC_PLINE=T1.MSC_PLINE
   AND T1.MSC = ?
   AND T.ORD_LN_PK = ?
   AND T.SET_FL = '1'
         ]]>
	</query>

	<query id="IProDucDao.updateMscPlSetFl" desc="修改设定制程 ">
         <![CDATA[
UPDATE SLM_ORD_DESIGN_MSC_PL
   SET DESGIN_KEY = '#DESGIN_KEY#',
           MSC_PLINE = '#MSC_PLINE#',
       WHOLE_BACKLOG      = '#WHOLE_BACKLOG#',
       WHOLE_BACKLOG_DESC = '#WHOLE_BACKLOG_DESC#',
       SET_FL             = '#SET_FL#',
       WARN_DESC          = '#WARN_DESC#',
       ORD_LN_PK          = '#ORD_LN_PK#'
 WHERE DESGIN_KEY = ?
   AND MSC_PLINE = '#MSC_PLINE#'
         ]]>
	</query>

	<query id="IProDucDao.getDeteInfo" desc="查询探伤检验项 ">
         <![CDATA[
       SELECT 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
  FROM SLM_ORD_DESIGN_STD_DIC T
 WHERE T.DESGIN_KEY = ?
         ]]>
	</query>

	<query id="IProDucDao.getModelStyle" desc="查询扣型分类 ">
         <![CDATA[
          SELECT T.MODEL_STYLE, T.MODEL_STYLE_DESC
  FROM COM_BASE_MODEL T
 WHERE T.MODEL_CODE = ?
   AND T.VALIDFLAG = '1'
         ]]>
	</query>

	<query id="IProDucDao.getProcessDescC" desc="获取二级工序描述">  
            <![CDATA[ 
SELECT * FROM COM_BASE_PROCESS_C T WHERE T.PROCESS_CDOE_C = {0}
                ]]>
	</query>
</queryMap>