<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="工艺评审-理化标准">
	<query id="MscSplineDao.GetNkPics" desc="查询内控的PICS">
         <![CDATA[
SELECT T.*
  FROM CRAFT_ORD_DESIGN_STD_PIC T
 WHERE T.DESGIN_KEY = {0}
   AND T.SPECL_FL = {1}
   AND T.ISCHECK = '1'
   AND T.MSC_PLINE = {2}
   AND T.PROCESS_CODE = {3}
             ]]>
	</query>
	
	<query id="MscSplineDao.GetJfPics" desc="查询内控的PICS">
         <![CDATA[
SELECT *
  FROM CRAFT_ORD_DESIGN_STD_PIC T
 WHERE T.DESGIN_KEY = {0}
   AND T.SPECL_FL = {1}
   AND T.ISCHECK = '1'
             ]]>
	</query>
	
	<query id="MscSplineDao.GetStdCodeNkByPic" desc="查询PIC对应的内控标准代码">
         <![CDATA[
 SELECT T.STD_CODE_NK VALUE FROM COM_MSC_STD_PIC T WHERE T.PIC = '#PIC#'
             ]]>
	</query>
	
	<query id="MscSplineDao.GetSetEicSpline" desc="获取设定试样码">
         <![CDATA[
SELECT A.*
  FROM CRAFT_ORD_DESIGN_STD_PIC_SMP_S T, COM_BASE_SPLINE A
 WHERE T.ORD_LN_PK = {0}
   AND T.PHY_CODE_MIN = {1}
   AND NVL(T.ITEM_CODE_F, '1') = NVL({2}, '1')
   AND NVL(T.ITEM_CODE_W, '1') = NVL({3}, '1')
   AND NVL(T.ITEM_CODE_C, '1') = NVL({4}, '1')
   AND A.EIC = T.SET_EIC
             ]]>
	</query>
	
	<query id="MscSplineDao.getStdCodeTest" desc="获取试验标准">
         <![CDATA[
SELECT T.STD_CODE_TEST VALUE
  FROM CRAFT_ORD_DESIGN_STD_PIC_SMP T
 WHERE T.DESGIN_KEY = {0}
   AND T.PIC = {1}
   AND T.PHY_CODE_MIN = {2}
   AND NVL(T.ITEM_CODE_F, '1') = NVL({3}, '1')
   AND NVL(T.ITEM_CODE_C, '1') = NVL({4}, '1')
   AND NVL(T.ITEM_CODE_W, '1') = NVL({5}, '1')
             ]]>
	</query>
	
	<query id="MscSplineDao.getDimaterHeightBySpecCode" desc="获取外径壁厚">
         <![CDATA[
SELECT T.DIMATER VALUE, T.HEIGHT VALUE2, T.MSC_STYLE VALUE3 FROM COM_BASE_SPEC T WHERE T.SPEC_CODE = {0}
             ]]>
	</query>
	
	<query id="MscSplineDao.getSpecInfoBySpecCode" desc="获取外径壁厚">
         <![CDATA[
SELECT T.* FROM COM_BASE_SPEC T WHERE T.SPEC_CODE = {0}
             ]]>
	</query>
	
	<query id="MscSplineDao.getCraftMscPl" desc="获取工艺评审制程">
         <![CDATA[
SELECT *
  FROM CRAFT_ORD_DESIGN_MSC_PL T
 WHERE T.DESGIN_KEY = {0}
   AND (T.SET_FL = '0' OR T.SET_FL IS NULL)
   AND NOT EXISTS (SELECT 1
          FROM CRAFT_ORD_DESIGN_MSC_PL A
         WHERE A.DESGIN_KEY = {0}
           AND A.SET_FL = '1')
UNION ALL
SELECT *
  FROM CRAFT_ORD_DESIGN_MSC_PL T
 WHERE T.DESGIN_KEY = {0}
   AND T.SET_FL = '1'
             ]]>
	</query>
</queryMap>