<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="检化验管理_钢管实验管理_检验委托，委托明细信息表">
    <query id="JdgPipeCheckConsignDetail.setFlag" desc="修改标志">
        <![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
   SET T.FLAG = {5}
 WHERE EXISTS (SELECT 1
          FROM PIPE_CHECKCONSIGN_BASEINFO A
         WHERE A.CHECK_NO = T.CHECK_NO
           AND A.CHECK_NO = {0}
           AND A.HEAT_NO = {1})
 AND T.BATCH_NO = {2}
 AND T.PHY_CODE_MAX = {3}
 AND T.SAMPLE_NO = {4}
        ]]>
    </query>
    <query id="JdgPipeCheckConsignDetail.setBackMemo" desc="修改退回说明">
        <![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
   SET T.BACK_MEMO = {5}
 WHERE EXISTS (SELECT 1
          FROM PIPE_CHECKCONSIGN_BASEINFO A
         WHERE A.CHECK_NO = T.CHECK_NO
           AND A.CHECK_NO = {0}
           AND A.HEAT_NO = {1})
 AND T.BATCH_NO = {2}
 AND T.PHY_CODE_MAX = {3}
 AND T.SAMPLE_NO = {4}
        ]]>
    </query>
    <query id="JdgPipeCheckConsignDetail.setRclFlag" desc="修改热处理标志">
        <![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
   SET T.RCL_FLAG = {5}
 WHERE EXISTS (SELECT 1
          FROM PIPE_CHECKCONSIGN_BASEINFO A
         WHERE A.CHECK_NO = T.CHECK_NO
           AND A.CHECK_NO = {0}
           AND A.HEAT_NO = {1})
 AND T.BATCH_NO = {2}
 AND T.PHY_CODE_MAX = {3}
 AND T.SAMPLE_NO = {4}
        ]]>
    </query>
    <query id="JdgPipeCheckConsignDetail.setPhyFlag" desc="修改理化标志">
        <![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
   SET T.FLAG = {1}
 WHERE T.CHECK_NO = {0}
 AND T.PHY_CODE_MAX NOT IN ('HX', 'ONH', 'C0030', 'C0031', 'C0032', 'C0033', 'C0133','C0147','C0150', 'C0007','C0061','C0065', 'C0146','C0148')
 AND T.FLAG = '5'
        ]]>
    </query>
    <query id="JdgPipeCheckConsignDetail.setPhySscFlag" desc="修改理化标志">
        <![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
   SET T.FLAG = {1}
 WHERE T.CHECK_NO = {0}
 AND T.PHY_CODE_MAX IN ('C0030', 'C0031', 'C0032', 'C0033', 'C0133','C0147','C0150')
 AND T.FLAG = '5'
        ]]>
    </query>
    <query id="JdgPipeCheckConsignDetail.setChemFlag" desc="修改成分标志">
        <![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
   SET T.FLAG = {1}
 WHERE T.CHECK_NO = {0}
 AND T.PHY_CODE_MAX IN ('HX', 'ONH')
  AND T.FLAG = '5'
        ]]>
    </query>
    <query id="JdgPipeCheckConsignDetail.getBackMemo" desc="通过检验编号获取退回说明">
        <![CDATA[
SELECT T.CHECK_NO, T.BATCH_NO, T.PHY_CODE_MAX, T.SAMPLE_NO, T.BACK_MEMO
  FROM PIPE_CHECKCONSIGN_DETAIL T
 WHERE T.CHECK_NO = {0}
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignDetail.getFormualNameByPhyMin" desc="通过试样组获取试验方法">
        <![CDATA[
SELECT T.CHECK_TEMP,
       T.DEVICE_NO,
       T.DEVICE_NAME,
       T.CHECK_NAME,
       T.CHECK_TIME,
       T.AUDIT_NAME,
       T.AUDIT_TIME,
       T.REMARK,
       T.FORMUAL_NO, 
       T.FORMUAL_NAME, 
       SIZE_DESC
  FROM PIPE_CHECKCONSIGN_DETAIL T
 WHERE T.CHECK_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.PHY_CODE_MAX = {2}
   AND T.SAMPLE_NO = {3}
        ]]>
    </query>
    
    <query id="JdgPipeCheckConsignDetail.deleteByCheckNo" desc="通过检验编号删除">
        <![CDATA[
DELETE FROM PIPE_CHECKCONSIGN_DETAIL T WHERE T.CHECK_NO = {0}
        ]]>
    </query>
</queryMap>