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

	<query id="CraftInnerDao.getProDuc" desc="查询制程信息">  
             <![CDATA[ 
             SELECT DESGIN_KEY,
       MSC_PLINE,
       WHOLE_BACKLOG,
       WHOLE_BACKLOG_DESC,
       SET_FL,
       WARN_DESC,
       ORD_LN_PK
  FROM SLM_ORD_DESIGN_MSC_PL T
 WHERE T.DESGIN_KEY = ?
                     ]]>
	</query>

	<query id="CraftInnerDao.deleteChem" desc="删除成分标准">  
             <![CDATA[ 
             DELETE FROM CRAFT_ORD_DESIGN_STD_CIC T
 WHERE T.DESGIN_KEY = ?
   AND T.SPECL_FL = '2'
                     ]]>
	</query>

	<query id="CraftInnerDao.deletePhy" desc="删除理化标准">  
             <![CDATA[ 
             DELETE FROM CRAFT_ORD_DESIGN_STD_PIC T
 WHERE T.DESGIN_KEY = ?
   AND T.SPECL_FL = '2'
                     ]]>
	</query>

	<query id="CraftInnerDao.deletePhySmp" desc="删除理化取样要求">  
             <![CDATA[ 
       DELETE FROM CRAFT_ORD_DESIGN_STD_PIC_SMP T
 WHERE T.DESGIN_KEY = ?
   AND T.PIC IN (SELECT T1.PIC
                   FROM CRAFT_ORD_DESIGN_STD_PIC T1
                  WHERE T1.DESGIN_KEY = ?
                    AND T1.SPECL_FL = '2')
                     ]]>
	</query>

	<query id="CraftInnerDao.deleteDete" desc="删除探伤标准">  
             <![CDATA[ 
             DELETE FROM CRAFT_ORD_DESIGN_STD_DIC T
 WHERE T.DESGIN_KEY = ?
   AND T.SPECL_FL = '2'
                     ]]>
	</query>

	<query id="CraftInnerDao.deleteSpec" desc="删除公差标准">  
             <![CDATA[ 
             DELETE FROM CRAFT_ORD_DESIGN_STD_SIC T
 WHERE T.DESGIN_KEY = ?
   AND T.SPECL_FL = '2'
                     ]]>
	</query>

	<query id="CraftInnerDao.deleteWater" desc="删除水压标准">  
             <![CDATA[ 
             DELETE FROM CRAFT_ORD_DESIGN_STD_WIC T
 WHERE T.DESGIN_KEY = ?
   AND T.SPECL_FL = '2'
                     ]]>
	</query>

	<query id="CraftInnerDao.deleteProcess" desc="删除加工标准">  
             <![CDATA[ 
             DELETE FROM CRAFT_ORD_DESIGN_STD_PIC T
 WHERE T.DESGIN_KEY = ?
   AND T.SPECL_FL = '2'
                     ]]>
	</query>

	<query id="CraftInnerDao.updateCraftPrc" desc="删除更新内控工序">  
      <![CDATA[ 
UPDATE CRAFT_ORD_DESIGN_MSC_PL_PRC T
   SET T.CIC =
       (SELECT wm_concat(AA.CIC)
          FROM (SELECT A.CIC, A.PROCESS_CODE
                  FROM CRAFT_ORD_DESIGN_STD_CIC A
                 WHERE A.DESGIN_KEY = {0}
                   AND A.MSC_PLINE = {1}
                 GROUP BY A.CIC, A.PROCESS_CODE) AA
         WHERE AA.PROCESS_CODE = T.PROCESS_CODE),
       T.PIC =
       (SELECT wm_concat(BB.PIC)
          FROM (SELECT B.PIC, B.PROCESS_CODE
                  FROM CRAFT_ORD_DESIGN_STD_PIC B
                 WHERE B.DESGIN_KEY = {0}
                   AND B.MSC_PLINE = {1}
                 GROUP BY B.PIC, B.PROCESS_CODE) BB
         WHERE BB.PROCESS_CODE = T.PROCESS_CODE),
       T.SIC =
       (SELECT wm_concat(CC.SIC)
          FROM (SELECT C.SIC, C.PROCESS_CODE
                  FROM CRAFT_ORD_DESIGN_STD_SIC C
                 WHERE C.DESGIN_KEY = {0}
                   AND C.MSC_PLINE = {1}
                 GROUP BY C.SIC, PROCESS_CODE) CC
         WHERE CC.PROCESS_CODE = T.PROCESS_CODE),
       T.DIC =
       (SELECT wm_concat(DD.DIC)
          FROM (SELECT D.DIC, D.PROCESS_CODE
                  FROM CRAFT_ORD_DESIGN_STD_DIC D
                 WHERE D.DESGIN_KEY = {0}
                   AND D.MSC_PLINE = {1}
                 GROUP BY D.DIC, D.PROCESS_CODE) DD
         WHERE DD.PROCESS_CODE = T.PROCESS_CODE),
       T.WIC =
       (SELECT wm_concat(EE.WIC)
          FROM (SELECT E.WIC, E.PROCESS_CODE
                  FROM CRAFT_ORD_DESIGN_STD_WIC E
                 WHERE E.DESGIN_KEY = {0}
                   AND E.MSC_PLINE = {1}
                 GROUP BY E.WIC, E.PROCESS_CODE) EE
         WHERE EE.PROCESS_CODE = T.PROCESS_CODE),
       T.GIC =
       (SELECT wm_concat(FF.GIC)
          FROM (SELECT F.GIC, F.PROCESS_CODE
                  FROM CRAFT_ORD_DESIGN_STD_GIC F
                 WHERE F.DESGIN_KEY = {0}
                   AND F.MSC_PLINE = {1}
                 GROUP BY F.GIC, F.PROCESS_CODE) FF
         WHERE FF.PROCESS_CODE = T.PROCESS_CODE)
 WHERE T.DESGIN_KEY = {0}
   AND T.MSC_PLINE = {1}
     ]]>
	</query>
</queryMap>