<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="规格管理">
	<query id="ZgSpecConfirm.Query" desc="查询">  
        <![CDATA[ 
SELECT *
  FROM (SELECT T.DIMATER, T.HEIGHT, 'True' CHK
          FROM CRAFT_ORD_DESIGN_MSC_GZ_GG_S T
         WHERE T.ORD_LN_PK = {0}
           AND T.MSC_PLINE = {1}
        UNION ALL
        SELECT A.MIN_D, A.MIN_H, 'False' CHK
          FROM COM_MSC_ROLL_R_UPSET A
         WHERE A.PLINE_CODE = {2}
           AND A.MAX_D = TO_NUMBER({3})
           AND A.MAX_H = TO_NUMBER({4})
           AND A.VALIDFLAG = '1'
           AND NOT EXISTS (SELECT 1
                  FROM CRAFT_ORD_DESIGN_MSC_GZ_GG_S T
                 WHERE T.ORD_LN_PK = {0}
                   AND T.MSC_PLINE = {1}
                   AND T.DIMATER = A.MIN_D
                   AND T.HEIGHT = A.MIN_H))
 ORDER BY DIMATER, HEIGHT
                ]]>
	</query>
	
	<query id="ZgSpecConfirm.Save" desc="保存">  
        <![CDATA[
INSERT INTO CRAFT_ORD_DESIGN_MSC_GZ_GG_S
  (ORD_LN_PK,
   MSC_PLINE,
   GRADECODE,
   GRADENAME,
   DIMATER,
   HEIGHT)
VALUES
  ({0}, {1}, {2}, {3}, {4}, {5})
                ]]>
	</query>
	
	<query id="ZgSpecConfirm.Delete" desc="删除">  
        <![CDATA[
DELETE FROM (SELECT *
               FROM CRAFT_ORD_DESIGN_MSC_GZ_GG_S T
              WHERE T.ORD_LN_PK = {0}
                AND T.MSC_PLINE = {1})
                ]]>
	</query>
</queryMap>