<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="COM_BASE_WBS （生成工具：代码生成工具1.0.0.0   访问地址：http://172.16.2.128/tool/）">
    <query id="ComBaseWbsDAL.Query" desc="查询">
        <![CDATA[
 SELECT
       T.WBS_CODE,
       T.WBS_NAME,
       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 COM_BASE_WBS T
 WHERE
       1 = 1
        ]]>
    </query>
    <query id="ComBaseWbsDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT
       T.WBS_CODE,
       T.WBS_NAME,
       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 COM_BASE_WBS T
 WHERE
       T.WBS_CODE = '#WBS_CODE#'
        ]]>
    </query>
    <query id="ComBaseWbsDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO COM_BASE_WBS(
        WBS_CODE,
        WBS_NAME,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME)
 VALUES(
        '#WBS_CODE#',
        '#WBS_NAME#',
        DECODE('#VALIDFLAG#','有效','1','无效','0','1','1','0','0','1'),
        '#CREATE_NAME#',
        SYSDATE)
        ]]>
    </query>
    <query id="ComBaseWbsDAL.Update" desc="修改">
        <![CDATA[
 UPDATE COM_BASE_WBS T
   SET
        T.WBS_CODE = '#WBS_CODE#',
        T.WBS_NAME = '#WBS_NAME#',
        T.VALIDFLAG =  DECODE('#VALIDFLAG#','有效','1','无效','0','1','1','0','0','1'),
        T.CREATE_NAME = '#CREATE_NAME#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.DELETE_NAME = '#DELETE_NAME#'
 WHERE
       T.WBS_CODE = '#WBS_CODE#'
        ]]>
    </query>
    <query id="ComBaseWbsDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT NVL(MAX(WBS_CODE), 0) + 1 MAX_VALUE FROM COM_BASE_WBS T
        ]]>
    </query>
    <query id="ComBaseWbsDAL.Delete" desc="作废">
        <![CDATA[
UPDATE COM_BASE_WBS T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.WBS_CODE = '#WBS_CODE#'
        ]]>
    </query>
    <query id="ComBaseWbsDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE COM_BASE_WBS T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.WBS_CODE = '#WBS_CODE#'
        ]]>
    </query>
</queryMap>