<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="COM_BASE_IMPACT_C （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="ComBaseImpactTempCDAL.Query" desc="查询">
        <![CDATA[
SELECT T.ID,
       T.INDEX_SEQ,
       T.ITEM_CODE_C,
       T.MIN_H,
       T.MAX_H,
       T.TEMP_REDUCE,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(T.VALIDFLAG, '1', '有效', '0', '无效') VALIDFLAG,
       T.MEMO,
       T.MIN_H_SIGN,
       T.MAX_H_SIGN
  FROM COM_BASE_IMPACT_TEMP_C T
 WHERE T.ID = {0}
   AND T.VALIDFLAG IN ('1', {1})
        ]]>
    </query>
    
    <query id="ComBaseImpactTempCDAL.Insert" desc="新增">
        <![CDATA[
INSERT INTO COM_BASE_IMPACT_TEMP_C(
        ID,
        INDEX_SEQ,
        ITEM_CODE_C,
        MIN_H,
        MAX_H,
        TEMP_REDUCE,
        CREATE_NAME,
        CREATE_TIME,
        MEMO,
        MIN_H_SIGN,
        MAX_H_SIGN)
 VALUES( 
        '#ID#',
        '#INDEX_SEQ#',
        '#ITEM_CODE_C#',
        '#MIN_H#',
        '#MAX_H#',
        '#TEMP_REDUCE#',
        '#CREATE_NAME#',
        SYSDATE,
        '#MEMO#',
        '#MIN_H_SIGN#', 
        '#MAX_H_SIGN#')
        ]]>
    </query>
    <query id="ComBaseImpactTempCDAL.Update" desc="修改">
        <![CDATA[
 UPDATE COM_BASE_IMPACT_TEMP_C T
   SET T.ITEM_CODE_C = '#ITEM_CODE_C#',
       T.MIN_H       = '#MIN_H#',
       T.MAX_H       = '#MAX_H#',
       T.TEMP_REDUCE = '#TEMP_REDUCE#',
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE,
       T.MEMO        = '#MEMO#',
       T.MIN_H_SIGN = '#MIN_H_SIGN#',
       T.MAX_H_SIGN = '#MAX_H_SIGN#'
 WHERE T.ID = '#ID#'
   AND T.INDEX_SEQ = '#INDEX_SEQ#'
        ]]>
    </query>
    <query id="ComBaseImpactTempCDAL.GetMaxIndex" desc="获取最大主键">
        <![CDATA[
SELECT LPAD(NVL(MAX(T.INDEX_SEQ), 0) + 1, 3, '0') MAX_VALUE
  FROM COM_BASE_IMPACT_TEMP_C T
 WHERE T.ID = '#ID#'
        ]]>
    </query>
    
    <query id="ComBaseImpactTempCDAL.Delete" desc="作废">
        <![CDATA[
UPDATE COM_BASE_IMPACT_TEMP_C T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.ID = '#ID#'
       AND T.INDEX_SEQ = '#INDEX_SEQ#'
        ]]>
    </query>
    <query id="ComBaseImpactTempCDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE COM_BASE_IMPACT_TEMP_C T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.ID = '#ID#'
       AND T.INDEX_SEQ = '#INDEX_SEQ#'
        ]]>
    </query>
</queryMap>