<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="COM_BASE_WBS （生成工具：代码生成工具1.0.0.0   访问地址：http://172.16.2.128/tool/）">
    <query id="SlmBaseCustStorage.Query" desc="查询">
        <![CDATA[
 SELECT
       T.ID,
       T.STORAGE_NO,
       T.STORAGE_NO STORAGE_NAME,
       T.CUSTOMER_NO,
       T.CUSTOMER_NO CUSTOMER_NM,
       T.MEMO,
       DECODE( T.VALIDFLAG ,'1','有效','无效') 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
 FROM SLM_BASE_CUST_STORAGE T
 WHERE
       1 = 1
        ]]>
    </query>

    <query id="SlmBaseCustStorage.QueryStorage" desc="查询">
        <![CDATA[
 SELECT
       T.STORAGE_NO,
       T.STORAGE_NAME
 FROM YDM_BS_STORAGE T
 WHERE
       STORAGE_ADDR_NO = '800988' order by STORAGE_NAME
        ]]>
    </query>

    <query id="SlmBaseCustStorage.QueryCustomer" desc="查询">
        <![CDATA[
 SELECT
       T.CUSTOMER_NO,
       T.CUSTOMER_NM
 FROM SLM_BASE_CUSTOMER T
 WHERE
       VALIDFLAG = '1' order by CUSTOMER_NM
        ]]>
    </query>

    <query id="SlmBaseCustStorage.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT
       T.ID,
       T.STORAGE_NO,
       T.STORAGE_NAME,
       T.CUSTOMER_NO,
       T.CUSTOMER_NM,
       T.MEMO,
       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
 FROM SLM_BASE_CUST_STORAGE T
 WHERE
      T.ID = '#ID#'
        ]]>
    </query>
    <query id="SlmBaseCustStorage.Insert" desc="新增">
        <![CDATA[
 INSERT INTO SLM_BASE_CUST_STORAGE(
        STORAGE_NO,
        STORAGE_NAME,
        CUSTOMER_NO,
        CUSTOMER_NM,
        MEMO,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME)
 VALUES(
        '#STORAGE_NO#',
        '#STORAGE_NAME#',
        '#CUSTOMER_NO#',
        '#CUSTOMER_NM#',
        '#MEMO#',
        DECODE('#VALIDFLAG#','有效','1','无效','0','1','1','0','0','1'),
        '#CREATE_NAME#',
        SYSDATE)
        ]]>
    </query>
    <query id="SlmBaseCustStorage.Update" desc="修改">
        <![CDATA[
 UPDATE SLM_BASE_CUST_STORAGE T
   SET
        T.STORAGE_NO = '#STORAGE_NO#',
        T.STORAGE_NAME = '#STORAGE_NAME#',
        T.CUSTOMER_NO = '#CUSTOMER_NO#',
        T.CUSTOMER_NM = '#CUSTOMER_NM#',
        T.MEMO = '#MEMO#',
        T.VALIDFLAG = DECODE('#VALIDFLAG#','有效','1','无效','0','1','1','0','0','1'),
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE
 WHERE
    T.ID = '#ID#'
        ]]>
    </query>

    <query id="SlmBaseCustStorage.Delete" desc="作废">
        <![CDATA[
 UPDATE SLM_BASE_CUST_STORAGE T
   SET
        T.VALIDFLAG = '0',
        T.DELETE_NAME = '#DELETE_NAME#',
        T.DELETE_TIME = SYSDATE
 WHERE
    T.ID = '#ID#'
        ]]>
    </query>
    <query id="SlmBaseCustStorage.Resume" desc="恢复">
        <![CDATA[
    UPDATE SLM_BASE_CUST_STORAGE 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>
</queryMap>