<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
    <query id="JdgPipeCheckConsignPhyDetail.getResampleData" desc="通过试样组获取试验方法">
        <![CDATA[
SELECT C.LOT_NO,
       C.HEAT_NO JUDGE_STOVE_NO,
       A.BATCH_NO,
       A.CHECK_NO SAMPLE_ID,
       A.SAMPLE_NO,
       C.PLINE_CODE,
       B.PHY_CODE_MIN PHY_CODE_MAX,
       B.PHY_NAME_MIN PHY_NAME_MAX,
       B.PHY_CODE_MAX PHY_CODE_MIN,
       B.PHY_NAME_MAX PHY_NAME_MIN,
       B.PHY_CODE,
       B.PHY_NAME,
       '1' JF_TOL_QUALIFIED,
       '1' NK_TOL_QUALIFIED,
       B.ITEM_CODE_F,
       B.ITEM_NAME_F,
       B.ITEM_CODE_W,
       B.ITEM_NAME_W,
       B.ITEM_CODE_S,
       B.ITEM_NAME_S
  FROM PIPE_CHECKCONSIGN_DETAIL    A,
       PIPE_CHECKCONSIGN_PHYDETAIL B,
       PIPE_CHECKCONSIGN_BASEINFO  C
 WHERE C.CHECK_NO = {0}
   AND C.HEAT_NO = {1}
   AND A.BATCH_NO = {2}
   AND C.PROCESS_CODE = {3}
   AND B.PHY_CODE_MIN IN ('R0008', 'R0007')
   AND B.CHECK_NO = A.CHECK_NO
   AND B.BATCH_NO = A.BATCH_NO
   AND B.SAMPLE_NO = A.SAMPLE_NO
   AND B.PHY_CODE_MAX = A.PHY_CODE_MAX
   AND C.CHECK_NO = A.CHECK_NO
 GROUP BY C.LOT_NO,
          C.HEAT_NO,
          A.BATCH_NO,
          A.CHECK_NO,
          A.SAMPLE_NO,
          C.PLINE_CODE,
          B.PHY_CODE_MAX,
          B.PHY_NAME_MAX,
          B.PHY_CODE_MIN,
          B.PHY_NAME_MIN,
          B.PHY_CODE,
          B.PHY_NAME,
          B.ITEM_CODE_F,
          B.ITEM_NAME_F,
          B.ITEM_CODE_W,
          B.ITEM_NAME_W,
          B.ITEM_CODE_S,
          B.ITEM_NAME_S
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignPhyDetail.deleteByCheckNo" desc="通过检验编号删除">
        <![CDATA[
DELETE FROM PIPE_CHECKCONSIGN_PHYDETAIL T WHERE T.CHECK_NO = {0}
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignPhyDetail.getByPhyMinBatchNo" desc="通过炉批查询">
        <![CDATA[
SELECT A.CHECK_NO,
       B.LOT_NO,
       B.HEAT_NO JUDGE_STOVE_NO,
       C.BATCH_NO,
       C.SAMPLE_NO,
       A.PHY_NAME_MAX,
       A.PHY_NAME_MIN,
       A.PHY_NAME,
       A.ITEM_NAME_F,
       A.ITEM_NAME_W,
       A.ITEM_NAME_S,
       A.ISCHECK,
       A.ISJUDGE,
       A.ISQUOTE,
       A.VALUE1,
       A.VALUE2,
       A.VALUE3,
       A.VALUE4,
       A.VALUE5,
       A.VALUE6,
       A.VALUE7,
       A.VALUE8,
       A.VALUE9,
       A.VALUE10,
       A.VALUE11,
       A.VALUE12,
       A.VALUE13,
       A.VALUE14,
       A.VALUE15,
       A.AVERAGE_VALUE,
       A.IS_GOOD,
       A.IS_DEFECT,
       C.DESC_RATE
  FROM PIPE_CHECKCONSIGN_PHYDETAIL A,
       PIPE_CHECKCONSIGN_BASEINFO  B,
       PIPE_CHECKCONSIGN_DETAIL    C
WHERE C.CHECK_NO = B.CHECK_NO
AND A.CHECK_NO = C.CHECK_NO
AND A.SAMPLE_NO = C.SAMPLE_NO
AND A.PHY_CODE_MAX = C.PHY_CODE_MAX
AND B.HEAT_NO = {0}
AND C.BATCH_NO = {1}
AND B.PROCESS_CODE = {2}
AND A.PHY_CODE_MAX = {3}
AND B.CRAFT_SOURCE = '0'
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignPhyDetail.getByPhyMinJudgeStoveNo" desc="通过炉查询">
        <![CDATA[
SELECT A.CHECK_NO,
       B.LOT_NO,
       B.HEAT_NO JUDGE_STOVE_NO,
       C.BATCH_NO,
       C.SAMPLE_NO,
       A.PHY_NAME_MAX,
       A.PHY_NAME_MIN,
       A.PHY_NAME,
       A.ITEM_NAME_F,
       A.ITEM_NAME_W,
       A.ITEM_NAME_S,
       A.ISCHECK,
       A.ISJUDGE,
       A.ISQUOTE,
       A.VALUE1,
       A.VALUE2,
       A.VALUE3,
       A.VALUE4,
       A.VALUE5,
       A.VALUE6,
       A.VALUE7,
       A.VALUE8,
       A.VALUE9,
       A.VALUE10,
       A.VALUE11,
       A.VALUE12,
       A.VALUE13,
       A.VALUE14,
       A.VALUE15,
       A.AVERAGE_VALUE,
       A.IS_GOOD,
       A.IS_DEFECT,
       C.DESC_RATE
  FROM PIPE_CHECKCONSIGN_PHYDETAIL A,
       PIPE_CHECKCONSIGN_BASEINFO  B,
       PIPE_CHECKCONSIGN_DETAIL    C
WHERE C.CHECK_NO = B.CHECK_NO
AND A.CHECK_NO = C.CHECK_NO
AND A.SAMPLE_NO = C.SAMPLE_NO
AND A.PHY_CODE_MAX = C.PHY_CODE_MAX
AND B.HEAT_NO = {0}
AND B.PROCESS_CODE = {1}
AND A.PHY_CODE_MAX = {2}
AND B.CRAFT_SOURCE = '0'
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignPhyDetail.getByPhyMinLotNo" desc="通过生产批查询">
        <![CDATA[
SELECT A.CHECK_NO,
       B.LOT_NO,
       B.HEAT_NO JUDGE_STOVE_NO,
       C.BATCH_NO,
       C.SAMPLE_NO,
       A.PHY_NAME_MAX,
       A.PHY_NAME_MIN,
       A.PHY_NAME,
       A.ITEM_NAME_F,
       A.ITEM_NAME_W,
       A.ITEM_NAME_S,
       A.ISCHECK,
       A.ISJUDGE,
       A.ISQUOTE,
       A.VALUE1,
       A.VALUE2,
       A.VALUE3,
       A.VALUE4,
       A.VALUE5,
       A.VALUE6,
       A.VALUE7,
       A.VALUE8,
       A.VALUE9,
       A.VALUE10,
       A.VALUE11,
       A.VALUE12,
       A.VALUE13,
       A.VALUE14,
       A.VALUE15,
       A.AVERAGE_VALUE,
       A.IS_GOOD,
       A.IS_DEFECT,
       C.DESC_RATE
  FROM PIPE_CHECKCONSIGN_PHYDETAIL A,
       PIPE_CHECKCONSIGN_BASEINFO  B,
       PIPE_CHECKCONSIGN_DETAIL    C
 WHERE C.CHECK_NO = B.CHECK_NO
   AND A.CHECK_NO = C.CHECK_NO
   AND A.SAMPLE_NO = C.SAMPLE_NO
   AND A.PHY_CODE_MAX = C.PHY_CODE_MAX
   AND B.LOT_NO = {0}
   AND ({1} IS NULL OR B.LOT_NO_GROUP = {1})
   AND B.PROCESS_CODE = {2}
   AND A.PHY_CODE_MAX = {3}
   AND B.CRAFT_SOURCE = '0'
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignPhyDetail.getSscByOrderNo" desc="通过合同号、产线查询">
        <![CDATA[
SELECT A.CHECK_NO,
       B.LOT_NO,
       B.HEAT_NO JUDGE_STOVE_NO,
       C.BATCH_NO,
       C.SAMPLE_NO,
       A.PHY_NAME_MAX,
       A.PHY_NAME_MIN,
       A.PHY_NAME,
       A.ITEM_NAME_F,
       A.ITEM_NAME_W,
       A.ITEM_NAME_S,
       A.ISCHECK,
       A.ISJUDGE,
       A.ISQUOTE,
       A.VALUE1,
       A.VALUE2,
       A.VALUE3,
       A.VALUE4,
       A.VALUE5,
       A.VALUE6,
       A.VALUE7,
       A.VALUE8,
       A.VALUE9,
       A.VALUE10,
       A.VALUE11,
       A.VALUE12,
       A.VALUE13,
       A.VALUE14,
       A.VALUE15,
       A.AVERAGE_VALUE,
       A.IS_GOOD,
       A.IS_DEFECT,
       C.DESC_RATE
  FROM PIPE_CHECKCONSIGN_PHYDETAIL A,
       PIPE_CHECKCONSIGN_BASEINFO  B,
       PIPE_CHECKCONSIGN_DETAIL    C
 WHERE C.CHECK_NO = B.CHECK_NO
   AND A.CHECK_NO = C.CHECK_NO
   AND A.SAMPLE_NO = C.SAMPLE_NO
   AND A.PHY_CODE_MAX = C.PHY_CODE_MAX
   AND B.CONTRACT_NO = {0}
   AND B.PLINE_CODE = {1}
   AND B.PROCESS_CODE = {2}
   AND C.PHY_CODE_MAX IN ('C0030', 'C0031', 'C0032', 'C0033', 'C0133','C0147','C0150')
   AND B.CRAFT_SOURCE = '1'
        ]]>
    </query>
</queryMap>