<?xml version="1.0" encoding="UTF-8"?>
<queryMap
	desc="COM_BASE_PURCHASE_PROVIDER （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
	<query id="ComBasePurchaseProviderDAL.Query" desc="查询">
        <![CDATA[
 SELECT T.SUPP_CODE,
        T.SUPP_NAME,
        DECODE(A.SUPP_CODE, NULL, 'False', 'True') CHK
   FROM COM_BASE_SUPP T
   LEFT JOIN COM_BASE_PURCHASE_PROVIDER A
     ON A.SUPP_CODE = T.SUPP_CODE
     AND A.AGREEMENT_CODE = {0}
  WHERE T.VALIDFLAG = '1'
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.QueryProviderBaseData" desc="查询供应商基础数据">
        <![CDATA[
SELECT T.SUPP_CODE, T.SUPP_NAME
  FROM COM_BASE_SUPP T
 WHERE T.VALIDFLAG = '1'
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.AGREEMENT_CODE,
       T.SUPP_CODE,
       T.SUPP_NAME
 FROM COM_BASE_PURCHASE_PROVIDER T
 WHERE
       T.AGREEMENT_CODE = '#AGREEMENT_CODE#'
       AND T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO COM_BASE_PURCHASE_PROVIDER(
        AGREEMENT_CODE,
        SUPP_CODE,
        SUPP_NAME)
 VALUES( 
        '#AGREEMENT_CODE#',
        '#SUPP_CODE#',
        '#SUPP_NAME#')
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.Update" desc="修改">
        <![CDATA[
 UPDATE COM_BASE_PURCHASE_PROVIDER T
   SET 
        T.AGREEMENT_CODE = '#AGREEMENT_CODE#',
        T.SUPP_CODE = '#SUPP_CODE#',
        T.SUPP_NAME = '#SUPP_NAME#'
 WHERE
       T.AGREEMENT_CODE = '#AGREEMENT_CODE#'
       AND T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT NVL(MAX(AGREEMENT_CODE), 0) + 1 MAX_VALUE FROM COM_BASE_PURCHASE_PROVIDER T
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.Delete2" desc="作废">
        <![CDATA[
DELETE FROM (SELECT *
               FROM COM_BASE_PURCHASE_PROVIDER T
              WHERE T.AGREEMENT_CODE = '#AGREEMENT_CODE#')
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.Delete" desc="作废">
        <![CDATA[
UPDATE COM_BASE_PURCHASE_PROVIDER T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.AGREEMENT_CODE = '#AGREEMENT_CODE#'
       AND T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
	</query>
	<query id="ComBasePurchaseProviderDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE COM_BASE_PURCHASE_PROVIDER T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.AGREEMENT_CODE = '#AGREEMENT_CODE#'
       AND T.SUPP_CODE = '#SUPP_CODE#'
        ]]>
	</query>
</queryMap>