<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="COM_BASE_SUPP_APTITUDE （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="ComBaseSuppAptitudeDAL.Query" desc="查询">
        <![CDATA[
 SELECT 
       T.SUPP_CODE SUPPCODE,
       T.SUPP_NAME SUPPNAME,
       T.SUPP_SHORT_NAME SUPPSHORTNAME,
       T.CERTI_CONSTRAINT CERTICONSTRAINT,
       T.CERTI_OFFICER CERTIOFFICER,
       T.CERT_TYPE CERTTYPE,
       TO_CHAR(T.CERT_VALID_START, 'YYYY-MM-DD HH24:MI:SS') CERTVALIDSTART,
       T.CERT_DESC CERTDESC,
       T.ID,
       T.CERT_PATH CERTPATH,
       T.CERT_PATH_OLD CERTPATHOLD,
       T.CERT_NO_V CERTNOV,
       TO_CHAR(T.CERT_VALID_END, 'YYYY-MM-DD HH24:MI:SS') CERTVALIDEND,
       T.CERT_NO CERTNO
 FROM COM_BASE_SUPP_APTITUDE T
 WHERE 1 = 1
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.SUPP_CODE,
       T.SUPP_NAME,
       T.SUPP_SHORT_NAME,
       T.CERTI_CONSTRAINT,
       T.CERTI_OFFICER,
       T.CERT_TYPE,
       TO_CHAR(T.CERT_VALID_START, 'YYYY-MM-DD HH24:MI:SS') CERT_VALID_START,
       T.CERT_DESC,
       T.ID,
       T.CERT_PATH,
       T.CERT_PATH_OLD,
       T.CERT_NO_V,
       TO_CHAR(T.CERT_VALID_END, 'YYYY-MM-DD HH24:MI:SS') CERT_VALID_END,
       T.CERT_NO
 FROM COM_BASE_SUPP_APTITUDE T
 WHERE
       T.ID = '#ID#'
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO COM_BASE_SUPP_APTITUDE(
        SUPP_CODE,
        SUPP_NAME,
        SUPP_SHORT_NAME,
        CERTI_CONSTRAINT,
        CERTI_OFFICER,
        CERT_TYPE,
        CERT_VALID_START,
        CERT_DESC,
        ID,
        CERT_PATH,
        CERT_PATH_OLD,
        CERT_NO_V,
        CERT_VALID_END,
        CERT_NO)
 VALUES( 
        '#SUPP_CODE#',
        '#SUPP_NAME#',
        '#SUPP_SHORT_NAME#',
        '#CERTI_CONSTRAINT#',
        '#CERTI_OFFICER#',
        '#CERT_TYPE#',
        SYSDATE,
        '#CERT_DESC#',
        '#ID#',
        '#CERT_PATH#',
        '#CERT_PATH_OLD#',
        '#CERT_NO_V#',
        SYSDATE,
        '#CERT_NO#')
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.Update" desc="修改">
        <![CDATA[
 UPDATE COM_BASE_SUPP_APTITUDE T
   SET 
        T.SUPP_CODE = '#SUPP_CODE#',
        T.SUPP_NAME = '#SUPP_NAME#',
        T.SUPP_SHORT_NAME = '#SUPP_SHORT_NAME#',
        T.CERTI_CONSTRAINT = '#CERTI_CONSTRAINT#',
        T.CERTI_OFFICER = '#CERTI_OFFICER#',
        T.CERT_TYPE = '#CERT_TYPE#',
        T.CERT_VALID_START = SYSDATE,
        T.CERT_DESC = '#CERT_DESC#',
        T.ID = '#ID#',
        T.CERT_PATH = '#CERT_PATH#',
        T.CERT_PATH_OLD = '#CERT_PATH_OLD#',
        T.CERT_NO_V = '#CERT_NO_V#',
        T.CERT_VALID_END = SYSDATE,
        T.CERT_NO = '#CERT_NO#'
 WHERE
       T.ID = '#ID#'
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT LPAD(NVL(MAX(ID), 0) + 1, 5, '0') MAX_VALUE FROM COM_BASE_SUPP_APTITUDE T
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.Delete" desc="作废">
        <![CDATA[
DELETE FROM COM_BASE_SUPP_APTITUDE T WHERE T.ID = '#ID#'
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE COM_BASE_SUPP_APTITUDE 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#'
        ]]>
    </query>
    <query id="ComBaseSuppAptitudeDAL.IsRepeat" desc="是否重复">
        <![CDATA[
SELECT COUNT(1)
  FROM COM_BASE_SUPP_APTITUDE T
 WHERE T.CERT_NO = {0}
   AND T.ID <> {1}

        ]]>
    </query>
</queryMap>