<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="SteelMakingAdvanceJudgeDAL.queryCraftDesignKeyByGpreqId" desc="查询工艺DesignKey">
		<![CDATA[
SELECT C.DESGIN_KEY,
       A.INDEX_SEQ  MSC_PLINE,
       A.CIC_GP     CIC,
       A.PIC_GP     PIC,
       A.DIC        DIC
  FROM (SELECT A.ORD_LN_DLY_PK,
               A.CRAFT_SEQ CRAFT_SEQ,
               A.INDEX_SEQ,
               A.CIC_GP,
               A.PIC_GP,
               A.DIC
          FROM PLN_ORDER_ZG_S A
         WHERE A.GPREQ_ID = {0}
           AND ROWNUM <= 1) A,
       PLN_SALEORD B,
       CRAFT_ORD_DESIGN C
 WHERE B.ORD_LN_DLY_PK = A.ORD_LN_DLY_PK
   AND B.ORD_LN_PK = C.ORD_LN_PK
   AND A.CRAFT_SEQ = C.CRAFT_SEQ
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.queryCraftDesignKeyByZgProPlanId" desc="查询工艺DesignKey">
		<![CDATA[
SELECT C.DESGIN_KEY,
       A.INDEX_SEQ  MSC_PLINE,
       A.CIC_GP     CIC,
       A.PIC_GP     PIC,
       A.DIC        DIC
  FROM (SELECT A.ORD_LN_DLY_PK,
               A.CRAFT_SEQ CRAFT_SEQ,
               A.INDEX_SEQ,
               A.CIC_GP,
               A.PIC_GP,
               A.DIC
          FROM PLN_ORDER_ZG_S A
         WHERE A.Pro_Plan_Id = {0}
           AND ROWNUM <= 1) A,
       PLN_SALEORD B,
       CRAFT_ORD_DESIGN C
 WHERE B.ORD_LN_DLY_PK = A.ORD_LN_DLY_PK
   AND B.ORD_LN_PK = C.ORD_LN_PK
   AND A.CRAFT_SEQ = C.CRAFT_SEQ
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.queryCraftDesignKey" desc="查询工艺DesignKey">
		<![CDATA[
SELECT C.DESGIN_KEY,
       A.INDEX_SEQ  MSC_PLINE,
       A.CIC_GP     CIC,
       A.PIC_GP     PIC,
       A.DIC        DIC
  FROM (SELECT A.ORD_LN_DLY_PK,
               A.CRAFT_SEQ CRAFT_SEQ,
               A.INDEX_SEQ,
               A.CIC_GP,
               A.PIC_GP,
               A.DIC
          FROM PLN_ORDER_ZG_S A
         WHERE A.GPREQ_ID = {0}
           AND ROWNUM <= 1) A,
       PLN_SALEORD B,
       CRAFT_ORD_DESIGN C
 WHERE B.ORD_LN_DLY_PK = A.ORD_LN_DLY_PK
   AND B.ORD_LN_PK = C.ORD_LN_PK
   AND A.CRAFT_SEQ = C.CRAFT_SEQ
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.queryCraftChem" desc="查询工艺评审成分记录">
		<![CDATA[
SELECT *
  FROM CRAFT_ORD_DESIGN_STD_CIC T
 WHERE T.DESGIN_KEY = {0}
   AND T.MSC_PLINE = {1}
   AND T.CIC = {2}
   AND T.PROCESS_CODE = 'A'
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.queryStlInCision" desc="查询连铸切割信息表">
		<![CDATA[
SELECT T.PLINE_CODE
  FROM STL_INCISION T
 WHERE T.PRO_PLAN_ID = {0}
   AND T.GX_PLAN_NO = {1}
   AND T.STOVE_NO = {2}
   AND T.JUDGE_STOVE_NO = {3}
   AND ROWNUM <= 1
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.updateStlInCision" desc="更新连铸切割信息表">
		<![CDATA[
UPDATE STL_INCISION T
      SET T.CHEM_JUDGE_ID    = {0},
          T.JUDGE_FLAG       = {1},
          T.JUDGERESULT_CHEM = {2}
    WHERE T.PRO_PLAN_ID = {3}
      AND T.GX_PLAN_NO = {4}
      AND T.STOVE_NO = {5}
      AND T.JUDGE_STOVE_NO = {6}
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.updateLgChemJudgeValid" desc="修改炼钢判定记录状态">
		<![CDATA[
UPDATE QCM_LG_CHEMJUDGE T
   SET T.VALIDFLAG = {1}
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.PROCESS_CDOE = 'B'
		]]>
	</query>
	
	<query id="SteelMakingAdvanceJudgeDAL.updateLgChemJudgeExceptionValid" desc="修改炼钢判定记录状态">
		<![CDATA[
UPDATE QCM_LG_CHEMJUDGE_EXCEPTION T
   SET T.VALIDFLAG = {1}
 WHERE EXISTS (SELECT 1
          FROM QCM_LG_CHEMJUDGE A
         WHERE A.JUDGE_STOVE_NO = {0}
           AND A.PROCESS_CDOE = 'B'
           AND A.CHEM_JUDGE_ID = T.CHEM_JUDGE_ID)
		]]>
	</query>
</queryMap>