<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="COM_BASE_SUPP （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="ComBaseSuppDAL.Query" desc="查询">
        <![CDATA[
 SELECT 
       T.SUPP_CODE SUPPCODE,
       T.SUPP_NAME SUPPNAME,
       T.ORG_CODE ORG_CODE,
       T.SUPP_SHORT_NAME SUPPSHORTNAME,
       T.SUPP_TAX_ID SUPPTAXID,
       T.SUPP_CHARACTER SUPPCHARACTER,
       T.SUPP_REGISTRAR_NAME SUPPREGISTRARNAME,
       T.SUPP_NATIONALITY SUPPNATIONALITY,
       T.SUPP_PROVINCE SUPPPROVINCE,
       T.SUPP_CITY SUPPCITY,
       T.SUPP_OFFICE_PROVINCE SUPPOFFICEPROVINCE,
       T.SUPP_START_DATE SUPPSTARTDATE,
       T.SUPP_END_DATE SUPPENDDATE,
       T.SUPP_TAX_START_DATE SUPPTAXSTARTDATE,
       T.SUPP_TAX_END_DATE SUPPTAXENDDATE,
       T.SUPP_LIC_NUM SUPPLICNUM,
       T.SUPP_LIC_START_DATE SUPPLICSTARTDATE,
       T.SUPP_LIC_END_DATE SUPPLICENDDATE,
       T.SUPP_OPERATE_SCOPE SUPPOPERATESCOPE,
       T.SUPP_IS_INTERNAL SUPPISINTERNAL,
       T.SUPP_IS_SUPPLIER SUPPISSUPPLIER,
       T.SUPP_IS_MAINTENANCER SUPPISMAINTENANCER,
       T.SUPP_IS_MANUFACTURER SUPPISMANUFACTURER,
       T.SUPP_IS_SUB_COMPANY SUPPISSUBCOMPANY,
       T.SUPP_INDUSTRY_TYPE SUPPINDUSTRYTYPE,
       T.SUPP_WEBSITE SUPPWEBSITE,
       T.SUPP_REG_CAPITAL SUPPREGCAPITAL,
       T.SUPP_REG_CAP_CURRENCY SUPPREGCAPCURRENCY,
       T.SUPP_PER_GRADE SUPPPERGRADE,
       T.SUPP_RELATION_GRADE SUPPRELATIONGRADE,
       T.SUPP_ADDRESS SUPPADDRESS,
       T.SUPP_ADD_POSTAL SUPPADDPOSTAL,
       T.SUPPLIER_LINK_MAN SUPPLIERLINKMAN,
       T.SUPP_CONTACT_FAX SUPPCONTACTFAX,
       T.SUPP_CONTACT_TEL SUPPCONTACTTEL,
       T.SUPP_CONTACT_EMAIL SUPPCONTACTEMAIL,
       T.SUPP_CONTACT_CELL_PHONE SUPPCONTACTCELLPHONE,
       T.SUPP_CONTACT_TITLE SUPPCONTACTTITLE,
       T.SUPP_COMMENT SUPPCOMMENT,
       T.SUPP_CREDIT_RATE SUPPCREDITRATE,
       T.MENT_DEPT_CODE MENTDEPTCODE,
       T.MENT_DEPT_DESC MENTDEPTDESC,
       T.MENT_UNIT_CODE MENTUNITCODE,
       T.MENT_UNIT_DESC MENTUNITDESC,
       T.BUYER_DEPT_CODE BUYERDEPTCODE,
       T.BUYER_DEPT_DESC BUYERDEPTDESC,
       T.BUYER_UNIT_CODE BUYERUNITCODE,
       T.BUYER_UNIT_DESC BUYERUNITDESC,
       T.STATUS,
       DECODE(T.VALIDFLAG, '1', '有效', '0', '无效') VALIDFLAG,
       T.CREATE_NAME CREATENAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATETIME,
       T.UPDATE_NAME UPDATENAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATETIME,
       T.DELETE_NAME DELETENAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETETIME,
       T.SUSPEND_STATUS SUSPENDSTATUS,
       T.CREATE_USERID CREATEUSERID,
       T.UPDATE_USERID UPDATEUSERID,
       T.DELETE_USERID DELETEUSERID,
       T.PASSWORD,
       A.BASENAME SUPPTAXRATE,
       T.SUPP_NATIONALITY_CODE SUPPNATIONALITYCODE,
       T.SUPP_PROVINCE_CODE SUPPPROVINCECODE,
       T.SUPP_OFFICE_PROVINCE_CODE SUPPOFFICEPROVINCECODE,
       t.SUPP_TYPE SUPPTYPE
 FROM COM_BASE_SUPP T
 LEFT JOIN COM_BASE_INFO A
 ON A.BASECODE = T.SUPP_TAX_RATE
 WHERE 1 = 1
        ]]>
    </query>
    <query id="ComBaseSuppDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.SUPP_CODE,
       T.SUPP_NAME,
       T.ORG_CODE,
       T.SUPP_SHORT_NAME,
       T.SUPP_TAX_ID,
       T.SUPP_CHARACTER,
       T.SUPP_REGISTRAR_NAME,
       T.SUPP_NATIONALITY,
       T.SUPP_PROVINCE,
       T.SUPP_CITY,
       T.SUPP_OFFICE_PROVINCE,
       T.SUPP_START_DATE,
       T.SUPP_END_DATE,
       T.SUPP_TAX_START_DATE,
       T.SUPP_TAX_END_DATE,
       T.SUPP_LIC_NUM,
       T.SUPP_LIC_START_DATE,
       T.SUPP_LIC_END_DATE,
       T.SUPP_OPERATE_SCOPE,
       T.SUPP_IS_INTERNAL,
       T.SUPP_IS_SUPPLIER,
       T.SUPP_IS_MAINTENANCER,
       T.SUPP_IS_MANUFACTURER,
       T.SUPP_IS_SUB_COMPANY,
       T.SUPP_INDUSTRY_TYPE,
       T.SUPP_WEBSITE,
       T.SUPP_REG_CAPITAL,
       T.SUPP_REG_CAP_CURRENCY,
       T.SUPP_PER_GRADE,
       T.SUPP_RELATION_GRADE,
       T.SUPP_ADDRESS,
       T.SUPP_ADD_POSTAL,
       T.SUPPLIER_LINK_MAN,
       T.SUPP_CONTACT_FAX,
       T.SUPP_CONTACT_TEL,
       T.SUPP_CONTACT_EMAIL,
       T.SUPP_CONTACT_CELL_PHONE,
       T.SUPP_CONTACT_TITLE,
       T.SUPP_COMMENT,
       T.SUPP_CREDIT_RATE,
       T.MENT_DEPT_CODE,
       T.MENT_DEPT_DESC,
       T.MENT_UNIT_CODE,
       T.MENT_UNIT_DESC,
       T.BUYER_DEPT_CODE,
       T.BUYER_DEPT_DESC,
       T.BUYER_UNIT_CODE,
       T.BUYER_UNIT_DESC,
       T.STATUS,
       T.VALIDFLAG,
       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,
       T.SUSPEND_STATUS,
       T.CREATE_USERID,
       T.UPDATE_USERID,
       T.DELETE_USERID,
       T.PASSWORD,
       T.SUPP_TAX_RATE,
       T.SUPP_NATIONALITY_CODE,
       T.SUPP_PROVINCE_CODE,
       T.SUPP_OFFICE_PROVINCE_CODE,
       T.SUPP_TYPE
 FROM COM_BASE_SUPP T
 WHERE
       T.SUPP_CODE = {0}
        ]]>
    </query>
    <query id="ComBaseSuppDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO COM_BASE_SUPP(
        SUPP_CODE,
        SUPP_NAME,
        ORG_CODE,
        SUPP_SHORT_NAME,
        SUPP_TAX_ID,
        SUPP_CHARACTER,
        SUPP_REGISTRAR_NAME,
        SUPP_NATIONALITY,
        SUPP_PROVINCE,
        SUPP_CITY,
        SUPP_OFFICE_PROVINCE,
        SUPP_START_DATE,
        SUPP_END_DATE,
        SUPP_TAX_START_DATE,
        SUPP_TAX_END_DATE,
        SUPP_LIC_NUM,
        SUPP_LIC_START_DATE,
        SUPP_LIC_END_DATE,
        SUPP_OPERATE_SCOPE,
        SUPP_IS_INTERNAL,
        SUPP_IS_SUPPLIER,
        SUPP_IS_MAINTENANCER,
        SUPP_IS_MANUFACTURER,
        SUPP_IS_SUB_COMPANY,
        SUPP_INDUSTRY_TYPE,
        SUPP_WEBSITE,
        SUPP_REG_CAPITAL,
        SUPP_REG_CAP_CURRENCY,
        SUPP_PER_GRADE,
        SUPP_RELATION_GRADE,
        SUPP_ADDRESS,
        SUPP_ADD_POSTAL,
        SUPPLIER_LINK_MAN,
        SUPP_CONTACT_FAX,
        SUPP_CONTACT_TEL,
        SUPP_CONTACT_EMAIL,
        SUPP_CONTACT_CELL_PHONE,
        SUPP_CONTACT_TITLE,
        SUPP_COMMENT,
        SUPP_CREDIT_RATE,
        MENT_DEPT_CODE,
        MENT_DEPT_DESC,
        MENT_UNIT_CODE,
        MENT_UNIT_DESC,
        BUYER_DEPT_CODE,
        BUYER_DEPT_DESC,
        BUYER_UNIT_CODE,
        BUYER_UNIT_DESC,
        STATUS,
        CREATE_NAME,
        CREATE_TIME,
        SUSPEND_STATUS,
        CREATE_USERID,
        PASSWORD,
        SUPP_TAX_RATE,
        SUPP_NATIONALITY_CODE,
        SUPP_PROVINCE_CODE,
        SUPP_OFFICE_PROVINCE_CODE,
        SUPP_TYPE)
 VALUES( 
        '#SUPP_CODE#',
        '#SUPP_NAME#',
        '#ORG_CODE#',
        '#SUPP_SHORT_NAME#',
        '#SUPP_TAX_ID#',
        '#SUPP_CHARACTER#',
        '#SUPP_REGISTRAR_NAME#',
        '#SUPP_NATIONALITY#',
        '#SUPP_PROVINCE#',
        '#SUPP_CITY#',
        '#SUPP_OFFICE_PROVINCE#',
        '#SUPP_START_DATE#',
        '#SUPP_END_DATE#',
        '#SUPP_TAX_START_DATE#',
        '#SUPP_TAX_END_DATE#',
        '#SUPP_LIC_NUM#',
        '#SUPP_LIC_START_DATE#',
        '#SUPP_LIC_END_DATE#',
        '#SUPP_OPERATE_SCOPE#',
        '#SUPP_IS_INTERNAL#',
        '#SUPP_IS_SUPPLIER#',
        '#SUPP_IS_MAINTENANCER#',
        '#SUPP_IS_MANUFACTURER#',
        '#SUPP_IS_SUB_COMPANY#',
        '#SUPP_INDUSTRY_TYPE#',
        '#SUPP_WEBSITE#',
        '#SUPP_REG_CAPITAL#',
        '#SUPP_REG_CAP_CURRENCY#',
        '#SUPP_PER_GRADE#',
        '#SUPP_RELATION_GRADE#',
        '#SUPP_ADDRESS#',
        '#SUPP_ADD_POSTAL#',
        '#SUPPLIER_LINK_MAN#',
        '#SUPP_CONTACT_FAX#',
        '#SUPP_CONTACT_TEL#',
        '#SUPP_CONTACT_EMAIL#',
        '#SUPP_CONTACT_CELL_PHONE#',
        '#SUPP_CONTACT_TITLE#',
        '#SUPP_COMMENT#',
        '#SUPP_CREDIT_RATE#',
        '#MENT_DEPT_CODE#',
        '#MENT_DEPT_DESC#',
        '#MENT_UNIT_CODE#',
        '#MENT_UNIT_DESC#',
        '#BUYER_DEPT_CODE#',
        '#BUYER_DEPT_DESC#',
        '#BUYER_UNIT_CODE#',
        '#BUYER_UNIT_DESC#',
        '#STATUS#',
        '#CREATE_NAME#',
        SYSDATE,
        '#SUSPEND_STATUS#',
        '#CREATE_USERID#',
        '#PASSWORD#',
        '#SUPP_TAX_RATE#',
        '#SUPP_NATIONALITY_CODE#',
        '#SUPP_PROVINCE_CODE#',
        '#SUPP_OFFICE_PROVINCE_CODE#',
        '#SUPP_TYPE#')
        ]]>
    </query>
    <query id="ComBaseSuppDAL.Update" desc="修改">
        <![CDATA[
 UPDATE COM_BASE_SUPP T
   SET 
        T.SUPP_CODE = '#SUPP_CODE#',
        T.SUPP_NAME = '#SUPP_NAME#',
        T.ORG_CODE = '#ORG_CODE#',
        T.SUPP_SHORT_NAME = '#SUPP_SHORT_NAME#',
        T.SUPP_TAX_ID = '#SUPP_TAX_ID#',
        T.SUPP_CHARACTER = '#SUPP_CHARACTER#',
        T.SUPP_REGISTRAR_NAME = '#SUPP_REGISTRAR_NAME#',
        T.SUPP_NATIONALITY = '#SUPP_NATIONALITY#',
        T.SUPP_PROVINCE = '#SUPP_PROVINCE#',
        T.SUPP_CITY = '#SUPP_CITY#',
        T.SUPP_OFFICE_PROVINCE = '#SUPP_OFFICE_PROVINCE#',
        T.SUPP_START_DATE = '#SUPP_START_DATE#',
        T.SUPP_END_DATE = '#SUPP_END_DATE#',
        T.SUPP_TAX_START_DATE = '#SUPP_TAX_START_DATE#',
        T.SUPP_TAX_END_DATE = '#SUPP_TAX_END_DATE#',
        T.SUPP_LIC_NUM = '#SUPP_LIC_NUM#',
        T.SUPP_LIC_START_DATE = '#SUPP_LIC_START_DATE#',
        T.SUPP_LIC_END_DATE = '#SUPP_LIC_END_DATE#',
        T.SUPP_OPERATE_SCOPE = '#SUPP_OPERATE_SCOPE#',
        T.SUPP_IS_INTERNAL = '#SUPP_IS_INTERNAL#',
        T.SUPP_IS_SUPPLIER = '#SUPP_IS_SUPPLIER#',
        T.SUPP_IS_MAINTENANCER = '#SUPP_IS_MAINTENANCER#',
        T.SUPP_IS_MANUFACTURER = '#SUPP_IS_MANUFACTURER#',
        T.SUPP_IS_SUB_COMPANY = '#SUPP_IS_SUB_COMPANY#',
        T.SUPP_INDUSTRY_TYPE = '#SUPP_INDUSTRY_TYPE#',
        T.SUPP_WEBSITE = '#SUPP_WEBSITE#',
        T.SUPP_REG_CAPITAL = '#SUPP_REG_CAPITAL#',
        T.SUPP_REG_CAP_CURRENCY = '#SUPP_REG_CAP_CURRENCY#',
        T.SUPP_PER_GRADE = '#SUPP_PER_GRADE#',
        T.SUPP_RELATION_GRADE = '#SUPP_RELATION_GRADE#',
        T.SUPP_ADDRESS = '#SUPP_ADDRESS#',
        T.SUPP_ADD_POSTAL = '#SUPP_ADD_POSTAL#',
        T.SUPPLIER_LINK_MAN = '#SUPPLIER_LINK_MAN#',
        T.SUPP_CONTACT_FAX = '#SUPP_CONTACT_FAX#',
        T.SUPP_CONTACT_TEL = '#SUPP_CONTACT_TEL#',
        T.SUPP_CONTACT_EMAIL = '#SUPP_CONTACT_EMAIL#',
        T.SUPP_CONTACT_CELL_PHONE = '#SUPP_CONTACT_CELL_PHONE#',
        T.SUPP_CONTACT_TITLE = '#SUPP_CONTACT_TITLE#',
        T.SUPP_COMMENT = '#SUPP_COMMENT#',
        T.SUPP_CREDIT_RATE = '#SUPP_CREDIT_RATE#',
        T.MENT_DEPT_CODE = '#MENT_DEPT_CODE#',
        T.MENT_DEPT_DESC = '#MENT_DEPT_DESC#',
        T.MENT_UNIT_CODE = '#MENT_UNIT_CODE#',
        T.MENT_UNIT_DESC = '#MENT_UNIT_DESC#',
        T.BUYER_DEPT_CODE = '#BUYER_DEPT_CODE#',
        T.BUYER_DEPT_DESC = '#BUYER_DEPT_DESC#',
        T.BUYER_UNIT_CODE = '#BUYER_UNIT_CODE#',
        T.BUYER_UNIT_DESC = '#BUYER_UNIT_DESC#',
        T.STATUS = '#STATUS#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.SUSPEND_STATUS = '#SUSPEND_STATUS#',
        T.UPDATE_USERID = '#UPDATE_USERID#',
        T.PASSWORD = '#PASSWORD#',
        T.SUPP_TAX_RATE = '#SUPP_TAX_RATE#',
        T.SUPP_NATIONALITY_CODE = '#SUPP_NATIONALITY_CODE#',
        T.SUPP_PROVINCE_CODE = '#SUPP_PROVINCE_CODE#',
        T.SUPP_OFFICE_PROVINCE_CODE = '#SUPP_OFFICE_PROVINCE_CODE#',
        T.SUPP_TYPE = '#SUPP_TYPE#'
 WHERE
       T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
    </query>
    <query id="ComBaseSuppDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT LPAD(NVL(MAX(SUPP_CODE), 0) + 1, 5, '0') MAX_VALUE FROM COM_BASE_SUPP T
        ]]>
    </query>
    <query id="ComBaseSuppDAL.Delete" desc="作废">
        <![CDATA[
UPDATE COM_BASE_SUPP T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
    </query>
    <query id="ComBaseSuppDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE COM_BASE_SUPP T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
    </query>
    <query id="ComBaseSuppDAL.QueryRegion" desc="查询行政区域">
        <![CDATA[
SELECT * FROM SEL_ADMIN_REGION T WHERE T.VALIDFLAG = '1'
        ]]>
    </query>
    <query id="ComBaseSuppDAL.IsRepeat" desc="查询行政区域">
        <![CDATA[
SELECT COUNT(1)
  FROM COM_BASE_SUPP T
 WHERE T.SUPP_NAME = {0}
   AND T.SUPP_CODE <> {1}
        ]]>
    </query>
</queryMap>