<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="RP_KAOHE_ITEMQUANZHONG （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
   
   	<query id="RpKaoheItemquanzhongDAL.QueryItemtype" desc="查询指标类型">
	<![CDATA[
	select t.itemtypedesc from CXUSER.RP_KAOHE_ITEMTYPE t
   
		   
	]]>

	</query>
   
   
   
    <query id="RpKaoheItemquanzhongDAL.Query" desc="查询">
        <![CDATA[
 SELECT 
       T.ITEM_ID,
       T.ITEM_TYPE,
       T.ITEM_NAME,
       T.AWARD_MONEY,
       T.TEGANG,
       T.ZHAGUAN,
       T.GJG,
       T.ZHIZAOBU,
       T.GYGUANLI,
       T.GANGYANSUO,
       T.ZHIBAOBU,
       
         DECODE(T.VALIDFLAG,'1','有效','0','无效') VALIDFLAG,
       TO_CHAR(T.CREATEDATE, 'YYYY-MM-DD HH24:MI:SS') CREATEDATE,
       T.CREATEBY,
       TO_CHAR(T.UPDATEDATE, 'YYYY-MM-DD HH24:MI:SS') UPDATEDATE,
       T.UPDATEBY
 FROM RP_KAOHE_ITEMQUANZHONG T
  WHERE T.ITEM_NAME LIKE '%'|| '#ITEM_NAME#' || '%'
   AND T.VALIDFLAG IN ('1', '#VALIDFLAG#')
        ]]>
    </query>
    <query id="RpKaoheItemquanzhongDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.ITEM_ID,
       T.ITEM_TYPE,
       T.ITEM_NAME,
       T.AWARD_MONEY,
       T.TEGANG,
       T.ZHAGUAN,
       T.GJG,
       T.ZHIZAOBU,
       T.GYGUANLI,
       T.GANGYANSUO,
       T.ZHIBAOBU,
       T.VALIDFLAG,
       
       TO_CHAR(T.CREATEDATE, 'YYYY-MM-DD HH24:MI:SS') CREATEDATE,
       T.CREATEBY,
       TO_CHAR(T.UPDATEDATE, 'YYYY-MM-DD HH24:MI:SS') UPDATEDATE,
       T.UPDATEBY
 FROM RP_KAOHE_ITEMQUANZHONG T
 WHERE
      1<>1
        ]]>
    </query>
    <query id="RpKaoheItemquanzhongDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO RP_KAOHE_ITEMQUANZHONG(
        ITEM_ID,
        ITEM_TYPE,
        ITEM_NAME,
        AWARD_MONEY,
        TEGANG,
        ZHAGUAN,
        GJG,
        ZHIZAOBU,
        GYGUANLI,
        GANGYANSUO,
        ZHIBAOBU,
        VALIDFLAG,
        CREATEDATE,
        CREATEBY,
        UPDATEDATE,
        UPDATEBY)
 VALUES( 
        (SELECT 'T' || LPAD(TO_NUMBER(NVL(SUBSTR(MAX(ITEM_ID), 2, 6), '0')) + 1, 6, '0') FROM RP_KAOHE_ITEMQUANZHONG A ), 
        '#ITEM_TYPE#',
        '#ITEM_NAME#',
        '#AWARD_MONEY#',
        '#TEGANG#',
        '#ZHAGUAN#',
        '#GJG#',
        '#ZHIZAOBU#',
        '#GYGUANLI#',
        '#GANGYANSUO#',
        '#ZHIBAOBU#',
        '1',
        SYSDATE,
        '#CREATEBY#',
        SYSDATE,
        '#UPDATEBY#')
        ]]>
    </query>
    <query id="RpKaoheItemquanzhongDAL.Update" desc="修改">
        <![CDATA[
 UPDATE RP_KAOHE_ITEMQUANZHONG T
   SET 
       
        T.ITEM_TYPE = '#ITEM_TYPE#',
        T.ITEM_NAME = '#ITEM_NAME#',
        T.AWARD_MONEY = '#AWARD_MONEY#',
        T.TEGANG = '#TEGANG#',
        T.ZHAGUAN = '#ZHAGUAN#',
        T.GJG = '#GJG#',
        T.ZHIZAOBU = '#ZHIZAOBU#',
        T.GYGUANLI = '#GYGUANLI#',
        T.GANGYANSUO = '#GANGYANSUO#',
        T.ZHIBAOBU = '#ZHIBAOBU#',
      
       
        T.UPDATEDATE = SYSDATE,
        T.UPDATEBY = '#UPDATEBY#'
 WHERE
      T.ITEM_ID='#ITEM_ID#'
        ]]>
    </query>
    <query id="RpKaoheItemquanzhongDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT NVL(MAX(?), 0) + 1 MAX_VALUE FROM RP_KAOHE_ITEMQUANZHONG T
        ]]>
    </query>
    <query id="RpKaoheItemquanzhongDAL.Delete" desc="作废">
        <![CDATA[
UPDATE RP_KAOHE_ITEMQUANZHONG T
   SET
       T.VALIDFLAG = '0',
       T.UPDATEDATE = SYSDATE,
       T.UPDATEBY = '#UPDATEBY#'
WHERE
       T.ITEM_ID='#ITEM_ID#'
        ]]>
    </query>
    <query id="RpKaoheItemquanzhongDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE RP_KAOHE_ITEMQUANZHONG T
   SET
       T.VALIDFLAG = '1',
       T.UPDATEDATE = SYSDATE,
       T.UPDATEBY = '#UPDATEBY#'
WHERE
       T.ITEM_ID='#ITEM_ID#'
        ]]>
    </query>
</queryMap>