<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="QCM_BC_PASS_CONFIG （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="JdgQcmBcPassConfig.Query" desc="查询">
        <![CDATA[
 SELECT T.JUDGE_RESULT,
        T.AUDIT_STEP,
        T.AUDIT_UNIT,
        T2.DEPARTNAME  AUDIT_UNIT_DESC,
        T3.DEPARTNAME  AUDIT_DEPART,
        T.TYPE,
        T.SEAM_AREA
   FROM QCM_BC_PASS_CONFIG T
   LEFT JOIN CORE_APP_DEPARTMENT T2
     ON T2.DEPARTID = T.AUDIT_UNIT
   LEFT JOIN CORE_APP_DEPARTMENT T3
     ON T3.DEPARTID = T2.PID
ORDER BY T.JUDGE_RESULT, T.AUDIT_STEP
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.JUDGE_RESULT,
       T.AUDIT_STEP,
       T.AUDIT_UNIT
 FROM QCM_BC_PASS_CONFIG T
 WHERE
      1<>1
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.Insert" desc="新增">
        <![CDATA[
 INSERT INTO QCM_BC_PASS_CONFIG(
        JUDGE_RESULT,
        AUDIT_STEP,
        AUDIT_UNIT,
        TYPE,
        SEAM_AREA)
 VALUES( 
        {0},
        {1},
        {2},
        {3},
        {4})
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.Update" desc="修改">
        <![CDATA[
 UPDATE QCM_BC_PASS_CONFIG T
    SET T.AUDIT_UNIT = {3}
  WHERE T.JUDGE_RESULT = {0}
    AND T.AUDIT_STEP = {1}
    AND T.TYPE = {2}
    AND T.SEAM_AREA={4}
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT NVL(MAX(T.AUDIT_STEP), 0) + 1 MAX_VALUE
  FROM QCM_BC_PASS_CONFIG T
 WHERE T.JUDGE_RESULT = {0}
   AND T.TYPE = {1}
   AND T.SEAM_AREA = {2}
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.Delete" desc="作废">
        <![CDATA[
DELETE FROM qcm_bc_pass_config T
 WHERE T.JUDGE_RESULT = {0}
   AND T.AUDIT_STEP = {1}
   AND T.TYPE = {2}
   AND T.SEAM_AREA = {3}
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.setAuditStep" desc="修改评审步骤">
        <![CDATA[
UPDATE qcm_bc_pass_config T
   SET T.AUDIT_STEP = T.AUDIT_STEP - 1
 WHERE T.JUDGE_RESULT = {0}
   AND T.AUDIT_STEP > {1}
   AND T.TYPE = {2}
   AND T.SEAM_AREA = {3}
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.getByJudgeResultToSu" desc="通过判定结果获取">
        <![CDATA[
SELECT *
  FROM QCM_BC_PASS_CONFIG T
 WHERE T.JUDGE_RESULT = NVL({0}, '0')
   AND T.TYPE = {1}
   AND T.SEAM_AREA = {2}
 ORDER BY AUDIT_STEP
        ]]>
    </query>
    <query id="JdgQcmBcPassConfig.getByJudgeResult" desc="通过判定结果获取">
        <![CDATA[
SELECT *
  FROM QCM_BC_PASS_CONFIG T
 WHERE T.JUDGE_RESULT = NVL({0}, '0')
   AND T.TYPE = {1}
   AND T.SEAM_AREA = {2}
 ORDER BY AUDIT_STEP
        ]]>
    </query>
    
        <query id="JdgQcmBcPassConfig.getJhyConfigInfo" desc="通过判定结果获取">
        <![CDATA[
SELECT *
  FROM QCM_JHY_PASS_CONFIG T
 WHERE  T.TYPE = {0}
 ORDER BY AUDIT_STEP
        ]]>
    </query>
</queryMap>